Accessing the events requires no specific method, you will only need to link the desired elements to a historic, for example, and run WriteRecord method in the block’s OnRead event. In the historic, each element must be linked to a field, according to their datatype.
Example of script:
Application.GetObject(“Hist1”).WriteRecord()
End Sub
Depending on the number of points to be monitored, another alternative is to write a script in EventBlock tag’s OnRead event to check the status of each point individually. Each item to be monitored will need an internal tag, which can later be added to a digital alarm or just be visualized on screen.
Example of script monitoring whether the alarm is in or out in item Point_072:
Set Source = Item(“Source”)
Set Message = Item(“Message”)
Set Point_072 = Application.GetObject(“Dados.Point_072”) ‘Internal Tag
If Source.Value = “gv.Area_001.Point_072” And Message.Value = “2503” Then
Point_072.Value = true
Elseif Source.Value = “gv.Area_001.Point_072” And Message.Value = “6064” Then
Point_072.Value = false
End if
End Sub
In this example, the Message block element informs the alarm’s status (in/out) according to yhe code being displayed.