OPC tag with Queries

I have two OPC tags and a table in a database. I want to use one of the tags to look up on the table the write back on to the other tag.

So, Tag one is Model_Number, tag two is platfrom

Table date something like this
id Model_Number Platform
1 XXXX0001 YYYY0000
2 XXXX0002 YYYY0000
3 XXXX0003 YYYY0001
4 XXXX0004 YYYY0001
5 XXXX0005 YYYY0000

The Query will look something like this:

SELECT Platform
FROM table
WHERE ModelNum = {Model_Number}

I want to write back to the PLC with the Platform info that I looked out.
Read the Model_Number tag, then write to the Platform tag.
Read Model_number = XXXX0001,
Write Platform = YYYY0000

Is there a way to do this?
Thanks for your help.

Yep… a transaction group SQL Bridge (Transaction Groups) - Ignition User Manual 8.1 - Ignition Documentation might be the easiest way to get this going. But there are a number of other ways you can do this.

Thanks for the info and based on the manual this would work nicely.
However, I can’t seem to get it to work. Manual not really helping nor the videos. I keep getting an error with the expression item. Here the query:
SELECT Platform
FROM table
WHERE
ModelNum = {[~]ModelNum}

It comes back with “Invalid column name ‘XXXX0001’.” So for whatever reason it looking for the tag data as a column name.
I going to keep trying to figure it out.

If you can post a picture of your transaction group so we can take a look at how you are setting it up.

I just got it. Thanks for the info.

2 Likes