Read a System Tag from Alarming Expression Binding

#1

Hi
I’m trying to write “Display Path” for an Alarm using a expression binding in english and spanish. I’m consent that these paths will be written from the current language on user at that particular time. I already did this but I had to create a tag on default tag folder that takes the .value from language tag that’s inside the system folder; example ‘en’ for english.
I would like to write an Alarming expression binding just like I did, but directly taking the tag value from [system]/Client/User/Language.
In fact, I already did this for a label on the text binding and I used an expression that can read the tag directly from system and it worked.
Is something with Alarming Expression Binding that works pretty different, need some help.

0 Likes

#2

Alarms execute on the gateway level, so you won’t have the access to client tags in that scope. If you create a translation, or possibly set of translations for the Display path, you might be able to use the translate function within the expression language.

https://docs.inductiveautomation.com/display/DOC80/translate

EDIT: Nevermind, just read that was client only as well. Someone else might have a creative path forward for this one.

0 Likes

#3

Thanks for your reply @grietveld.
Actually my problem is that expression binding in Alarm Section of any tag can´t read System Tags, been specific language value. I know this works for example in Labels on text property using a system tag is valid and it works correctly.

I don’t know. Probably something with this special expressions in Alarm binging like {[.]String Tag}, but I not getting any result trying to read a value directly from [system] tags while creating alarms.

This is what I had to do and it worked but ‘language’ is memory tag that I created.
if ({[~]language} = ‘en’,‘Display Path’)

And this is what I want:
if ({[System]Client/User/Language} = ‘en’,‘Display Path’)
but it didn´t work. Why?

0 Likes

#4

You won’t ever be able to read anything from {[System]Client} in any tag expression because they are executed in the gateway. There’s no client scope for them at all. What you are trying to do will blow up if you have multiple clients with their own locales.

If you are developing for a multi-locale environment, you should be keeping everything in the gateway language-neutral, so that the clients can do the translating.

0 Likes

#5

I’m not creating any tag expression. In my OPC tag, in Alarms section, creating new Alarm and in Display Path Binding there is where I want to perform a read from the {[System]Client} with expression binding. My question would be. Why, for example in a label component, the binding on text property can read a value from {[System]Client} and in Alarms section of any tag, that’s not possible?
According with Inductive University a Client can push a language change with system.util.setLocale() to the system.
Nothing will blow up since the license only allows 1 client.

0 Likes

#6

Bindings within a tag definition, including alarm properties, are executed just like tag expressions. In the gateway service. Not in a client. Being licensed for only one client doesn’t change the architecture of the system.

0 Likes

#7

I didn’t say the architecture will change, just said nothing will blow up.
If there’s not functionality with system tags in expression binding, those should not be visible.
alarming

Thanks for the clarification.

0 Likes

#8

I agree. These should not be visible in the Choose Tag dialog.

0 Likes

#9

Well, the [System] provider itself should still work - it’s just that anything in the [System]Client/ folder is not available if you’re not accessing the tag provider from the context of a Vision client. It’s unfortunate and confusing, but there’s really no way to untangle the two concepts at this point.

1 Like