FP_ETHERNETIP_REFRESH_INPUT

Refresh EtherNet/IP input

This FP instruction refreshes the input data from the receive buffer of the node and connection number specified. Data are copied from the PLC’s receive buffer to the PLC’s operation memory.

Parameters

Input

s1_NodeNumber (WORD, INT, UINT)

Node number of the input data to refresh. Scan list range: 1–256

  • An error occurs when the value specified is outside the scan list range.

  • An error also occurs when a reserved node is specified.

s2_ConnectionNumber (WORD, INT, UINT)

Node connection number of the input data to refresh. Range: 1–256

An error occurs when the value specified is outside the scan list range.

Output

d_Result (WORD)

Memory area storing the refresh results.

  • 0: Refresh operation is completed successfully.

  • 1: No data is received. Refresh is not performed.

  • 2: EtherNet/IP is not ready for communication.

Remarks

  • Before you execute the instruction, check if the communication of a specified connection runs normally using FP_ETHERNETIP_GET_STATE_TABLE_RUN.

  • Call this instruction after sys_bIsEtherNetIPReady turns to TRUE. If it is called before sys_bIsEtherNetIPReady turns to TRUE, an error indicating EtherNet/IP is not ready for communication is returned.

  • Do not execute this instruction continuously in one scan to reduce communication load.

  • Use this instruction only for the connection for which Instruction is selected as Refresh Method in EtherNet/IP setting.

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the EtherNet/IP function is not used in the Ethernet unit configuration.

  • if the area specified using the index modifier exceeds the limit.

  • if a value specified for a parameter is outside the permissible range.

  • if the node or connection specified by s1_NodeNumber and s2_ConnectionNumber does not exist.

  • if the refresh method selected for the connection is something other than Instruction.

  • if the number of input data of the specified connection is 0.

  • if the number of refreshed data of the specified connection is 0.

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the EtherNet/IP function is not used in the Ethernet unit configuration.

  • if the area specified using the index modifier exceeds the limit.

  • if a value specified for a parameter is outside the permissible range.

  • if the node or connection specified by s1_NodeNumber and s2_ConnectionNumber does not exist.

  • if the refresh method selected for the connection is something other than Instruction.

  • if the number of input data of the specified connection is 0.

  • if the number of refreshed data of the specified connection is 0.

Example

POU header

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

	VAR
		bEnable: BOOL:=FALSE;
		iNodeNumber: INT:=0;
		iConnectionNumber: INT:=0;
		wResult: WORD:=0;
	END_VAR
	VAR
		bEnable: BOOL:=FALSE;
		iNodeNumber: INT:=0;
		iConnectionNumber: INT:=0;
		wResult: WORD:=0;
	END_VAR

POU body

When the variables sys_bIsEtherNetIPReady and bEnable are set to TRUE, the function is executed.

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 7 ;
        NETWORK_BODY
B(B_VARIN,,iNodeNumber,13,4,15,6,);
B(B_VARIN,,iConnectionNumber,13,5,15,7,);
B(B_VAROUT,,wResult,31,4,33,6,);
B(B_CONTACT,,bEnable,13,1,15,3,);
B(B_CONTACT,,sys_bIsEtherNetIPReady,5,1,7,3,);
B(B_F,FP_ETHERNETIP_REFRESH_INPUT!,,15,2,31,7,,?DEN?Ds1_NodeNumber?Ds2_ConnectionNumber?AENO?Cd_Result);
L(1,2,5,2);
L(7,2,13,2);
L(15,2,15,4);
L(1,0,1,7);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF (sys_bIsEtherNetIPReady) AND (bEnable) then
    FP_ETHERNETIP_REFRESH_INPUT(s1_NodeNumber := iNodeNumber,
                                s2_ConnectionNumber := iConnectionNumber,
                                d_Result => wResult);
END_IF;

Modified on: 2024-03-06Feedback on this pagePanasonic hotline