The KineticaRT Logging components provide logging of data from KineticaRT channels and replay of the data via KineticaRT logging channels.
The KineticaRT Logging components consists of:
This component writes and reads data in CSV (Comma Separated File) format.
CSV format is useful for importing into spreadsheet applications such as Microsoft Excel.
The CsvFile Component has the following properties:
During recording the Logger.NumericChannel component connects to a standard NumericChannel component named in the Source property and records the value of that channel. The recorded value is passed to the logger component named in the Logger property (eg CsvFile component) for writing to file.
During replay the Logger.NumericChannel component takes the replayed value. The standard NumericChannel component it is linked to will be unaffected by the replayed value.
If display components are linked to the Logger.NumericChannel component then during replay they will display the replayed value and they will display the live value at all other times. If the display components are linked to the standard NumericChannel component they will display the live value at all times.
Most of the properties of the Logger.NumericChannel component will reflect the properties of the channel it is linked to.
The following properties are specific to the Logger.NumericChannel component:
This is similar to the NumericChannel component but includes the extra properties available on a NumericThreshold channel.
This is similar to the NumericChannel component but has the properties available on a Boolean channel.
This is similar to the NumericChannel component but has the properties available on a Text channel.
For each CSV file to be recorded, a CsvFile component will be required. For each channel to be recorded in the file, a Logger Channel component will be required. The logger channel needs to be connected to the channel to be logged using its Source property and to the CsvFile component using the Logger property.
Standard Boolean Channels will also be required to control Pause, Play, Record, Step and Stop. The CsvFile component links to these. They can be set by buttons on the screen, event or threshold channels in the channel list, from sequences or from a combination of places.
The index property of a channel indicates the position of the channel within the file.
An index value of zero indicates that the channel will be ignored.
An negative index value indicates that the channel will appear in the file header. There will be a single value recorded which will be the value of the channel when the recording is started. Channels with indexes closest to zero will appear first in the file.
Positive index values indicate that a value for the channel will appear on each line of the file following the header. Channels with indexes closest to zero will appear first.
These properties should all be set to the names of channels containing Boolean values.
Only one of these channels should be set at any time. Setting any of these channels will clear (set to false) all the others.
The Stop channel will be set and the Play channel cleared when the end of the log file is reached during playback.
The Stop channel will be set and the Record channel cleared if the MaxFileSize value is reached during recording.
This sets a limit to the size of the files written to disk in order to avoid running out of disk space. The recording will stop before this number of MBytes has been written.
This property can be set to 0 to indicate no limit.
The current state of the CsvFile component is held in its Value property and can be displayed by attaching the component to a KineticaRT.Controls.Display component. If any file format or access errors occur during recording or playback then it will return to the "Stopped" state.
To help in diagnosing errors, Trace messages can be output to the diagnostics window / logfile / debugger. Trace level 2 (Warning) gives all file access error and warning messages. Level 3 (Info) also reports MaxFileSize reached etc. Detailed operational information is given at trace level 4 (Verbose).
To enable display of these trace messages the following line will need to be included in the switches section of the application.config file. Note that the level 4 (Verbose) will affect performance during logging / playback.
<add name="KineticaRT.Servers.Logger" value="2">
Since neither Windows nor .Net provide "Real Time" deterministic performance, the accurate timing of samples during recording is impossible to guarantee and will depend on processor/disk usage by other components and applications as well as hardware performance.
The maximum logging rate is 100Hz but it should be expected that some samples will be delayed slightly or even missed at this rate. In a typical system 20Hz can be achieved fairly reliably although there is still the possiblity of interruptions due to other applications or by user interaction.