FP_ETHERNETIP_DATA_SET

Write data to send buffer of EtherNet/IP unit

This FP instruction writes 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

Data (BOOL, INT, UINT, WORD, DINT, UDINT, DWORD, REAL, DATE, TOD, DT, STRING)
  • Data which will be written into the send buffer.

  • The amount of data which will be written into the send buffer depends on the data type of the connected variable.

  • For data type STRING, the current string length and the characters are written into the send buffer.

  • Boolean variables are not allowed.

bAppendData (BOOL)

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

  • When FALSE is set, the send buffer is cleared before writing data into the send buffer.

  • When TRUE is set, the send buffer is not cleared and the data is appended to the data already in the buffer.

    The data is appended to the member awData at byte position iDataSize_Bytes of FP_ETHERNETIP_DATA_SEND_DUT.

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
		bAppend: BOOL:=FALSE;
		bEnable: BOOL:=FALSE;
		sData: STRING[32]:='';
		dutSend: FP_ETHERNETIP_DATA_SEND_DUT;
	END_VAR

LD body

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_SET!,,17,0,31,6,,?DEN?DData?DbAppendData?DdutSendData?AdutSendData?AENO);
B(B_VARIN,,sData,15,2,17,4,);
B(B_VARIN,,bAppend,15,3,17,5,);
B(B_VARIN,,dutSend,15,4,17,6,);
L(1,0,1,6);
L(1,2,4,2);
L(6,2,17,2);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

If (bEnable) Then
    FP_ETHERNETIP_DATA_SET(Data := sData,
                           bAppendData := bAppend,
                           dutSendData := dutSend);
End_if;

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