Accessing Server Properties from the Server

<< Click to Display Table of Contents >>

 

Accessing Server Properties from the Server

If users want to access properties of a Tag from another Tag, source and destination are on the server connected via a parent module, which is Driver1.

In this case, the Parent property must be used. This allows first accessing the parent object where the script is, and then users traverse the hierarchy to look for another element, according to the next figure and example.

Driver1 is the parent object of Tag1 and Tag2

Driver1 is the parent object of Tag1 and Tag2

 

Sub Tag1_OnRead()
  Parent.Item("Tag2").AllowRead = False
End Sub

 

If users are inside a group and they want to access the same Tag2, they can nest several Parent commands, according to the next figure and example.

Folder1 is the parent object of Tag1

Folder1 is the parent object of Tag1

 

Sub Tag1_OnRead()
  Parent.Parent.Item("Tag2").AllowRead = False
End Sub

Was this page useful?