Advanced Functions

These functions are useful for applications that need to support structured text or need lower level control. These are functions that the average user would not use.

csvGetLineLen()

Gets length of line starting from pString to end of line. Supports line endings of “\n”, or “\r\n”.

Direction Name Type Description
In pString char* Pointer to string containing start of line
Out pLen UDINT* Pointer to variable where length of line will be populated
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

Potential errors: INVALID_INPUT, NO_NEWLINE.

Note: Function requires CsvCoreAPI.h to be included. See Usage. For IEC type compliant form see csvGetCellLenFn.

csvGetNextLine()

Get next line in string.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next line. Pointer will be moved to start of next line or to null char if no more lines
Out pLen UDINT* Pointer to variable where length of line will be populated. Optional
In skipEmptyLines BOOL Skips lines containing no data
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

Potential errors: INVALID_INPUT, END_OF_DATA, NO_NEWLINE.

Note: Function requires CsvCoreAPI.h to be included. See Usage. For IEC type compliant form see csvGetNextLineFn.

csvGetNLine()

Gets nth line in string. line number is expected to be zero indexed.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next line. Pointer will be moved to start of next line or to null char if no more lines
Out pLen UDINT* Pointer to variable where length of line will be populated. Optional
In lineNum DINT Zero indexed line number to be found
In skipEmptyLines BOOL Skips lines containing no data
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

Potential errors: INVALID_INPUT, END_OF_DATA, NO_NEWLINE.

Note: Function requires CsvCoreAPI.h to be included. See Usage. For IEC type compliant form see csvGetNLineFn.

csvGetCellLen()

Gets length of csv cell starting at pString.

Direction Name Type Description
In pString char* Pointer to string containing start of cell
Out pLen UDINT* Pointer to variable where length of cell will be populated
In delim char Deliminator between cells
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

Potential errors: INVALID_INPUT, NO_NEWLINE, NEWLINE.

Note: Function requires CsvCoreAPI.h to be included. See Usage. For IEC type compliant form see csvGetCellLenFn.

csvGetNextCell()

Gets next cell in line. This function will not go to next line and will return CSV_CORE_ERR_END_OF_LINE when newline is found or CSV_CORE_ERR_END_OF_DATA if null char is found.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next cell. Pointer will be moved to start of next cell or to null or newline char if no more cells
Out ?pLen UDINT* Pointer to variable where length of cell will be populated. Optional
In delim char Deliminator between cells
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

Potential errors: INVALID_INPUT, END_OF_DATA, END_OF_LINE, NO_NEWLINE, NEWLINE.

Note: Function requires CsvCoreAPI.h to be included. See Usage. For IEC type compliant form see csvGetNextCellFn.

csvGetNCell()

Get nth cell in line starting from ppString. Cell number is expected to be zero indexed.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next cell. Pointer will be moved to start of next cell or to null or newline char if no more cells
Out ?pLen UDINT* Pointer to variable where length of line will be populated. Optional
In lineNum DINT Zero indexed cell number to be found
In delim char Deliminator between cells
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

Potential errors: INVALID_INPUT, END_OF_DATA, END_OF_LINE, NO_NEWLINE, NEWLINE.

Note: Function requires CsvCoreAPI.h to be included. See Usage. For IEC type compliant form see csvGetNCellFn.

csvGetLineLenFn()

IEC type compliant form of csvGetLineLen.

Direction Name Type Description
In pString char* Pointer to string containing start of line
Out pLen UDINT Pointer to variable where length of line will be populated
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

csvGetNextLineFn()

IEC type compliant form of csvGetNextLine.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next line. Pointer will be moved to start of next line or to null char if no more lines
Out ?pLen UDINT Pointer to variable where length of line will be populated. Optional
In skipEmptyLines BOOL Skips lines containing no data
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

csvGetNLineFn()

IEC type compliant form of csvGetNLine.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next line. Pointer will be moved to start of next line or to null char if no more lines
Out ?pLen UDINT Pointer to variable where length of line will be populated. Optional
In lineNum DINT Zero indexed line number to be found
In skipEmptyLines BOOL Skips lines containing no data
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

csvGetCellLenFn()

IEC type compliant form of csvGetCellLen.

Direction Name Type Description
In pString char* Pointer to string containing start of cell
Out pLen UDINT Pointer to variable where length of cell will be populated
In delim char Deliminator between cells
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

csvGetNextCellFn()

IEC type compliant form of csvGetNextCell.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next cell. Pointer will be moved to start of next cell or to null or newline char if no more cells
Out pLen UDINT* Pointer to variable where length of cell will be populated. Optional
In delim char Deliminator between cells
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum

csvGetNCellFn()

IEC type compliant form of csvGetNCell.

Direction Name Type Description
In \ Out ppString char** Pointer to a pointer to a string to find in the next cell. Pointer will be moved to start of next cell or to null or newline char if no more cells
Out pLen UDINT Pointer to variable where length of line will be populated. Optional
In lineNum DINT Zero indexed cell number to be found
In delim USINT Deliminator between cells
Return status DINT Function call status. Refers to CSV_CORE_ERR_enum