# FormatInputBuffer

The FormatInputBuffer function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. is for configuring the format of the input data. When FormatInputBuffer is inserted in the spreadsheet, the FormatInputBuffer dialog is automatically opened and used to program the function.

Note: The FormatInputBuffer function has a maximum string argument length of 256 bytes.
Inputs

The FormatInputBuffer function has the following syntax:

FormatInputBuffer(Format)

See the table for a description of the available parameter.

Parameter | Description
Format | Specifies the Data Type and Size in bytes to automatically configure. The following table shows the available Data Types:
Data Type | Size in Bytes | Representation as Function Argument
--- | --- | ---
Bit | 1 byte | b
8-bit integer | 1 byte | i
8-bit unsigned integer | 1 byte | u
16-bit integer | 2 bytes | il
16-bit unsigned integer | 2 bytes | ul
64-bit unsigned integer | 8 bytes | uq
32-bit integer | 4 bytes | d
32-bit floating point | 4 bytes | f
String | User-defined size | sN where N is the number of bytes
Byte-swapped string | User-defined size | ~sN where N is the number of bytes
When multiple Data Types are defined in the Format parameter, the Data Types are separated by a colon in the cell expression. For example, if you configure the FormatInputBuffer function for input data that consists of four 16-bit integers, the cell expression in the FormatInputBuffer function cell is the following: FormatInputBuffer("il:il:il:il") If you edit the cell expression manually, the FormatInputBuffer function also accepts an alternate argument format that allows you to specify an offset for each Data Type by prefixing the Data Type with a number for the offset, where 0 is the first received value. For example, if you configure the FormatInputBuffer function to only receive the first, third, fifth, and seventh 16-bit integers in the input data, the cell expression in the FormatInputBuffer function cell is the following: FormatInputBuffer("0il:2il:4il:6il") Note: The alternate argument format is only necessary when the regular argument for the input data you want to configure exceeds the 256 character limit for the function. For example, the User Data in the EtherNet/IP Output Assembly has up to 488 bytes, which can limit the amount of data and number of elements that a single FormatInputBuffer function can receive, depending on the Data Type. The alternate argument format allows you to split the input data between two or more FormatInputBuffer functions and process the whole input.

Outputs

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