On one of our lines we have about 60+ setpoints that make up the process. I want to create a logging table that contains a record of when a value changes. I already have a group that contains these tags and set the group to log when a change has occurred.
This is the resulting table structure.
ID, OrderNo, T_Stamp, Set1, Set2, …
The problem I have is creating a report like this …
Order Number, Time, Setpoint Name, Setpoint Value
I only wnat the report to include values that acutally changed. The group is outputing all values when only one of them are changing. What is the easiest way to accomplish a group like…
ID, OrderNo, T_Stamp, SetName, SetValue
Yes, unfortunately this is a bit of a black hole in FactorySQL. All of the groups currently run all-or-nothing in the async change mode (actually in all modes, for that matter).
Several customers have accomplished this by using the Alerting features. That is, they configure all of their points to “alert on change”, which will cause them to write to the alert log with their folder name, item name, previous and current values any time there’s a change. If this is the only history you need, you can set the group to simply update the first/last/ or specific row of a table (for example, with “machineid=1” or something).
If you’re also using alerting for real alerts, you can do a few things:
- put the groups logging this history into a specific folder (or use a naming convention on the groups). That way, when you query for changes, you can specify to only look for items with that folder or group name.
- If using email alerts, you have 2 options: Set all of those alerts to LOW, start all of your real alerts one severity higher, and then modify your alert email settings to “only email alerts with severity medium-low or higher”. The other option is to use distribution groups and to start each group’s condition with an expression checking to make sure the alert isn’t coming from the folder/groups defined in #1.
Let me know if this helps you out, or if you have any questions. On our side, the best we could probably do would be to give the block group an option to only insert rows that have changed. However, it gets a little tricky as to how you would define the value’s name in a meaningful way… but using the alert method, you can easily use either the item name, or the state name.
Hope this helps,
I took a while for me to get time to try it but I used option 2 and it works.