FP_ETHERNETIP_DATA_SET_BYTES

Write byte data to the send buffer of EtherNet/IP unit

This FP instruction writes byte data into the send data buffer specified by FP_ETHERNETIP_DATA_SEND_DUT for an EtherNet/IP message that has been exchanged with FP_ETHERNETIP_DATA_EXCHANGE_FB.

Parameters

Input

DataStart (BOOL, INT, UINT, WORD, DINT, UDINT, DWORD, REAL, DATE, TOD, DT, STRING)

Start address of the byte data to be written to the send data buffer.

nNumberOfBytes (WORD, INT, UINT)

Number of bytes to be written to the send data buffer.

bAppendData (BOOL)

Flag indicating that data should be appended to an existing buffer.

  • When FALSE is set, the send data buffer size is set to 0 and the data is written to the first position.

  • When TRUE is set, data is written to the send data buffer at the current position and the send data buffer size is increased by nNumberOfBytes.

Input/output

dutSendData (FP_ETHERNETIP_DATA_SEND_DUT)

Data unit type of the send 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:=[16#0B0A,16#000C];
		bEncodeMessage: BOOL:=FALSE;
		bAppendData: BOOL:=FALSE;
		dutSendData: FP_ETHERNETIP_DATA_SEND_DUT;
		iNumberOfBytes: INT:=3;
	END_VAR

LD body

When the variable bEncodeMessage 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 := 7 ;
        NETWORK_BODY
B(B_CONTACT,,bEncodeMessage,5,1,7,3,);
B(B_F,FP_ETHERNETIP_DATA_SET_BYTES!,,15,0,32,7,,?DEN?DDataStart?DnNumberOfBytes?DbAppendData?DdutSendData?AdutSendData?AENO);
B(B_VARIN,,awMessageData,13,2,15,4,);
B(B_VARIN,,iNumberOfBytes,13,3,15,5,);
B(B_VARIN,,bAppendData,13,4,15,6,);
B(B_VARIN,,dutSendData,13,5,15,7,);
L(1,0,1,7);
L(1,2,5,2);
L(7,2,15,2);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

if (bEncodeMessage) then
    FP_ETHERNETIP_DATA_SET_BYTES(DataStart := awMessageData,
                                  nNumberOfBytes := iNumberOfBytes,
                                  bAppendData := bAppendData,
                                  dutSendData := dutSendData);	
end_if;

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