Use Data loggers

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 date and time of the variable reading also in local format in a dedicated column, set Local time log to True.

  5. In the Store property, select the database in which to store the data: a table with the necessary columns is 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 the Sampling mode property to…

    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

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

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

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

See also

Related concepts

DataStore (database)

Data logger

Related procedures

Working with databases

References

Data logger