Log tag values to database table

Hi Forum,

Given two tags tag1, tag2, and a workorder.

On the production floor, when a process is running (indicated by a running tag).
Every time tag1 value change, ignition needs to write both tag1 and tag2 values onto a database table including workorder.
Such that, user could query these data per workorder and display on xy chart.

I wonder which is best:

  1. Record the start and end time of the process, and use it to query tag history?
  2. Use a gateway tag change script, run a write query?
  3. Can SQL Bridge even do this requirement?

I would use a transaction group to do this, with the trigger condition being the tag1 changing value

As Jasmine mentioned, this is where a transaction group (SQL Bridge) would work well, especially if you haven't done this type of thing before.

Is it a good practice to only log Tag Values with Good Quality?

Should I log the value with quality along with it?

I would suggest that a tag with bad quality is junk data and should be left out of the database.

If you're not already using transaction groups, I'm not sure this use case justifies adding an extra module. If you need to use this pattern for a lot of tags, then maybe, and even then with a properly constructed tag hierarchy, transaction groups are not that helpful..

You can just use a gateway tag change event, monitoring tag 1, and insert both tags values when the event is triggered.
Add some validation and filtering logic if needed, and you got yourself a simple script that does exactly what you need.

The only thing that's unclear to me is where you find the workorder.

I agree with you, since I know python and writing query, I find that transaction group also do the same thing under the hood. And it give me more flexibility using python.
I will also take this opportunity to look at transaction group, I forgot about what is this all about.

Is also a tag with string data type.

(post deleted by author)