Omron CX-Supervisor User Manual page 316

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

Advertisement

DDE
Note:
F.4.3.3 DDE Server Array Points
Note:
Note:
Note:
F.4.3.4 Sending Arrays to CX-Supervisor via DDEPoke()
'Request a column of cells from Excel and copy
into Array2, using
'the return 'flag
Array2
bReturnFlag)
'Request a cell value from Excel and copy into
element 2 of 'Array1'
Array1[2] = DDERequest(chan, "R3C2")
ENDIF
All the above points must have DDE Read/Write access set.
The value of an array point named 'ddearray' in a CX-Supervisor project called
'ddetest.srt' can be read from a Microsoft Excel worksheet by entering the
following formula format into a cell.
=<Server>|<Topic>!<item>.<index>
Example
=SCS|Point!ddearray.3
'Point' topic
or
=SCS|ddetest.srt|ddearray.0 'access ddearray[0] using
'Project' topic
Microsoft Excel accepts the square brackets '[ ]' used in CX-Supervisor to
reference an array index in a formula; use '.' instead.
The index must always be specified if an individual array element is required.
CX-Supervisor supports 'Hot' DDE links, if Microsoft Excel has the link option
automatic set, then the value in Microsoft Excel are updated whenever
ddearray[index] changes.
The above example is the simplest way to access/read single elements of an
array from Microsoft Excel, to read/write whole arrays, it is necessary to use
macros (Microsoft Excel Visual Basic scripts).
The example scripts that follow have all been created using Microsoft Excel
and are working examples. They contain the minimum amount of information
required to demonstrate the particular facility being described; i.e. they do not
contain any error-checking code.
In order to write to an CX-Supervisor array point using the DDEPoke()
function, it must first be given DDE Read/Write access, via the Advanced Point
Settings dialog box when adding or modifying the point. The following script
shows how to send arrays of values from Microsoft Excel to CX-Supervisor via
DDEPoke().
Example sending array values from Microsoft Excel to CX-Supervisor:
Sub SendArrayValues()
Dim chan As Integer
chan = DDEInitiate("SCS", "Point")
If chan <> 0 Then
'Send a row of data to an array point named
"Array1"
DDEPoke
Cells(1,3))
Appendix F Obsolete Features
=
DDERequest(chan,
'access
chan,
"Array1",
"R1C2:R3C2",
ddearray[3]
using
Range(Cells(1,1),
315

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents