I/O Tags

<< Click to Display Table of Contents >>

 

I/O Tags

1.Now let's implement a script to handle commands received on Driver IEC104 and send these commands to Driver IEC61850. To do so, select Tag Operate_CSWI1 on Driver's Design tab, select the Scripts tab, select the OnRead event, and then click Add Script to create a script.

2.Using the AppBrowser AppBrowser, search for the WriteEx method of the I/O Tag responsible for sending an Operate command to Switch Obj1CSWI1, that is, "IEC61850.Obj1CSWI1.CO.Pos.Operate".

3.Remove parenthesis from the WriteEx method and omit parameters WriteStatus and WriteSyncMode.

4.At the end of this procedure, the script is as follows.

Sub Operate_CSWI1_OnRead()
  Application.GetObject("IEC61850.Obj1CSWI1.CO.Pos.Operate")_
    .WriteEx Value, Timestamp, Quality
End Sub

 

5.Finally, create the script showed next on I/O Block's OnRead event, to handle the received information and send a Select or Operate command to Switch Obj3CSWI2 on Driver IEC61850. This script must test the value received in Element Operation and send the value of Element eValue to Tags Operate or SelectWriteValue from Switch Obj3CSWI2 on Driver IEC61850.

Sub cmd_3CSWI2_OnRead()
  eValue = Item("eValue").Value
  Operation = Item("Operation").Value
  If Operation = 1 Then
    Application.GetObject("IEC61850.Obj3CSWI2.CO.Pos.SelectWithValue")_
      .WriteEx eValue, Timestamp, eQuality
  Else
    Application.GetObject("IEC61850.Obj3CSWI2.CO.Pos.Operate")_
      .WriteEx eValue, Timestamp, eQuality
  End If
End Sub

 

6.Depending on the activation order of the objects instantiated in an application, the slave Driver may be activated before the master Driver, therefore the first value of each variable is not received on slave Driver's Tags. Because of this, users must create a script to restart Tags on Driver IEC104. To do so, create the script showed next on the AfterStart event on Driver IEC104 to activate and deactivate all existing Tags.

Sub IEC104_AfterStart()
  For Each Tag In Me
    Tag.Deactivate()
    Tag.Activate()
  Next
End Sub

 

NOTE

In case of Folders inside a Driver, users can only deactivate and reactivate them, there is no need to traverse each Folder internally.

 

7.All gateway configurations are finished. To test communication, the article referring to the implementation of a gateway in Elipse Knowledgebase contains an application that connects to the application developed in this Tutorial and validate the necessary configurations.

Was this page useful?