Transaction Groups and Named Queries

This is Ignition version 8.1.33.

I've got a transaction group that has run-always expression to retrieve data from a database table in order to be able to do a calculation in the trigger portion.

If I do the expression as a SQL Query the value executes properly. However, if I use a Named Query it doesn't evaluate. Even if I remove all the parameters etc... and just execute the exact same SQL Query in both instances.

For reference this is the query

SELECT ts.val
FROM tblscale ts
LEFT JOIN tblconfigscale c on ts.sclid = c.id
WHERE c.tagpath = '[Development]Motors/FVNR/C100/SCL100'
ORDER BY ts.t_stamp desc
LIMIT 1

This is how I have the transaction group configured

I've tried a Named Query in a Parent project as well as the project that the Transaction Group is in, neither worked.

The only error message I get in the gateway logger and the transaction group window is: "Item 'dbSclLastVal' is not configured correctly. A tag executor could not be created for the item." with no further information.

Are there other loggers I can enable to further investigate this? Is this a bug? This is going to be a transaction group that will be duplicated multiple times and just the main tag path changed, so we would like to keep with a named query.

Is the named query set to return a scalar value?

Yep

AFAIK Named Queries aren't supported in Transaction Groups... because I'm looking at a PR that adds that support.

1 Like

Interesting... the Expression Type for the tag group shows that they are.

Hmm.....

And the manual calls them out as well: Item Types - Ignition User Manual 8.1 - Ignition Documentation

They just don't seem to work.

Yeah, they don't work and it's a bug that it shows up.

Some background from the ticket and PR:

Named queries were added to the tag expression dropdown type selectors as a consequence of FB-9092, but they don't actually work in, say, SQLBridge

Up to now, there has been no support for NamedQueries in TransactionGroups. The function is selectable in the designer, but the branch to create an expression group for NamedQueries wasn't filled in, and no NamedQuery expression existed.

Wait for 8.1.37 where they'll be supported.

4 Likes

10-4.

As long as I know then I can communicate with our engineers that fact.

Thanks for digging into this @Kevin.Herron!