Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual page 153

Script language
Table of Contents

Advertisement

APPENDIX A – OPC Communications Control
Example 2 – Writing a value:
OMRONCXOPCCommunicationsControl1.Value("MyGroup", "BoilerTemp") = 50
In this example, the value 50 will be written to the OPC item 'BoilerTemp'.
Note: 'Value' is the default property so is assumed if omitted. Therefore, the following examples are
the same:
intVal = OMRONCXOPCCommunicationsControl1.Value("MyGroup", "BoilerTemp")
and
intVal = OMRONCXOPCCommunicationsControl1 ("MyGroup", "BoilerTemp")
Read
Reads the value of an OPC item.
Example of synchronous read:
intVal = OMRONCXOPCCommunicationsControl1.Read("MyGroup", "BoilerTemp")
In this example, the OPC item 'BoilerTemp' in the OPC group called "MyGroup" will be read from
the OPC Server and will be stored in 'intVal'. The script will wait for the read operation to complete
before continuing to execute the next line. This is identical to the operation of the 'Value' method.
Write
Writes the value of an OPC item.
Example of synchronous write:
OMRONCXOPCCommunicationsControl1.Write "MyGroup", "BoilerTemp", NewValue
In this example, 'NewValue' will be written to the OPC item 'BoilerTemp' in the OPC group called
"MyGroup". The script will wait for the write operation to complete before continuing to execute the
next line. This is identical to the operation of the 'Value' method.
Page 140
OMRON
Revision 2.0

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents