ReadUserDataBuffer

Reads (consumes) data contained in the User Data field of the currently enabled factory communication protocol (which is enabled in the Network Settings dialog). The referenced Buffer data structure, which is created by a FormatInputBuffer function, defines how the received data is interpreted. For more information, see Network Settings Dialog and FormatInputBuffer.

Note: If a periodic connection is not actively writing to the data buffer on an enabled industrial protocol, the function will return the data from the last protocol to write to the data buffer.

ReadUserDataBuffer Inputs

Syntax: ReadUserDataBuffer(Event,Buffer,Protocol,Validate Connection,Byte/Word Order)

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. For more information, see AcquireImage.
  • A cell containing an Event function. For more information, see Event.
  • A cell containing a Button function. For more information, see Button.

Buffer

Specifies a reference to a Buffer data structure created by a FormatInputBuffer function, which defines how the received data is interpreted.

Note: The maximum length for input data is 4,000 bytes.

Protocol

Specifies which protocol the user data should be read from.

Note:
  • For In-Sight vision systems running In-Sight 4.9.3 and earlier firmware, if an Industrial Ethernet protocol is not specified, the Modbus TCP Server protocol will be used by default.
  • For a complete list of models and supported firmware versions, see Firmware Versions.

0 = EtherNet/IP

Specifies that EtherNet/IP is the enabled factory communication protocol. For more information, see EtherNet/IP Communications.

Note: This protocol is only available on In-Sight vision systems running In-Sight firmware 5.1.0 and later.

1 = PROFINET

Specifies that PROFINET is the enabled factory communication protocol. For more information, see PROFINET Communications.

Note: This protocol is only available on In-Sight vision systems running In-Sight firmware 5.1.0 and later.

2 = SLMP Scanner

Specifies that SLMP Scanner is the enabled factory communication protocol. For more information, see Configure In-Sight Vision Systems for SLMP Communications.

3 = Modbus TCP Server

Specifies that Modbus TCP Server is the enabled factory communication protocol. For more information, see Modbus TCP Communications.

Note: This protocol is only available on In-Sight vision systems running In-Sight firmware version 5.3.0 and later.

8 = CC-Link IE Field Basic Bit

Specifies that CC-Link IE Field Basic is the enabled factory communication protocol, and reads user data buffer from the RY bit space. For more information, see Communicate with a Mitsubishi Automation Controller on CC-Link IE Field Network Basic.

9 = CC-Link IE Field Basic Word

Specifies that CC-Link IE Field Basic is the enabled factory communication protocol, and reads user data buffer from the RWw word space. For more information, see Communicate with a Mitsubishi Automation Controller on CC-Link IE Field Network Basic.

100 = Default

Specifies that the currently enabled factory communication protocol will be used (which is enabled via the Network Settings dialog). If more than one protocol is enabled, the first enabled protocol will be used. For more information, see Network Settings Dialog.

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.

Note: For EtherNet/IP it will not return #ERR unless an implicit connection was established after the last restart.When implicit messaging is not used, this allows the sensor to receive data explicitly without returning #ERR.

Byte/Word Order

Specifies the bit order for words and bytes read by the function.

Note: This parameter is only available on In-Sight vision systems running In-Sight firmware 5.1.0 and later. For a complete list of models and supported firmware versions, see Firmware Versions.

0 = Big endian (= default for Modbus)

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 (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 (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 (when unselected)

The default setting (below) is used.

EtherNet/IP Little endian
PROFINET Big endian
SLMP Protocol Scanner Little endian
Modbus TCP Server Big endian
CC-Link IE Field Basic Little endian

Examples:

AB (one-word-sized value): A = the most significant byte, B = the least significant byte:

  Order of Arrival
Big endian (=default) AB
Little endian BA
Big endian (word swapping) AB
Little endian (word swapping) BA

12AB (two-word-sized value): 1 = the most significant byte, B = the least significant byte:

  Order of Arrival
Big endian (=default) 12 AB
Little endian BA 21
Big endian (word swapping) AB 12
Little endian (word swapping) 21 BA

ReadUserDataBuffer Outputs

Returns

A UserData data structure containing the data sent by a client; or #ERR if any input parameters are invalid, a connection from a client has not been established or 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 Input/Output.