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:
To create a table, next to the Tables property click .
To add columns to the table, next to the Columns property, click for each column desired.
(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:
Create a Data grid object and open it in the editor.
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.