|
WinWedge can be configured to send data to other Windows
programs either by coinverting the data to "keystrokes" or
by passing the data using DDE. The primary advantage of setting
up the Wedge to send keystrokes to another application rather
than passing data using DDE is simplicity. By sending keystrokes,
no special programming is required in the application that
will receive the data. For example, when reading data into
a spreadsheet, a common requirement is to have successive
readings from a device appear in a column in the spreadsheet.
By sending keystrokes you could simply configure the Wedge
to send a "Down Arrow" keystroke after each input
from your device to move the cursor down one cell and thus
be ready for the next input.
A minor disadvantage of sending keystrokes is that the application
that is receiving the data must be in the foreground and
have the input focus before the Wedge can send any keystrokes
to it, thus true background processing is not possible when
sending keystrokes.
Sending keystrokes from one application to another is also
slightly slower than using DDE.
DDE on the other hand does not require the receiving application
to have the input focus therefore all data transfers can
occur in the background while you work with other programs
in the foreground. One difficulty with DDE is that "linked "data
from the Wedge (or any other DDE Server) is always transferred
to the same location in the client application (i.e. a "linked" cell
in a spreadsheet). To get successive data readings into a
column in a spreadsheet you must write a macro in the spreadsheet
that runs automatically after each input is received. The
purpose of the macro would be to either explicitly request
the data from the Wedge or copy each new data item from a linked cell
and paste it to the bottom of the column in your spreadsheet.
One way to accomplish this is to have WinWedge issue a DDE
Command after each input that causes the spreadsheet to run
a macro that either requests the data or copies any linked
DDE data into a column.
A powerful feature of DDE is that applications that support
it can send commands directly to each other and thus you
could fully automate a data collection process between your
application program and WinWedge. This requires a small amount
of programming in your application but the extra effort allows
you to create extremely sophisticated device interfaces.
Also, because all DDE operations can occur in the background,
even with a minimized application, DDE operations typically
execute much faster than sending keystrokes from one application
to another.
Note: WinWedge does not have to be in "DDE
Server Mode" in order to accept and process DDE commands. The
Wedge will still execute any DDE commands sent to it even
if it is in "Send Keystrokes Mode" or "Log
To Disk Mode".
Related Links
Understanding Dynamic Data Exchange
DDE Examples
WinWedge DDE Commands |