Lookup expression used on a tag

Need help with this expression tag.

Trying use the expression function Lookup on a to see if a Step is found in a data set of specific Step types. From the online help, i need to specify the data set tag. I cannot figure out how to access a data-set of the Step types with the Tag Browser.


Not sure I understand–where do you have the step types defined? In a database table? or hardcoded somewhere?

i will elaborate a bit more. I am looking at the current step type of a CIP program. I need to determine if a step type is Rinse, Caustic, Acid or Sanitizer step. Currently I have this hard coded in an expression. Example for Rinse step examining the Phase ( step type ) from the PLC of the running CIP program:


If the Step (phase) type is found in the list, the Rinse tag is TRUE, otherwise it is false. This is OK and works, but this is an application that we have developed and I am trying to make as field configurable as possible by using Ignition screens and configuration data stored in a database.

What I am trying to do is create a database table to Query that has the list of steps and get the results into a data set that the Lookup expression function can use. If found, i will return the step # if not found I will return a 0. I will know if a step is in the list if the returned value > 0.

I can probably use a Gateway tag change script on the Phase value, but I would like to use the Lookup expression function.

OK. I suggest you create a table with your static (but configurable) information relating phase to the various steps. Any information about each phase that you’ll need in your app should be a column. Load the entire table into a dataset client tag with a query (this will happen only once after the client logs in):Select phase, intl_name, intl_description, isrinse, iswhatever, ... From phase_data Order By phaseThen you can make client tags (with appropriate data types) that use the current phase to pick out the corresponding information (this will happen whenever ‘phase’ changes):lookup({[Client]phase_data},{System0/Phase},0,'phase','isrinse')Scales well, as each client does some of the work for you, and only when the data changes.
If you need to use this with many folders of similar tags, put the lookup bindings on properties in parameterized windows, where ‘phase’ is a property bound via an indirect tag.

[quote=“pturmel”]OK. I suggest you create a table with your static (but configurable) information relating phase to the various steps. Any information about each phase that you’ll need in your app should be a column. Load the entire table into a dataset client tag with a query (this will happen only once after the client logs in):Select phase, intl_name, intl_description, isrinse, iswhatever, ... From phase_data Order By phaseThen you can make client tags (with appropriate data types) that use the current phase to pick out the corresponding information (this will happen whenever ‘phase’ changes):lookup({[Client]phase_data},{System0/Phase},0,'phase','isrinse')Scales well, as each client does some of the work for you, and only when the data changes.
If you need to use this with many folders of similar tags, put the lookup bindings on properties in parameterized windows, where ‘phase’ is a property bound via an indirect tag.[/quote]

Appreciate you taking the time to help, but I need all of this logic at the Gateway as the results of Rinse, Caustic and Acid are part of a transaction group logged with CIP program run data:


These tags are used to create the coloured bars that highlight the step type on the Easy Chart:


Guess i will have to explore the Gateway Tag Change script option.

Guess what it really comes down to, is there a reason why client tags can be of type data set, but Global gateway tags are not?

client tag:


Tags at gateway:


Hi, Curly!

It’s been on the request list for a while, and starting with v7.8, it is! :slight_smile:

Along with array types…


[quote=“JordanCClark”]Hi, Curly!

It’s been on the request list for a while, and starting with v7.8, it is! :slight_smile:

Along with array types…[/quote]

Outstanding!..
Did not see that one in the change log.
Thanks!

[quote=“Curlyandshemp”]but I need all of this logic at the Gateway as the results of Rinse, Caustic and Acid are part of a transaction group logged with CIP program run data[/quote]Yes, v7.8 will let you do what I suggested in the gateway. It will behave somewhat differently, though, as gateway tags are evaluated on a scan class, and only on a scan class. The Client tag approach takes advantage of the update-on-change nature of client tags to have minimal processing impact. {There’s some hope this will be implemented in the gateway – I stirred the pot a bit on this topic after the ICC. :wink: } I’d use a tag change script in the meantime, and in v7.7.

Upgraded to V7.8 RC2 and now can use Lookup expression as I wanted: