NameSet string name inaccessible unless "User Selectable" set to yes

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?

  • In reply to Jesse Delanoy:

    Yes the method I used works and I did use it in some in class modules. I appreciate that using fixed strings in class modules rather defeats the object, but in my case the state names of the two DC states were going to be the same in all instances.

    If you want to change the message in the instances then crudely you can just make the whole expression configurable in the instance. More elegant would be to include configurable string parameters in the class module PASSIVE_NAME, ACTIVE1_NAME, ACTIVE2_NAME (or similar) and use these parametes in the LOGEVENT function instead of fixed strings.

    In another class module with a DC using three states I used SELSTR as shown below. Again I used fixed strings for the state names but they could be configurable string parameters in the class module.

    if '^/LOG_ENABLE.CV' = True then
    PV_NOW := '^/DC1/PV_D.CV';
    if (PV_NOW != PV_OLD) then
    if (PV_NOW != 255) then
    A := LOGEVENT("Valve position changed to " + SELSTR(PV_NOW + 1,"closed", "open", "venting", "", ""));
    end_if;
    endif;
    endif;
    PV_OLD := '^/DC1/PV_D.CV';

    Hope this helps