FormatOutputBuffer

Allows you to configure the format of data that is sent to the WriteCCLinkBitBuffer, WriteCCLinkWordBuffer, WriteDeviceNetBuffer, WriteEIPBuffer, WriteModbusBuffer, WriteProfinetBuffer, WriteMC and WriteResultsBuffer functions. For more information, see:

When FormatOutputBuffer is selected from the Insert Function Dialog, the Format Output Buffer dialog is automatically opened and used to program the function.

FormatOutputBuffer Inputs

Syntax: FormatOutputBuffer(WithErr,Format,Value1,Value2,...)

Parameter Description

WithErr

Specifies whether the function returns a valid buffer, even if an input error has occurred.

0 = Data is put in the buffer even if an input error has occurred (default).

1 = Function returns #ERR and no data is stored in the buffer.

Format

Specifies the Data Type and Element Size (in bytes) to automatically configure.

Note:
  • The maximum length for output data, when using Modbus TCP, EIP or PROFINET communications, is 4,000 bytes. When using SLMP or SLMP Scanner and iQ-R/Q/L Series or iQ-F Series is the selected Controller Type, the maximum length for output data is 1920 bytes. When using SLMP or SLMP Scanner and FX Series is the selected Controller Type, the maximum length for output data is 128 bytes. The maximum length for all other communications is 256 bytes.

  • The function supports a maximum of 248 characters in the formula. An individual 16-bit integer is 3 characters, thus, when using 16-bit integers, the maximum length for output data is 140 bytes. Exceeding this limit will result in the function returning an "Error String too long." If the output data exceeds 140 bytes, use the CombineOutputBuffers function. For more information, see CombineOutputBuffers.

Value

Specifies a variable-length list of values.

FormatOutputBuffer Outputs

Returns

A Buffer data structure containing the formatted data or #ERR if any of the input parameters are invalid.