# ReadUserDataBuffer

This function is used to read 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.

## ReadUserDataBuffer Inputs

Parameter | Description
Event | Specifies the update event on which to read data. This parameter must be a reference to one of the following: The Image data structure in cell A0, containing the AcquireImage function. 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 should 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.
100 = Default | Specifies that the currently enabled factory communication protocol will be used. If more than one protocol is enabled, the first enabled protocol will be used.
Validate Connection | Specifies whether or not the function will attempt to validate the connection. If enabled, the function will return #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 will be applied and double word types will have their word pair order switched. (16-bit words)
3 = Little endian with 16-bit word swapping | Little endian byte style will be applied and double word types will have their word pair order switched. (16-bit words)
100 = Default | The default setting is used.

## ReadUserDataBuffer 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.