Type: |
Structure |
Available as of: |
V1.0.8.0 |
Inherits from: |
- |
The structure ST_CsvTable is used to pass the buffer provided by the application to the corresponding function block.
Name |
Data type |
Description |
---|---|---|
pbyTable |
POINTER TO BYTE |
Pointer to the buffer (two-dimensional ARRAY of type STRING) provided by the application. |
uiNumOfRows |
UINT |
Specifies the number of rows (records) in the table. |
uiNumOfColumns |
UINT |
Specifies the number of values per row (record) in the table. |
udiSizeOfTable |
UDINT |
Specifies the total size in bytes of the table. |
NOTE: To prevent access violation eventually caused by pointer access to the memory, use the arithmetic operator SIZEOF in conjunction with the targeted buffer to determine the value for udiSizeOfTable.
The example shows how to assign the values to this structure:
PROGRAM POU
VAR
g_asCsvTable:ARRAY[0..c_uiNumOfRows-1,0..c_uiNumOfColumns-1] OF
STRING(c_uiLengthOfValue);
stCsvTable: FFU.ST_CsvTable;
END_VAR
VAR CONSTANT
c_uiNumOfRows :UINT:= 100;
c_uiNumOfColumns :UINT:= 10;
c_uiLengthOfValue :UINT:= 40;
END_VAR
stCsvTable.pbyTable := ADR(g_asCsvTable);
stCsvTable.uiNumOfRows := c_uiNumOfRows;
stCsvTable.uiNumOfColumns := c_uiNumOfColumns;
stCsvTable.udiSizeOfTable := SIZEOF(g_asCsvTable);
oFB_CsvRead
oFB_CsvWrite