Data logger

BrowseName: Datalogger
SuperType: Object (BaseObjectType)
TypeView path: Tipi > Loggers > Data logger

Samples values of one or more variables at regular time intervals or on command, and stores them in a database.

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

  1. Select the variables to sample and store.

  2. Configure the sampling.

  3. (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.

  4. (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.

  5. 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

  1. Double-click the Data logger object: the object editor opens, showing the project nodes.

  2. 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

  1. 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

  1. (only for Periodic and Value change modes) Set the sampling interval through the Sampling period or Polling time property, depending on the sampling mode.

  2. (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

  • Default dead-band mode = Absolute

  • Free choice Default dead-band value

percentage equal to/greater than a desired value, compared to the previous sampling

  • Default dead-band mode = Percentage

  • Free choice Default dead-band value

  1. 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

  1. Create a Data grid object and open it in the editor.

  2. 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

SamplingModeEnum

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

Duration

Interval in hours, with millisecond precision, between one sampling and the next, in Periodic mode

Polling time

PollingPeriod

Duration

Interval in hours, with millisecond precision, between one sampling and the next, in Value change mode

Log operation code of each variable

LogVariableOperationCode

Boolean

(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

Boolean

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

Boolean

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

DeadBandModeEnum

(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

Double

(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

NodeId

Database in which to store the sampled data.

Table name

TableName

String

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

Methods

Log

BrowseName: Log

See also

Concetti correlati

Data logger

Procedure correlate

Use Data loggers