Perspective Symbol States

How do you bind a perspective components symbol state with multiple tags? e.g. the valve symbol states are:

open
failedToOpen
partiallyClosed
closed
failedToClose

My valve UDT does not have all of these states as a single word that can use a map transform. How do I check multiple tags in order to return the correct string?

Thanks!

I would map them into an expression or derived tag to return a single status description (Opened, Failed to Open, etc.) Then you can use that everywhere in your graphics, with one source of truth.

Maybe something like this, which is along the lines that Nick mentioned. Note, I didn't put the tags in a specific order.
tagsStates.json (871 Bytes)

Edit, oops, it should have been binEnum instead of binEnc.

I much prefer a string description instead of an integer. An integer needs translation and could be different for different devices. A string 'Stopped' is always the same and can also be used for graphic display. Mapping to string descriptions in tags for status and modes was hands down one of the best decisions I made in my projects 4-5 years ago. It makes the graphics essentially device agnostic

1 Like

As Nick stated, and I agree, a string is better, here is an updated example. Again, just an example, many ways to accomplish this.
tagsStates.json (1.2 KB)

This is what I use for my style classes bindings.

Device symbol binding on style.classes:


view.custom.status here is the Status Desc tag below (I never refer to the Status tag in graphics, so I drop the "Desc" in my references to it)

Style Class Maps/Device Status dataset tag data:


(someone should really re-order these...)

The StyleClass column has the path to my Perpective Styles. Using a dataset essentially as a map transform allows the transform to be centrally located providing a single source of truth and used for every single status display in the project, rather than having a plethora of independent map transforms throughout the project, all defined manually.

Perspective Style example:
image

Tags:
image
image

1 Like