Hi,
I am trying to make connectivity with remote industrial connection thing and PostgreSQL database, any guide or steps to follow to insert the remote thing industrial connection data into the Postgres SQL database.
could you please help me with this connectivity and data insertion of streaming data, I am using the Thingworx 9 version and Postgres sql database?
Solved! Go to Solution.
Hi @SA_10100358.
The easiest thing to do is to read the properties coming in and log them to a value stream. Once in the value stream, will you have the data available to manipulate as needed via services/mashup. Alerts can be generated based on the conditions you define.
This is a simplistic view so you will need to consider volume in your design to avoid the possibility of performance issues.
Regards.
--Sharon
Hi,
From "Help Center" - "PostgreSQL": https://support.ptc.com/help/thingworx/platform/r9/en/index.html#search/PostgreSQL
Hi slangley, Thanks for your help. i have gone through this guide. This helps with connectivity and visualization.
In my use case, I want to read the streaming data and while reading the live data I want to apply some logic and filters and then I want to push the data into the Postgres database.
Could you please help me with how we can apply custom logic to streaming data eg. by using value stream, service, thing, property?
Hi @SA_10100358.
Please provide more details of your use case. Are you trying to write to an external source outside of the persistence provider for ThingWorx?
Regards.
--Sharon
Hi slangley, I'm not trying to write to an external source outside of thingworx.
Here are the use case details - I am using the thingworx version 9.2.3 with the Postgres database.
I created the postgres database schema in a way where I can have only the aggregate data of devices (filtered by code) for the visualization.
I am receiving live streaming data from PLC devices in the form of taglist from the kepware server. I connected the industrial connection thing through kepware server successfully. i can able read the data after clicking the refresh button of the industrial thing property.
I want to write a code middleware code in industrial connection thing that can read the stream data first and filter by the based on the user-defined condition eg. if devices are sending an alarm I want to capture the downtimes of the devices (eg. monitor the time duration of a specific alarm when on/of calculating the interval of downtime in minutes). I categorized alarms based on the different types of downtimes.
So I want to aggregate the data when receives from the PLC devices after applying the filters I want to insert data into the Postgres database.
Where i can apply the filters add aggregate code while reading the live stream data and then insert it into the Postgres database later for the visualization.
I hope you understand the above Use case. Could you please provide the solution for the above use case?
Hi @SA_10100358.
The easiest thing to do is to read the properties coming in and log them to a value stream. Once in the value stream, will you have the data available to manipulate as needed via services/mashup. Alerts can be generated based on the conditions you define.
This is a simplistic view so you will need to consider volume in your design to avoid the possibility of performance issues.
Regards.
--Sharon