FP_ETHERNETIP_DATA_GET_BYTES

Read byte data from receive buffer of EtherNet/IP unit

This FP instruction reads byte 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.

Parameters

Input

dutReceiveData (FP_ETHERNETIP_DATA_RECEIVE_DUT)

Data unit type of the receive data buffer.

nNumberOfBytes (WORD, INT, UINT)

Number of bytes to be read from the receive data buffer.

Input/output

ByteOffset (WORD, INT, UINT)

Current byte offset in the receive data buffer.

Output

DataStart (WORD, INT, UINT)

Start address of the byte data to be read from the receive data buffer.

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • 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.

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • 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.

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
		awMessageData: ARRAY [0..1] OF WORD:=[2(16#0)];
		dutReceiveData: FP_ETHERNETIP_DATA_RECEIVE_DUT;
		iNumberOfBytes: INT:=3;
		iCurrentByteOffset: INT:=0;
		bDecodeMessage: BOOL:=FALSE;
	END_VAR

LD body

When the variable bDecodeMessage is set to TRUE, the function is carried out.

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 9 ;
        NETWORK_BODY
B(B_CONTACT,,bDecodeMessage,5,1,7,3,);
B(B_F,FP_ETHERNETIP_DATA_GET_BYTES!,,17,0,34,6,,?DEN?DdutReceiveData?DnNumberOfBytes?DByteOffset?AByteOffset?AENO?CDataStart);
B(B_VARIN,,dutReceiveData,15,2,17,4,);
B(B_VAROUT,,awMessageData,34,2,36,4,);
B(B_VARIN,,iNumberOfBytes,15,3,17,5,);
B(B_VARIN,,iCurrentByteOffset,15,4,17,6,);
L(1,0,1,9);
L(1,2,5,2);
L(7,2,17,2);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

if (bDecodeMessage) then
    FP_ETHERNETIP_DATA_GET_BYTES(dutReceiveData := dutReceiveData,
                                  nNumberOfBytes := iNumberOfBytes,
                                  ByteOffset := iCurrentByteOffset,
                                  DataStart => awMessageData);
end_if;

Modified on: 2022-03-02Feedback on this pagePanasonic hotline