SharedVariableExportManager
The Shared Variable Export Manager is an application which created/controls Export Groups (a group of NI SVE variables to be exported to flat text file). Each group runs independently and can create comma separated variable data files, JSON sensor measurement data files, and JSON sensor state files.
The manager application has the ability to perform the following actions:
- Start a group
- Stop a group
- Reload a group
- Add a new group
- Remove a group
- Open the configuation file of a group
- Shut down all groups and close application
All configuration files placed in the auto load folder (typically .\ExportManager\ExportGroups\) will automatically load when the application is loaded.
Configuration of an Export Group
The configuration file for an export group is ASCII text NI_LVConfig format, where [square brackets] indicate sections and variables = value.
Each config file uses the section [General] for logging information and a set of [Variable_IDs] for export variable configuration. Below is an example of an export group with two variables.
name = "IsotopeLab"
logging interval = 1
interval in seconds = true
write csv datafile = true
export only on change = false
csv datafile length = "day"
csv datafile output folder = "x:\\data\\isotopelab\\csv\\"
write sensor datafile = false
sensor datafile output folder = "x:\\data\\isotopelab\\datafile\\"
write sensor statefile = true
sensor statefile output folder = "x:\\data\\statefiles\\"
[HeaterA]
path = "\\\\192.168.1.144\\Mod4\\HeaterA_TempC"
datatype = double
[HeaterB]
path = "\\\\192.168.1.144\\Mod4\\HeaterB_TempC"
datatype = double
The [General] section has the following variables:
VARIABLE | DATATYPE | NOTES |
name | string | Name of the group, used in naming output files. Default uses the config file name. |
logging interval | int | Period of which the group is executed, default is 15 |
interval in seconds | boolean | TRUE if the interval is in seconds, FALSE indicates the interval is in minutes, default is false (minute) |
export only on change | boolean | TRUE if the files will only be updated/generated when a variable changes value, default is false. |
write csv datafile | boolean | Enables/disables export to CSV, default is false |
csv datafile length | string | How often files are separated. Valid lengths are:second, minute, hour, day, month, year, perpetual. Default is perpetual. |
csv datafile output folder | string | Path to the folder which to write csv data, no data will be written if the path is non existent. Default is "c:\data" |
write sensor datafile | boolean | Enables/disables exporting to sensor measurement JSON files, default is false |
sensor datafile output folder | string | Path to the folder which to write sensor measurement data, no data will be written if the path is non existent. Default is "c:\data" |
write sensor statefile | boolean | Enables/disables exporting current state to file, default is false |
sensor statefile output folder | string | Path to the folder which to write sensor state data, no data will be written if the path is non existent. Default is "c:\data" |
Each variable to be exported needs to be defined using it's own section (don't call any variable [General] or it will be ignored, also give each section a unique name).
A [variable_id] section has the following variables:
VARIABLE | DATATYPE | NOTES |
path | string | The network path, in SVE path convention, to the variable |
datatype | string | Data type of the variable (important for correct parsing). Valid data types are:double, int32, uint32, boolean, string, timestamp. Default is unknown (no data will be collected). |
DBID | string | Database identifier for statefiles & sensor measurements |
SensorCode | string | Sensor name identifier for statefiles & sensor measurements |
VariableCode | string | Sensor's variable name identifier for statefiles & sensor measurements |
SensorID | string | Sensor's database ID for statefiles & sensor measurements |
VariableID | string | Variable database ID for statefiles & sensor measurements |
BoxX | string | X (up slope) position for statefiles & sensor measurements |
BoxY | string | Y (cross slope) position for statefiles & sensor measurements |
DLevel | string | Depth position for statefiles & sensor measurements |
Units | string | Units of the exported data |
DataTable | string | Database table for statefiles & sensor measurements |