Working with databasesΒΆ

Create a database

In Project, right-click the DataStores folder, select New, then select the type of database to create: the database object appears in the folder.

Configure a database to store data from a logger

In the Data logger or Event logger object, in the Store or Database property, select the database in which to store the data: the necessary table and columns are automatically configured in the database object.

Configure the tables of a database to populate using methods

If we want to populate a database using methods in a NetLogic, or using methods invoked by an OPC UA client, its structure must be configured. To do this in manual mode, do as follows:

  1. To create a table, next to the Tables property click image1.

  2. To add columns to the table, next to the Columns property, click image2 for each column desired.

  3. (Optional) Rename the columns and set the table record limit.

    Note

    the record limit only has effect for Embedded Database objects.

Display the stored data in table format

It is possible to automatically configure a Data grid object to display the data stored in a database table. Do as follows:

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

  2. From the database properties, drag the desired table into the Data grid object in the editor: the Data grid object is automatically configured to display the data stored in the database table.

Note

to display the data updated in real time at runtime, configure the call of the Data grid object Update method. Typically, this method is associated with a Button object event.

See also

Related concepts

DataStore (database)

References

SQL query

Embedded database

ODBC database