Server.ThisObject
The ThisObject property is a server property that returns a reference to the Mimic that contains the script
Syntax |
Server.ThisObject |
Description |
References the Mimic that contains the script. |
Arguments |
None. |
Returns |
ServerObject A ServerObject is a ClearSCADA specific script object that has its own functions (see ServerObject Functions ) and properties (see ServerObject Properties) which can be manipulated. |
Example:
The following script is used on a Mimic in a Group Template. It allows the Group Instance versions of the Mimic (that contains the script) to provide a button that can override the 'DigitalPoint1' point to 1:
Set objPoint = Server.FindObject(Server.ThisObject.Parent.FullName + ".DigitalPoint1")
objPoint.Interface.Override 1
Where:
- objPoint is the name of the variable that is used to store the ServerObject that is returned by the FindObject property.
- The FindObject property instructs the script to search for a point named 'DigitalPoint1' that is stored in the same parent Group as the Mimic that contains the script. The ThisObject property returns the ObjectLink that references the Mimic that contains the script, then the Parent property instructs the script to search in the Group that contains the Mimic, and finally the FullName + "Digital Point1" instructs the script to search for a database item with a FullName value of "Digital Point1".
- objPoint.Interface.Override 1 instructs the script to perform an Override control to the value of 1 on the ServerObject that is stored in the objPoint variable.
The FindObject and ThisObject properties are used to allow the script to search in the same group as the Mimic that contains the script, irrespective of the name of the Group (so ideal for use with Group Templates and Instances).