SharedVariableExportManager

Last modified by Michael Sibayan on 2017/04/06 09:53

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.

SensorVariableExportManager_SS.png

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.
Due to the nature of the Shared Variable Engine (SVE), each variable is "opened" when the group is loaded. This can cause long start-up delays when connecting to a large number of variables.

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.

[General]
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:
There are no required fields, but no exporting will occur by default

VARIABLEDATATYPENOTES
namestringName of the group, used in naming output files. Default uses the config file name.
logging intervalintPeriod of which the group is executed, default is 15
interval in secondsbooleanTRUE if the interval is in seconds, FALSE indicates the interval is in minutes, default is false (minute)
export only on changebooleanTRUE if the files will only be updated/generated when a variable changes value, default is false.
write csv datafilebooleanEnables/disables export to CSV, default is false
csv datafile lengthstringHow often files are separated. Valid lengths are:second, minute, hour, day, month, year, perpetual. Default is perpetual.
csv datafile output folderstringPath 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 datafilebooleanEnables/disables exporting to sensor measurement JSON files, default is false
sensor datafile output folderstringPath 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 statefilebooleanEnables/disables exporting current state to file, default is false
sensor statefile output folderstringPath to the folder which to write sensor state data, no data will be written if the path is non existent. Default is "c:\data"
A note about "export only on change": This is still dependent on the interval, so if we log at 1 minute intervals, it will check for system changes every 1 minute and only write to file if there is a change.

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:
There are two required fields:"path" and "datatype"

VARIABLEDATATYPENOTES
pathstringThe network path, in SVE path convention, to the variable
datatypestringData 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).
DBIDstringDatabase identifier for statefiles & sensor measurements
SensorCodestringSensor name identifier for statefiles & sensor measurements
VariableCodestringSensor's variable name identifier for statefiles & sensor measurements
SensorIDstringSensor's database ID for statefiles & sensor measurements
VariableIDstringVariable database ID for statefiles & sensor measurements
BoxXstringX (up slope) position for statefiles & sensor measurements
BoxYstringY (cross slope) position for statefiles & sensor measurements
DLevelstringDepth position for statefiles & sensor measurements
UnitsstringUnits of the exported data
DataTablestringDatabase table for statefiles & sensor measurements
Tags:
Created by Michael Sibayan on 2017/03/28 09:39

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.0.1 - Documentation