Check the Value of a Tag and Issue an Alarm

This example checks the current value of tag D2R9R41D3.Simulation00001. If it is above 5000, an alarm is issued using the source Simulation00001_ALM. The tag name is recorded, the condition Simulated is created, a subcondition of HI and a severity of 750 is assigned.

Example Code

If CurrentValue("D2R9R41D3.Simulation00001") > 5000 Then
   Set AlarmObj = new Alarm 
   AlarmObj.SubConditionName = "HI" 
   AlarmObj.Severity = 750
   AlarmObj.NewAlarm "Simulation00001_ALM", "Simulated", "D2R9R41D3.Simulation00001", "Now" 
End If