Read data from receive buffer of EtherNet/IP unit
This FP instruction reads data from the receive data buffer specified by FP_ETHERNETIP_DATA_RECEIVE_DUT for an EtherNet/IP message that has been exchanged with FP_ETHERNETIP_DATA_EXCHANGE_FB.
Input
Data unit type of the receive data buffer.
Input/output
Current byte offset in the receive data buffer.
For reading data from the starting address, set the byte offset 0.
Output
Data which will be read from the receive buffer.
The amount of data which will be read from the receive buffer depends on the data type of the connected variable.
For data type STRING, the current string length and the characters are read from the buffer.
Boolean variables are not allowed.
if the area specified using the index modifier exceeds the limit.
if the EtherNet/IP function is not used in the Ethernet unit configuration.
if a value specified for a parameter is outside the permissible range.
if the area specified using the index modifier exceeds the limit.
if the EtherNet/IP function is not used in the Ethernet unit configuration.
if a value specified for a parameter is outside the permissible range.
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
sData: STRING[32]:='';
iOffset: INT:=0;
bEnable: BOOL:=FALSE;
dutReceive: FP_ETHERNETIP_DATA_RECEIVE_DUT;
END_VAR
When the variable bEnable is set to TRUE, the function is executed.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_CONTACT,,bEnable,4,1,6,3,);
B(B_F,FP_ETHERNETIP_DATA_GET!,,17,0,31,5,,?DEN?DdutReceiveData?DByteOffset?AByteOffset?AENO?CData);
B(B_VARIN,,dutReceive,15,2,17,4,);
B(B_VAROUT,,sData,36,2,38,4,);
B(B_VARIN,,iOffset,15,3,17,5,);
L(1,0,1,6);
L(1,2,4,2);
L(6,2,17,2);
L(31,3,36,3);
END_NETWORK_BODY
END_NET_WORK
END_BODY
If (bEnable) Then
FP_ETHERNETIP_DATA_GET(dutReceiveData := dutReceive,
ByteOffset := iOffset,
Data => sData);
End_if;