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.
Содержание CX-Supervisor
Страница 1: ...CX Supervisor Software Cat No W10E EN 01 User Manual Software Release 3 1...
Страница 3: ...Copyright Notice 2...
Страница 16: ...15...
Страница 17: ...16...
Страница 27: ...Tip of the Day SECTION 1 Graphics Editor 26...
Страница 35: ...CX Supervisor Preferences SECTION 2 Pages 34...
Страница 79: ...Responding to Events SECTION 5 ActiveX Objects 78...
Страница 115: ...Printing the Graphics Library SECTION 7 Graphics Library 114...
Страница 181: ...Data Logging SECTION 11 Data Logging 180...
Страница 201: ...Examples SECTION 12 Databases 200...
Страница 243: ...Performance Monitor SECTION 16 Application Analysis Performance Monitor 242...
Страница 253: ...Using with Omron s CX Server OPC SECTION 17 Using CX Supervisor as an OPC Cli 252...
Страница 259: ...Creating a CX Supervisor Client application SECTION 18 Connecting to a remote CX 258...
Страница 263: ...Adding a Point Linked to a Parameter SECTION 19 Connecting to Omron Industrial 262...
Страница 271: ...Data Logging SECTION 20 Best Practices 270...
Страница 275: ...Configuring a Server PC running Windows NT or 2000 Appendix A Configuring a PC 274...
Страница 277: ...Appendix B Frequently Asked Questions 276...
Страница 296: ...Appendix B Frequently Asked Questions 295...
Страница 297: ...Appendix B Frequently Asked Questions 296...
Страница 298: ...Appendix B Frequently Asked Questions 297...
Страница 299: ...Appendix B Frequently Asked Questions 298...
Страница 333: ...Revision history 332...