This configuration file contains a library of scripting functions used to read/write data between a CSV file and a list. These utilities assume the file is located in internal memory. When located in internal memory it will reside in the Scripting folder, it cannot access files loaded under Customer Extensions. To pass files between internal memory and USB see USB tutorials.
This configuration was written in 4.717 but can be copy/pasted to any other version, Download the Example Here.
At the top of the script is variable named “FileName” which is the name of the CSV file to operate on, for example: “MyFile.CSV”
void WriteFileFromList(int type, int offsets) –
This function is used to write to a CSV file specified by the FileName variable listed at the top of the script library. To use, the input parameter is an array of ints, with each int representing a type of variable in the corresponding column, and an array of ints for offsets. For the array of types: use 1 for int/bools, use 2 for strings, or 0 to skip the column. For the array of offsets simply refer to the list offset column in the list programing item. This will output to the programing folder location. All ints are treated as 32 bit ints.
void WriteListFromFile(int type) –
This function is used to write a list from a CVS file specified by the FileName variable listed at the top of the script library. To use this function, enter an array of the type of primitive each column is starting after the first column: 1 for int/bool, 2 for strings. All columns of the list must be named CSVList_Column_ColumnNumber such as "CSVList_Column_1". There are 2 switch statements in the function that must have cases equal to the number columns you want written too, simply add or remove cases to reach the desired number. If you need support moving a file from USB to the internal file, see examples on support.enovationcontrols.com
string GetCellStringFile(int column, int row) –
This function returns a specific cell as a String from the file name listed at the top of the script.
int GetCellIntFile(int row, int column)-
This function returns a specific cell as an int from the file name listed at the top of the script. All ints returned are as int 32, and this can be used to retrieve Booleans