Within Vision on Ignition Edge 8.1, I'm trying to capture the current user on a client in an alarm when a setpoint is changed. I have the following script, but the [client]_Setup/CurrentUser shows up as null even though I've verified there is a value by adding the tag to a screen. Is there a way I can get this to work? I verified using a lowercase c for Client by copying the path.
if({[.]../Cfg_Tag}!="P_Alarm",{[.]../Cfg_Tag} + " : ","") +
if({[.]Cfg_Tag}!="P_Alarm",{[.]Cfg_Tag} + " : ","") +
{[.]../Cfg_Desc} + " : " + {[.]Cfg_Cond} +
if({[.]Cfg_Cond}="Setpoint Change",
" : user " + {[client]_Setup/CurrentUser} +
" : SP " + toStr({[.]../Out_Spa}) +
" " + toStr({[.]../Cfg_Eu}),
"")
Generally, tags and alarms execute on the gateway, independent of any particular client instance; therefore you cannot access the [client] tag provider or tags in the [System]Client folder from "regular" tags.
Think of it this way - what would this alarm's display path evaluate to if there was no client launched at the time? Or if there were two clients launched simultaneously?
You need to flip the model around - the UI layer needs to "push" state in to whatever you're doing, rather than the tag layer "pulling" from the user interface.
For instance,
Is this a direct binding? If you make it a script instead you can capture the user at submission time and use that in your script to make the edit to the tag.