You can use PostgreSQL database using the Tag Historian feature. The steps to achieve this involve:
On this page:
Follow the steps below to configure PostgreSQL using Tag Historian.
[WE NEED MORE INFORMATION ABOUT THIS EXAMPLE. IT LACKS INFORMATION TO CONNECT EVERYTHING]
This example presents necessary steps to connect and start using a PostgreSQL DB. To run the example, it is necessary to created objects in other modules of the platform. Below you find a list of modules used and the necessary configurations.
In Datasets > Queries you need to create the queries below. Access Datasets Queries to learn how to configure queries.
In Unified Namespace > Tags we created some Tags to save values in the DB. To learn how to create and configure Tags access Unified Namespace. The created tags are described below:
In Historian > Historian Tags configure the Integer01, Integer02, and Integer03 Tags to Table1. Remember that to configure the PostgreSQL is connected to Tag Historian, which is standard.
In addition to the above configuration, you need to access Scripts > Tasks and create we created some tasks to Select, Delete, Update, Insert, and configured the Trigger column with marks created before. Below you find all required scripts:
Select Query
@Tag.QuerySelect = @Dataset.Quey.QuerySelect.SelectCommand(); @Info.Trace("Select OK:" + @Tag.QuerySelect); |
Insert Query
int i = @Dataset.Query.QueryInsert.ExecuteCommand(); @Info.Trace("Insert OK:" + i); |
Update Query
int i = @Dataset.Query.QueryUpdate.ExecuteCommand(); @Info.Trace("Update OK:" + i); |
Delete query:
int i = @Dataset.Query.QueryDelete.ExecuteCommand(); @Info.Trace("Delete OK:" + i); |
After finishing the configuration and creating the scripts, you can run the project and provide different values to the Tags created. Thus, if you access the PostgreSQL Server, you can access Table1 which was created. You can also check that all values you provided are within Table1 due to the execution of previously created queries.