DADiSP and Excel
DADiSP, the graphic spreadsheet for scientific data analysis, now works
together with Microsoft Excel to offer seamless integration and data exchange,
affording scientists and engineers the capability to transfer collected
data from their Excel spreadsheets into DADiSP to take advantage of its
powerful and superior analysis and graphic features.
| From DADiSP, you can: |
From Excel, you can: |
| Initialize Excel |
Retrieve analyzed results from DADiSP |
| Retrieve data from Excel |
Send data to DADiSP |
| Send data to Excel |
Activate DADiSP commands |
| Transfer data automatically as cells update |
|
| Execute commands |
|
Using DADiSP and DDE
Dynamic data exchange (DDE) is a method of exchanging data between multiple
applications. One application sends data to a memory location that other
applications access. A DDE application can function as a "client"
that requests data or a "server" that provides data. DADiSP
operates as both a DDE client and server. Advanced DDE applications can
be constructed using DADiSP's built-in DDE functions.
| Function |
DDE Action |
| DDEINITIATE |
Start a DDE Conversation, Returns a channel number. |
| DDEREQUEST |
Get a data item as text from another application. |
| DDEPOKE |
Send a data item as text to an application. |
| DDEGETDATA |
Get a series from another application. |
| DDEEXECUTE |
Execute a command in another application. |
| DDEADVISE |
Automatically retrieve a series from an application whenever
the data changes. |
| DDEUNADVISE |
Cancel a ddeadvise operation. |
| DDELINK |
Automatically retrieve a series from an application whenever
the data changes. The channel number is managed internally. |
| DDEUNLINK |
Cancel a ddelink operation. |
| DDEGETLINK |
Get the link name from the Clipboard. |
| DDESTATUS |
Get the status of the last DDE operation. |
| DDETERMINATE |
End a DDE conversation. |
The steps outlined below demonstrate the basic command method of exchanging
data between DADiSP and Excel.
The DDEINIT function opens a channel to a specific application and topic.
The topic is often a document open in the application. DDEINIT can also
start the application if it is not already running. For example,
ddeinit("Excel", "Sheet1", "", "c:\excel\excel",1)
starts Excel and establishes a DDE link. The fourth string C:\excel\excel,
is the executable name of the application. The last argument of 1 tells
DADiSP to automatically start the application if it is not already running.
The DDEGETDATA function allows an entire data series to be retrieved.
For example,
ddegetdata (chan, "R1C1:R100C1")
retrieves all the data from row 1 column 1 to row 100 column 1 in a
series and places the series in the current DADiSP Window.
After analyzing the data in DADiSP, the resultant information may be
returned to Excel.
DDEPOKE sends a data item from DADiSP to an application as a string.
For example, to send a 100 point series to Excel;
ddepoke (chan, "R1C1:R100C1", Gsin (100,.01,1))
creates a 100 point sine wave and sends the data to row 1 column 1 through
row 100 column 1 in Excel.
Automatic Data Transfer - DDE Advise Loops
DDE also supports a powerful feature called advise loops or hot links
that automatically transfer data whenever the data changes. For example,
to transfer the first 100 rows of an Excel worksheet into the current
Window of DADiSP :
chan = ddeinit ("Excel", "Sheet")
ddeadvise (chan, "R1C1:R100C1")
Whenever data in any cell within the first 100 rows of the first column
changes, the entire column of data is transferred into the DADiSP Window
where the DDEADVISE function was first executed. New data is automatically
appended to past advise data.
Using DADiSP as a DDE Server
Although DADiSP most often functions as a DDE client application, requesting
data from other applications, DADiSP also acts as a DDE server. As a server,
DADiSP supports the following DDE topics: Commands and Systems. With the
Commands topic, applications can retrieve information on almost any valid
DADiSP expression. For example, using Visual Basic from within Excel (i.e.,
using Excel commands):
chn = DDEInitiate ("DADiSP", "Commands")
var = DDERequest (chn, "10*max(w1)")
retrieves from DADiSP the maximum of W1 multiplied by 10 and assigns
it to the Visual Basic variable var.
DDE Management Library
DADiSP's DDE capability is built upon the DDEML or DDE Management Library.
This support insures that DADiSP's DDE capability will be compatible with
and take advantage of DDE performance enhancements in subsequent releases
of MS Windows. The DDEML also enforces strict adherence to the underlying
DDE message protocol.
Excel is a registered trademark of Microsoft Corporation.
|