Scan Classes and Query Tags

Hello,

Is there a way to duplicate the Polling Mode options you have for things like a table’s data property (Off, Relative, Absolute) in a query tag? These query tags are pulling a description from the database using another memory tag. The result from the query doesn’t change so there isn’t a need to execute it over and over again. I tried using a very slow scan class but it doesn’t execute immediately so I’d have to wait until that time period elapses. I tried using a driven scan class but as soon as you modify the query tag or the scan class it resets and needs that driving tag to go low and high again.

If those Polling Mode options were available, setting it to Off would be perfect. It would execute once and never again unless the values used in the query changed.

Thanks in advance,
Steve

In that case it is worth creating those tags as client tags. Client tags have polling options just like tables and is available as a tag to all windows. Just right click on the Client folder in SQLTags and create a new one. You can select SQL query from the Expression/SQL tab on the left.

Thanks for the quick reply Travis. I don’t think that will work the way I want it so let me attempt to give a little more information.

I have directories organized in my SQLTags browser by production line. I want to plug the ID of that particular production line into a memory tag. I then want the query tag to select the production line name from the database using the ID in the WHERE clause. Since I have multiple production lines, I would need multiple of your proposed client tags that aren’t in my directory hierarchy and each one would need to reference a specific ID tag.

I’m not sure I’m explaining myself clearly so I attached a screenshot to hopefully help. I can’t reuse the client tag you suggested in each production line.


The only option you have is to use a one-shot driven scan class. It can be driven off of an expression tag that looks at the current time and goes true every hour or so. The one-shot driven scan class only run the query when the condition is true (on the rising edge) and only runs once.

[quote=“scicco”]Hello,

Is there a way to duplicate the Polling Mode options you have for things like a table’s data property (Off, Relative, Absolute) in a query tag? These query tags are pulling a description from the database using another memory tag. The result from the query doesn’t change so there isn’t a need to execute it over and over again. I tried using a very slow scan class but it doesn’t execute immediately so I’d have to wait until that time period elapses. I tried using a driven scan class but as soon as you modify the query tag or the scan class it resets and needs that driving tag to go low and high again.

If those Polling Mode options were available, setting it to Off would be perfect. It would execute once and never again unless the values used in the query changed.

Thanks in advance,
Steve[/quote]

do you actually need to have the description from the database in a tag? Im thinking that you can accomplish what you are after with scripting or using column translation in a table component without using anything but the lineid tag

also, what about a tag change script that looks at all of the lineid tags and any time one of them changes it calls a script that query’s the database and then writes to the linename tag?

just throwing out some stuff that we have thrown around for a similar situation.

I was trying to make everything data-driven in the most efficient way possible but you have some good suggestions - thanks!