Readarea; B.9 Readarea - Omron CX-Supervisor Reference Manual

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

ReadArea

Note:

B.9 ReadArea

Note:
132
Appendix B CX-Server Communications Control
In this example, 'NewValue' will be written to the point 'MyPoint' in the PLC
called 'MyPLC'. The script will wait for the write operation to complete before
continuing to execute the next line due to the '0' parameter. This is identical to
the operation of the 'Value' method.
If the PLC is not open, then this command will cause it to be opened, and then
closed after the write is complete. If more than one read or write operation is
to be performed, it is considerably faster and more efficient to use the
OpenPLC command first, do all the reading and writing, and then (if required)
use the ClosePLC command to close the PLC.
Reads a specified block of memory from a PLC.
Examples of synchronous read:
MyVariant = CXServer.ReadArea("MyPLC/DM0", 12, vbString)
MyVariant = CXServer.ReadArea("BoilerTemp",10, vbInteger)
MyVariant = CXServer.ReadArea("BoilerTemp", 20)
In the first example, DM0 to DM11 will be read as characters (part of a string)
from 'MyPLC' and will be stored in 'MyVariant'.
demonstrates that it is also possible to use a logical name for the start
address, and that any VB variant types (such as vbInteger) can be used. The
third example shows that the VB Variant type parameter is optional - if none is
specified then vbInteger is assumed. The script will wait for the read operation
to complete before continuing to execute the next line.
If accessing from a CX-Supervisor script, the following integral values should
be used for the return type:
Constant
Value
vbEmpty
0
vbNull
1
vbInteger
2
vbLong
3
vbSingle
4
vbSingle
5
vbCurrency
6
vbDate
7
vbString
8
vbObject
9
vbError
10
vbBoolean
11
vbVariant
12
vbDataObject
13
vbDecimal
14
vbByte
17
Description
Uninitialized (default)
Contains no valid data
Integer subtype
Long subtype
Single subtype
Double subtype
Currency subtype
Date subtype
String subtype
Object
Error subtype
Boolean subtype
Variant (used only for arrays of variants)
Data access object
Decimal subtype
Byte subtype
The second example

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents