Format Input/Output Buffer Dialogs

The FormatInputBuffer and FormatOutputBuffer dialogs are used to automatically configure data for the FormatInputBuffer and FormatOutputBuffer functions, and return a Buffer structure containing the formatted data. For more information, see FormatInputBuffer and FormatOutputBuffer.

The data will typically be sent from and/or to a PLC, and can also be used by some Input/Output functions, depending on the type of communication being used. For some protocols, it may be necessary to pad the data, i.e. add unused data in between the desired data, so that the data matches the data alignment of the PLC. For the Ethernet/IP protocol, RSLogix pads User-Defined data types into 4-byte boundaries (The FormatOutputBuffer dialogs do not support aligning data to 4-byte boundaries.). When the Inspection Results data array is received, RSLogix 5000 will assign a single data type to the entire array, regardless if the data that was sent contained multiple data types (integers, floating point, and/or bits). If the results contain different data types, you need to copy the byte offset into the Inspection Results array, and the length, in bytes, into a User-Defined data type in RSLogix, based on the expected data type being sent.

When sending packaged data via one of the supported industrial Ethernet protocols, consult the protocol vendor's documentation to determine the data alignment and packing behavior of the protocol

Display the Format Input Buffer Dialog

  1. Select an empty spreadsheet cell.
  2. On the Insert menu, click Function.
  3. From the Insert Function dialog, expand the Input/Output category.
  4. From the right-hand pane, double-click FormatInputBuffer.

Format Input Buffer Dialog Controls

  • Data Type: Specifies the type of data to automatically configure.
  • Element Size (bytes): When String or Byte-Swapped String is the selected Data Type, specifies the size of the data, in bytes. All other Data Types have a fixed, non-editable size. Up to 4,000 bytes can be entered in the Element Size field; however, the protocols cannot read more than the maximum input length. If the input data exceeds the limit, the protocols will only read a portion of them.

    Note:
    • The maximum length for input 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 input data is 1920 bytes. When using SLMP or SLMP Scanner and FX Series is the selected Controller Type, the maximum length for input data is 128 bytes. The maximum length for all other communications is 256 bytes.

    • If the total message size exceeds 4,000 bytes, #ERR is returned.
    Data Type Size Range (in bytes)
    Bit* 1 bit
    8 bit integer

    1

    8 bit unsigned integer

    1

    16 bit integer

    2

    16 bit unsigned integer

    2

    32 bit integer

    4

    32 bit floating point

    4

    String
    • Modbus TCP, EIP or PROFINET = 1 to 4000 (or 1 to 2000 for word-based protocols).
    • SLMP or SLMP Scanner with iQ-R/Q/L Series or iQ-F Series = 1 to 1920 (or 1 to 960 words for word-based protocols).
    • SLMP or SLMP Scanner with FX Series = 1 to 128 (or 1 to 64 words for word-based protocols).
    • All other communications = 1 to 256 (or 1 to 128 words for word-based protocols).
    Byte-Swapped String 
    • Modbus TCP, EIP or PROFINET = 1 to 4000 (or 1 to 2000 for word-based protocols).
    • SLMP or SLMP Scanner with iQ-R/Q/L Series or iQ-F Series = 1 to 1920 (or 1 to 960 words for word-based protocols).
    • SLMP or SLMP Scanner with FX Series = 1 to 128 (or 1 to 64 words for word-based protocols).
    • All other communications = 1 to 256 (or 1 to 128 words for word-based protocols).

    *The Bit Data Type is only available for SLMP and CC-Link communications.

  • Add: Adds a Data Type to the list.
  • Remove: Removes the highlighted Data Type from the list.
  • Move Up: Moves the highlighted Data Type up in the list. If the Data Type is already the first item in the list, the Move Up button is disabled.
  • Move Down: Moves the highlighted Data Type down in the list. If the Data Type is already the last item in the list, the Move Down button is disabled.

Display the Format Output Buffer Dialog

  1. Select an empty spreadsheet cell.

  2. On the Insert menu, click Function.

  3. From the Insert Function dialog, expand the Input/Output category.

  4. From the right-hand pane, double-click FormatOutputBuffer.

Format Output Buffer Dialog Controls

  • Cell(s): Specifies a referenced cell (or range of cells) containing a value for the selected Data Type.

    Note: Each Data Type must reference a cell containing valid data or the dialog will return #ERR.
  • Data Type: Specifies the type of data to automatically configure.
  • Element Size (bytes): When String or Byte-Swapped String is the selected Data Type, specifies the size of the data, in bytes. All other Data Types have a fixed, non-editable size. Up to 4,000 bytes can be entered in the Element Size field; however, the protocols cannot write more than the maximum output length. If the output data exceeds the limit, the protocols will only write a portion of them.

    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.

    • If the total message size exceeds 4,000 bytes, #ERR is returned.
    • 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 the limit, use the CombineOutputBuffers function.
    Data Type Size Range (in bytes)
    Bit* 1 bit
    8 bit integer 1
    8 bit unsigned integer 1
    16 bit integer 2
    16 bit unsigned integer 2
    32 bit integer 4
    64 bit integer 8
    32 bit floating point 4
    String
    • Modbus TCP, EIP or PROFINET = 1 to 4000 (or 1 to 2000 for word-based protocols).
    • SLMP or SLMP Scanner with iQ-R/Q/L Series or iQ-F Series = 1 to 1920 (or 1 to 960 words for word-based protocols).
    • SLMP or SLMP Scanner with FX Series = 1 to 128 (or 1 to 64 words for word-based protocols).
    • All other communications = 1 to 256 (or 1 to 128 words for word-based protocols).
    Byte-Swapped String 
    • Modbus TCP, EIP or PROFINET = 1 to 4000 (or 1 to 2000 for word-based protocols).
    • SLMP or SLMP Scanner with iQ-R/Q/L Series or iQ-F Series = 1 to 1920 (or 1 to 960 words for word-based protocols).
    • SLMP or SLMP Scanner with FX Series = 1 to 128 (or 1 to 64 words for word-based protocols).
    • All other communications = 1 to 256 (or 1 to 128 words for word-based protocols).
    *The Bit Data Type is only available for SLMP and CC-Link communications.
  • Message size (bytes): Displays the total Message size in bytes.
  • Add: Invokes cell selection mode to reference one or more cells. Cells can be selected while the dialog is open.
  • Remove: Removes the highlighted Data Type from the list. If no items are highlighted, the Remove button is disabled.
  • Move Up: Moves the highlighted Data Type up in the list. If the Data Type is already the first item in the list, the Move Up button is disabled.
  • Move Down: Moves the highlighted Data Type down in the list. If the Data Type is already the last item in the list, the Move Down button is disabled.

Format Output Buffer Example

  1. Assume cells A2, A3 and A4 are populated as follows:

    A2 = EditInt(0,255)

    A3 = EditFloat(0,100)

    A4 = EditString(8)

    The spreadsheet looks like this:

  2. Insert the FormatOutputBuffer function in cell C2. The FormatOutputBuffer dialog automatically opens.

  3. Click the Add button to reference the cell containing the appropriate data. For example, highlight cell A2.

  4. Press the ENTER key to accept the referenced cell selection and return to the FormatOutputBuffer dialog. The referenced cell should now be listed in the dialog.

  5. Continue to click the Add button to add additional cell references. You can change the Data Type, delete or reorder existing items in the list.

  6. Click OK to close the dialog and return to the spreadsheet. A Buffer data structure is returned.