WriteResultsBuffer

Writes data from a referenced Buffer data structure, created by a FormatOutputBuffer function, to the currently enabled factory communication protocol (which is enabled in the Network Settings dialog). This function also writes the Result Code field for the factory communication protocols. For more information, see FormatOutputBuffer.

Note: If the WriteResultsBuffer function is used when the PROFINET communication protocol is enabled, bytes will be swapped. For more information, see PROFINET Communications.

WriteResultsBuffer Inputs

Syntax: WriteResultsBuffer(Event,Buffer,Result Code,Protocol,Byte/Word Order)

   

Event

Specifies the event that forces an update.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 FormatOutputBuffer function, which contains automatically formatted data.

Note: The maximum length for output data is 4,000 bytes.
Result Code

Specifies a 16-bit integer that can be used to communicate the result of the In-Sight vision system's inspection to any connected devices.

Protocol

Specifies which protocol the user data should be written to.

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 = EtherNet/IP

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

1 = PROFINET

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

2 = SLMP Protocol Scanner

Specifies that SLMP Scanner is the enabled factory communication protocol. For more information, see Configuring 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 writes result buffer to the RX bit space. For more information, see Communicating 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 writes result buffer to the RWr word space. For more information, see Communicating with a Mitsubishi Automation Controller on CC-Link IE Field Network Basic.

100 = Any (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.

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

WriteResultsBuffer Outputs

Returns

  • A Write Result data structure containing the data sent to the client.
  • When connected to an In-Sight vision system running In-Sight firmware 4.x.x and earlier, the function will return the number of elements written or #ERR if an input parameter is invalid, or if a connection to a client has not been established.