Data logger¶
Applications
Typically used to record and display the trend of the values of variables of interest over time.
Configuring the object
Configure a Data logger
(Optional) To also store in the database the PLC read operation codes and/or timestamps of each sample, set Log operation code of each variable and/or Log timestamp of each variable to True.
(optional) To store in the database the local date and time of events in addition to the date and time in UTC+0, enable Local time log.
In the Store property, select the database in which to store the data: the necessary table and columns are automatically created and configured in the database.
Select the variables to sample and store
Double-click the Data logger object: the object editor opens, showing the project nodes.
Select the variables to sample, then click Apply: the variables in the Variables to sample collection are automatically set by dynamic link.
Configure the sampling
Set the Sampling mode property:
If we want to sample… |
Then set Sampling mode property on… |
---|---|
automatically for all the variables monitored, independently of their value |
Periodic |
automatically, only for variables whose value has changed significantly with respect to the previous sampling |
Value change |
by invoking the Sample method |
None |
(only for Periodic and Value change modes) Set the sampling interval through the Sampling period or Polling time property, depending on the sampling mode.
(only for Value change mode) Set the dead-band interval to determine which values to sample:
To sample the variables whose values have changed… |
Then set… |
---|---|
any with respect to the previous sampling |
Default dead-band mode = None |
absolute equal to/greater than a desired value, with respect to the previous sampling |
|
percentage equal to/greater than a desired value, compared to the previous sampling |
|
If we want to specify a different dead-band mode or value for individual variables, set their related Dead-band mode and Dead-band value properties.
Display the stored values in a table
Create a Data grid object and open it in the editor.
Drag the desired Data logger object from the Project panel inside the Data grid object in the editor: the Data grid object is automatically configured to display the data recorded by the logger and stored in the set database.
Note
to display the data updated in real time at runtime, configure the call of the Update method of the Data grid object. Typically, this method is associated with Button object event.
Properties¶
Name |
BrowseName |
DataType |
Description |
---|---|---|---|
Sampling mode | SamplingMode |
None: automatic recording disabled, can record by invoking the Sample method; Periodic: records the values of all the selected variables at regular intervals; Value change: at regular intervals records only the values of the selected variables that have changed with respect to the previous sampling. |
|
Sampling period | SamplingPeriod |
Interval in hours, with millisecond precision, between one sampling and the next, in Periodic mode |
|
Polling time | PollingPeriod |
Interval in hours, with millisecond precision, between one sampling and the next, in Value change mode |
|
Log operation code of each variable | LogVariableOperationCode |
(Only for reading of variables from PLC) Enable/disable the storage of the operation code for the reading of the PLC. If enabled, adds the relative column in the database for each variable. |
|
Log timestamp of each variable | LogVariableTimestamp |
Enable/disable the storage of the timestamp of each sample. If enabled, adds the relative column in the database for each variable. |
|
Log local time | LogLocalTime |
Enable/disable the recording of the local date and time (Local time property of the events or session), in addition to the date and time in UTC+0. |
|
Default dead-band mode | DefaultDeadBandMode |
(only for Value change sampling mode) Method of calculating the change of values, with respect to the previous sampling, within which not to sample. Applies to all variables without specific dead-band mode. None: any change; Absolute: absolute change of the values of the variables; Percentage: percentage change of the values of the variables. |
|
Default dead-band value | DefaultDeadBandValue |
(only for Value change sampling mode) Value of the dead-band interval. For example, if the value is 5, the logger samples the variables whose values have had an absolute or percentage change of at least ± 5 with respect to the previous sampling. |
|
Store | Store |
Database in which to store the sampled data. |
|
Table name | TableName |
Name of the database table in which to store the sampled data. |
|
Variables to log | VariablesToLog |
Collection of VariableToLog |
Collection of Variable objects to sample |