EasyManua.ls Logo

Omron CX-SUPERVISOR - V2.0 - Page 340

Omron CX-SUPERVISOR - V2.0
370 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
OMRON APPENDIX F – Obsolete Features
Release 2.0 Page 317
1) Example CX-Supervisor Script demonstrating client array points
chan = DDEInitiate(“Excel”, “Book1.xls”)
IF chan > 0 THEN
‘Establish data transfers between point ‘DDEArray’ and Excel
‘the initial values of DDEArray is sent to Excel
DDEOpenLinks(chan)
‘The array is initialised with the value 5 and sent to Excel in
one
operation.
InitArray(DDEArray, 5)
‘The contents of ‘MemoryArray’ are copied into ‘DDEArray’ and the
‘array are sent to Excel in one operation.
MemoryArray[0] = 100
MemoryArray[1] = 34
MemoryArray[2] = 89 * 6
CopyArray(MemoryArray, DDEArray)
‘Sets element 2 of the array to 6 and sends the whole array to
Excel
‘Note: Use ‘On Request’ option and ‘OutputPoint’ to send the array
‘after ‘setting several elements of a large array.
DDEArray[2] = 6
ENDIF
DDE Script Functions
The existing DDE Script functions DDEPoke() and DDERequest() can be used with any array points
as the following example CX-Supervisor Scripts show:
1) Example CX-Supervisor Script demonstrating DDEPoke() with arrays
chan = DDEInitiate(“Excel”, “Book1:Sheet2”)
IF chan > 0 THEN
‘Send element 1 of ‘RealArray’ to Excel
DDEPoke(chan, "R16C1", RealArray[1])
‘Send IntegerArray to Excel as a column (note: range and column
must
‘be ‘specified)
DDEPoke(chan, "R1C1:R3C1[column]", IntegerArray)
‘Send TextArray to Excel as a row (default only range required)
DDEPoke(chan, "R1C2:R1C4", TextArray)
ENDIF

Table of Contents

Related product manuals