ReadBinaryFile (FPScript)
Reads a data series from a binary file.
Syntax
ReadBinaryFile(File, Start, NumberOfBlocks, BlockSize, Skip, DataType)
The syntax of the ReadBinaryFile function consists of the following parts:
Part |
Description |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
File |
String with the path of the binary file to be read. Permitted data structures are scalar value. Supported data types are string (file name). If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||||||||||||||
Start |
The number of bytes to be skipped at the start of the file. Permitted data structures are scalar value. All integral data types are permitted. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||||||||||||||
NumberOfBlocks |
The number of blocks to be converted. If zero is passed, all of the blocks are converted up to the end of the file. Permitted data structures are scalar value. All integral data types are permitted. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||||||||
BlockSize |
The number of values per block. Permitted data structures are scalar value. All integral data types are permitted. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||||||||
Skip |
The number of bytes to be skipped between the blocks. Permitted data structures are scalar value. All integral data types are permitted. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||||||||
DataType |
The data type in which the values are available. The argument DataType can have the following values:
Permitted data structures are scalar value. Supported data types are 16-bit integer und 32-bit integer. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
Remarks
The result always has the data structure data series.
From a certain position, the function reads a sequence of associated blocks between which there may be a gap of a constant size.
The result is a data series for which the data type corresponds to that of the values to be read. The following formats, which must be output at a higher resolution, form exceptions:
Data type |
Is imported as: |
---|---|
TYPE_INTEGER8 |
16-bit integers. |
TYPE_INTEGER8 + BIN_UNSIGNED |
16-bit integers. |
TYPE_INTEGER16 + BIN_UNSIGNED |
32-bit integers. |
TYPE_INTEGER32 + BIN_UNSIGNED |
64-bit integers. |
TYPE_REAL48 |
64-bit floating point values. |
Available in
FlexPro View, Basic, Professional, Developer Suite
Examples
ReadBinaryFile("c:\\examples\\file.bin", 10, 0, 16, 4, TYPE_FLOATINGPOINT32) |
The binary file c:\examples\file.bin will be read. The first 10 bytes will be skipped. Data will be read until the end of file. There are 16 values read per block with a 4-byte space between the blocks. The values are present in 32-bit floating point data type. |