Download CX-Supervisor Reference Manual

Transcript
ActiveX Functions
SECTION 6 Functions and Methods
This will read the property 'DM' (with one parameter 100) from the OLE object
'CXComms1' and store it in the point 'DM100Value'.
6-19-2 PutProperty
Description
Puts a value stored in a point into the property of an OLE object.
Syntax
PutProperty(object, property, ..., value)
Remarks
Argument
Type
Description
object
Text
The name of the OLE object containing the
property to change.
property
Text
The name of the property to put.
---
n/a
Any number of parameters for the property.
value
n/a
The value to write to the property. Type is
dependant on the type of property. Can also
be a number.
Typical Examples
PutProperty("OLE1", "Left", NewLeftValue)
This will write the value stored in the point NewLeftValue to the property 'Left'
in the OLE object 'OLE1'.
PutProperty("CXComms1", "DM" 10, NewValue)
This will write the value stored in the point NewValue to the property 'DM' (with
one parameter 10) in the OLE object 'CXComms1'.
PutProperty("Gauge1", "Value", 25.2)
This will write the value 25.2 to the object 'Gauge1'.
6-19-3 Execute
Description
Execute a method of an OLE object.
Syntax
Execute(object, method, ...)
Remarks
Argument
Type
Description
object
Text
The name of the OLE object.
method
Text
The name of the method to execute.
---
n/a
Any number of parameters for the method.
Typical Examples
Execute("OLE1", "Start")
This will call the method 'Start' on the object 'OLE1'.
Execute("CXComms1", "OpenPLC", "MyPLC")
This will call the method 'OpenPLC' with one text parameter 'MyPLC' on the
OLE object 'CXComms1'
117