# ReadUserDataBuffer

This function is for reading data contained in the User Data field of the currently enabled factory communication protocol. The referenced Buffer data structure, which is created by a FormatInputBuffer function, defines how the received data is interpreted.

Inputs

Parameter | Description
Event | Specifies the update event on which to read data. This parameter needs to be a reference to any event with a timestamp, for example, one of the following: A cell containing an Event function. A cell containing a Button function.
Buffer | Specifies a reference to a Buffer data structure created by a FormatInputBuffer function, which defines how the received data is interpreted.
Protocol | Specifies which protocol the user data needs to be read from.
1 = EtherNet/IP | Specifies that EtherNet/IP is the enabled factory communication protocol.
2 = PROFINET | Specifies that PROFINET is the enabled factory communication protocol.
3 = SLMP Protocol Scanner | Specifies that SLMP is the enabled factory communication protocol.
4 = Modbus TCP Server | Specifies that Modbus TCP is the enabled factory communication protocol.
100 = Default | Specifies that the currently enabled factory communication protocol is used. If more than one protocol is enabled, the first enabled protocol is used.
Validate Connection | Specifies whether the function attempts to validate the connection. If enabled, the function returns #ERR if the selected protocol does not have an active cyclic connection.
Byte/Word Order | Specifies the bit order for words and bytes read by the function.
0 = Big endian | Specifies that the most significant byte is stored first and subsequent bytes are stored in descending order.
1 = Little endian | Specifies that the least significant byte is stored first and subsequent bytes are stored in ascending order.
2 = Big endian with 16-bit word swapping | Big endian byte style is applied and double word types have their word pair order switched. (16-bit words)
3 = Little endian with 16-bit word swapping | Little endian byte style is applied and double word types have their word pair order switched. (16-bit words)
100 = Default | The default setting is used.

Outputs

Returns | A UserData data structure containing the data sent by a client; or #ERR: If any input parameters are invalid If a connection from a client has not been established If the data buffer has not been written to since establishing the connection
Results | Data in the UserData data structure is accessed using the GetBufferData function. For more information, see the Input/Output topic.