DDE
Appendix F Obsolete Features
315
'Request a column of cells from Excel and copy
into Array2, using
'the return 'flag
Array2 = DDERequest(chan, "R1C2:R3C2",
bReturnFlag)
'Request a cell value from Excel and copy into
element 2 of 'Array1'
Array1[2] = DDERequest(chan, "R3C2")
ENDIF
F.4.3.3 DDE Server Array Points
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 'access ddearray[3] using
'Point' topic
or
=SCS|ddetest.srt|ddearray.0 'access ddearray[0] using
'Project' topic
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.
F.4.3.4 Sending Arrays to CX-Supervisor via DDEPoke()
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 chan, "Array1", Range(Cells(1,1),
Cells(1,3))
Note:
All the above points must have DDE Read/Write access set.
Note:
Microsoft Excel accepts the square brackets '[ ]' used in CX-Supervisor to
reference an array index in a formula; use '.' instead.
Note:
The index must always be specified if an individual array element is required.
Note:
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.
Summary of Contents for CX-Supervisor
Page 1: ...CX Supervisor Software Cat No W10E EN 01 User Manual Software Release 3 1...
Page 3: ...Copyright Notice 2...
Page 16: ...15...
Page 17: ...16...
Page 27: ...Tip of the Day SECTION 1 Graphics Editor 26...
Page 35: ...CX Supervisor Preferences SECTION 2 Pages 34...
Page 79: ...Responding to Events SECTION 5 ActiveX Objects 78...
Page 115: ...Printing the Graphics Library SECTION 7 Graphics Library 114...
Page 181: ...Data Logging SECTION 11 Data Logging 180...
Page 201: ...Examples SECTION 12 Databases 200...
Page 243: ...Performance Monitor SECTION 16 Application Analysis Performance Monitor 242...
Page 253: ...Using with Omron s CX Server OPC SECTION 17 Using CX Supervisor as an OPC Cli 252...
Page 259: ...Creating a CX Supervisor Client application SECTION 18 Connecting to a remote CX 258...
Page 263: ...Adding a Point Linked to a Parameter SECTION 19 Connecting to Omron Industrial 262...
Page 271: ...Data Logging SECTION 20 Best Practices 270...
Page 275: ...Configuring a Server PC running Windows NT or 2000 Appendix A Configuring a PC 274...
Page 277: ...Appendix B Frequently Asked Questions 276...
Page 296: ...Appendix B Frequently Asked Questions 295...
Page 297: ...Appendix B Frequently Asked Questions 296...
Page 298: ...Appendix B Frequently Asked Questions 297...
Page 299: ...Appendix B Frequently Asked Questions 298...
Page 333: ...Revision history 332...