WriteModbusBuffer

Writes data from a referenced Buffer structure, created by the FormatOutputBuffer function, making it available to a remote client device using the Modbus protocol. The remote client that is reading from the In-Sight vision system must read from Registers 30010 – 30137 to access this data. For more information, see FormatOutputBuffer.

Note:
  • This function is only available on In-Sight vision systems running In-Sight firmware 4.x.x, and is not 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.
  • For available Modbus TCP implementations based on different In-Sight firmware versions, see Modbus TCP Communications.

WriteModbusBuffer Inputs

Syntax: WriteModbusBuffer(Event,Buffer,Byte/Word Order)

Parameter Description

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.

Byte/Word Order

Specifies the bit order for words and bytes written by the function. The available values are:

  • Big endian - Specifies that the most significant value is stored first using 32-bit words.
  • Little endian - Specifies that the least significant value is stored first using 32-bit words.
  • Big endian with 16-bit words - Specifies that the most significant value is stored first.
  • Big endian with 16-bit words - Specifies that the least significant value is stored first.

WriteModbusBuffer Outputs

Returns

The number of elements written or #ERR if an input parameter is invalid, or if a connection to a client has not been established.