I have a need to generate an event entry, LOGEVENT(), in certain situations with discrete control devices (EDCs). In the event string I'm trying to include the PV_D string value at the time the event is logged. What I'm finding is the string name cannot be logged unless the "User Selectable" option is set to yes. With the "User Selectable" option set to no, the LOGEVENT('^/EDC1/PV_D.CVS') generates the event Desc2 message of "_EDC_VLV_PV:1", basically the nameset string name with the integer value of the selected state. The same behavior occurs if I write the value to a string parameter within the control module. When I change the specific NameSet state name to User Selectable = yes, then both the event Desc2 and string parameter show the name, in this case OPEN. I'm working in DV 14.LTS with the latest workstation hotfix applied. Is this expected behavior? Is there any reasonable work around for this?
What you describe is certainly the case in 13.3.1 as I came across the same problem. See this question
In fact BOL specifically states
"The named set does not have to be visible to or selectable by the user. However, if you want the set to be selectable by the user, it must also be visible to the user. In addition, named set states have to be configured as user selectable for the state names to be available for use within the controller."
If you can change the relevant named set states to User Selectable = Yes then that would seem to be the solution. I ended up testing the value of the parameter and then logging a message based on the value of the parameter eg
if (PV_NOW = 'mtr2-pv:RUNNING') then A := LOGEVENT("State changed to running") endif;
In reply to Cedric Dawnhawk:
In reply to Jesse Delanoy: