[Imported] Generate local alarm from script "If local registry value = OPC tag"
>>Message imported from previous forum - Category:Scripts and Tips<< User: mchartrand, originally posted: 2018-10-25 18:03:19 Id:263 This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.
**_tresleiv: Is there a way to generate an alarm from a script which is only shown to a specific station. Lets say i have a global tag (OPC) with value from 0-20 and i want to compare this value with a local registry value. Is there a solution to generate an alarm for the station where these value matches?_**
_varLocalId = GetRegistry(ThisStationID,000) If Server.GetOPCValue("GlobalId.CurrentValue")=varLocalId Then generate alarm code?? Else........_
bevanweiss: Can you provide the actual operational requirement? The way you're attempting to achieve this may not be the best way within ClearSCADA to actually achieve your desired outcome.
Alarms are generated on the Server. So all you should be doing then is filtering them on the Clients in question. The issue here is that ideally you would want your filtering to be based on Alarm Severity, and this would mean creating and managing a collection of Alarm Severities to equate to the various Client machines you have.
There may be some other ways to do this in terms of assigning alarms to particular users if this is actually closer to what you want the end effect to be.
AWoodland: ClearSCADA supports the ability to assign alarms to specific users (if logged in) or specific workstations (if connected), check out the help for alarm redirections for how.
**_tresleiv: For some operations/equipment our customer want to have control access from only one specific workstation (WS) at the time. If the current workstations does not have control access, a request can be sent to whom is in control . We solved this by giving every ws an unique registry ID and by comparing this value with a global ID variable in expression for the specific equipment (pick enabled/disabled) eg. Lets say there are 5 ws and these are numbered 1-5. Every stations has there own local registry ID equal to their ws number. For "pump A" a pick disabled/enabled is defined by an expression like this: IFF("GlobalID.currentValue"=(REGISTRY(LocalID,000)),0,1) If the Global ID is 1, only ws1 can operate pump A, If its 2, only ws 2 can operat etc. For change of ws "in control" a request is sent by writing the local userID to GlobalRequest value by a mimic script. The value in GlobalRequest will be the same as the number of the ws where the request is sent from Server.SetOPCValue".GlobaleReq.CurrentValue"(GetRegistry(LocalID,000)) Lets say ws 1 is in control and an operator want to control pump A from ws 2, the following is for a normal operation: GlobalID = 1, GlobalReq=0 (WS 1 in ctrl) Operator at station 2 presses "Request Control" GlobalID = 1, GlobalReq=2 (WS 1 in ctrl, WS 2 wants ctrl) It is at this situation i want to generate alarm for ws 1, something like: "Workstation 2 asking for control, please answer request. Request is auto-accepted in 45 seconds." The trigger for the alarm will be (simplified): IFF( (GlobalID=LocalID)&(GlobalReq0)) Then generate alarm..... Request is accepted either from operator or timeout at station 1: GlobalId=2, GlobalReq=0 (WS 1 lost control, WS 2 In ctrl) Area of interest applies to user and/or ws only. I need to alarm the specific station in control of pump A, independent of user and ws. Is there a way of generate a local alarm by comparing Local Registry value and a global OPC value?_**
nminchin: This sounds like something that might be better handled by a normally hidden prompt graphic object in the navigation bar or page template object. Using an alarm for this doesn't give the operator much time to decline the request, as they would need to see the alarm, then navigate to wherever the decline button is located. If this is instead brought up in a prompt with the message and relinquish and decline control buttons, the operator can easily access and action their decision.
AWoodland: Assign the alarm to the workstation, then you don't need to write custom script. Only one workstation can be connected with a workstation name so this, if your alarm banner filters are set correctly, mean that only that workstation sees the alarm.
Also check out exclusive control, it too may achieve what you want without the need for custom scripting.