Correct method to check/log data- Tag Change or Transaction

Hi,
I’m wondering what is the best approach to achieve the following:

DB: SQL Server 2008R2
IA: SQL Bridge 5.6.6

I have a database to store Batch data.
The DB has a number of tables associated with the batch.
The main table has the primary batch data - Batch ID (PK)/Batch Number/StartDate/Quantity etc.
The other tables have information relating to various sequences in the batch.
These sequences occur in different plant equipment throughout the batch.
There can be multiple batches in the equipment train.

At the start of a batch I want to log the Batch data to the Main table.
As the batch progresses through the various equipment, each equipment will log the relevant batch data to its table.
When it logs the data, I need to check that the Batch exists in the Main table and return the Batch ID (primary key) to use in the equipment table.
However, it’s possible that the main table will not have the batch data (due to power cut etc.).
Therefore, if the batch does not exist in the main table, I need to create it, return the Batch ID, and log the equipment data.
The equipment will have its own record of the batch details (in the PLC).

In short:
Batch Start: Create Batch in Main Table.
Batch transfer to equipment A: Get Batch ID from Main table.
If it doesn’t exist, create the Batch in the Main table and return the Batch ID
Log equipment data to Equipment table with the Batch ID.

What is the best approach for this? Tag change script or transaction group.
Batch events (Start/Transfer etc.) are indicated by a changing value in a status tag.
Each equipment will have its own status tag.
i.e. Equip A:1=Start; 2=Heat; 3=Cool; 4 = transfer > Equip 2 etc.
Equip B: 1=Start; 2= Heat etc.

Each equipment in the PLC has a copy of the batch details (Number etc) that it is currently processing.

Also, I need to update the completion time of a stage in each record.
i.e. Equip A transfer to Equip B:
Equip A will log Start of transfer as a new record and update the StartTime field.
At the end of transfer, Equip A will update the EndTime field for the transfer.

I’m a bit confused about how to use transaction groups to achieve the above.

I’d appreciate any help/pointers or example of a similar process.

I’ve no problem using SQL procedures etc, but am new to ignition.
I’ve previously done similar systems with Wonderware and VB6; VB6 doing all the work.
However, I want to move away from this setup.

Thanks for any help,
Tim

Tim,

Have you had any luck with this? I am just starting to implement a similar system using ignition. I’ll update with what I end up doing.

Use Tag Change scripts for this. I would write the bulk of the logic in app.* Python modules and call them in Gateway Tag Change scripts.

It seems to me that the new SFC Module would be good to use to handle this kind of batch logic. Check it out here: inductiveautomation.com/whatsnew#sequential

Carl gave a pretty good demonstration of the new SFC module in the Ignition 7.7 webinar. The webinar is here: inductiveautomation.com/vid … 77-release