Multiple task triggered by a TG

Hi,

I need your advice to solve a problem.
This is the thing, I have to run a comparison in a TG between a value coming from a PLC and a value coming from a DB. If those values are not equals There are few tasks I have to run in certain order. Mainly all the tasks are updates/adds in the DB. The number of tasks could change depending of the result of the previous task.
I tried to solve this problem using expression but It’s complicate run multiple queries in the same item, I tried nesting ifs but it’s hard to catch errors doing that.
I would like to know if you faced a similar situation and how did you tackle the problem.

Regards
Manuel

You should write a Python script to implement this.

Learn more here: inductiveautomation.com/support … ipting.htm

Best,

Thanks nmudge!

That was an option but I wanted to see if there is a way to solve the problem using expression.
Another option I have been thinking of is to create a store procedure in the DB and call it from the TG.

If anyone has another idea I will appreciate it.

Regards,
Manuel

Yea, you could use a stored procedure. You also might want to see if Transaction Groups can help you here.

I ended up solving my problem with a DB trigger.

Thanks for your help guys!