I have the statement A := LOGEVENT ("Valve position changed to " + '^/DC1/PV_D.CVS');in a CALC block. When the containing module is assigned to a workstation it produces what I want eg "Valve position changed to OPEN". If the module is assigned to a controller it produces eg "Valve position changed to ‘vlvno-pv:1’".
I am guessing that this is because the named states in this named set are not User Selectable. BOL says “In addition, named set states have to be configured as user selectable for the state names to be available for use within the controller.” However I don't know why it is different for a module in a workstation.
If I am correct in the above assumption (which maybe someone could confirm) the obvious solution is to make the named sets User selectable. The problem is that the particular named sets I want to use are 'system' sets which are protected against changing
I think the protection can be removed by exporting the set, changing "FIXED=T" in the export file to "FIXED=F" and importing. However this change, I seem to remember, is overwritten if DeltaV is upgraded.
I don't really want to have to replace all the instances of the 'system' named set with a user defined one as there are an awful lot. Any ideas?
In reply to vmvmhatre:
In reply to Cedric Dawnhawk:
Is it possible to condition the LOGEVENT. IF '^/DC1/PV_D.CVS' = ‘vlvno-pv:1’ THEN A := LOGEVENT ("Valve position changed to OPEN"); ELSE A := LOGEVENT ("Valve position changed to CLOSED"); ENDIF;
In reply to Nicholas Stom:
In reply to Michael Krispin:
The NS should work as long as the entry is visible and downloaded to the controller, the user selectable is only for allowing changes from HMI, control studio, etc although there are items that will actually allow you to set the value to non user selectable values like logic in the controller, Watchit, OPC, etc.
As far as the DIS_CHANGE parameter wired to OR1/OUT_D, Write/Output Parameters are only updated at last part of the execution of the module/composite (after the last block). Changing the DIS_CHANGE parameter type to Internal Reference and point it to OR1/OUT_D would allow you to reference this parameter. If you was to see this, put a module in debug mode and advance thru each block and you will see the wire doesn't update the parameters after the blocks executes and only will get done after the last block executes. Read/Input Parameters are opposite in that they are only done before the first block execution. So if you have a Action/Calc block that updates a Read/Input parameter, any wires from these will be what the value was when it first starting executing.
Just a note on your expression: if your PV_D is non-zero and you download your module it will do the LOGEVENT again as these temporary variables will get reset to 0. You may consider adding the following as the first part of the expression to address not logging the event on download (although if the PV changes on the first scan after the download...it wouldn't record it so pick your poison):
IF SYSSTAT('$sysstat_opts:MyDownload') OR SYSSTAT('$sysstat_opts:TotalDownload') THENPV_OLD := '^/DC1/PV_D.CVI';endif;
You can remove the TotalDownload option but wanted to show it here so others can see that check.
In reply to Matt Stoner:
Andre Dicaire
In reply to Andre Dicaire: