Code Samples
This page contains example macros
and subroutines for some of the more common PC application programs
(i.e. Excel, Access, Word, Visual Basic, FoxPro, Lotus 123 and Quattro Pro). The examples
demonstrate how to do things like transmit and receive serial data
using Dynamic Data Exchange with WinWedge or launch and unload the
Wedge from memory as well as perform various other related functions.
The comments in the examples will explain the details of how each
routine works and will also point out any lines that may need
changing in order to work with your particular system.
DDE Examples
|
Excel |
|
|
Access |
|
|
Word |
|
|
Visual Fox Pro |
|
|
Visual Basic |
|
|
Lotus 123 |
|
|
Quattro Pro |
|
|
Minitab |
|
|
Intellution FixDMACS |
|
|
Wonderware InTouch |
|
|
MATLAB |
|
|
Origin 5.0 |
|
See Also:
Important:
Dynamic Data Exchange is an extremely powerful and flexible way to
pass data or commands directly from one application to another
however this power and flexibility does not come without a small
price in additional complexity. The examples provided here should
help greatly to make the process easier. One thing to consider is
that there are many situations where DDE may not be required and
using WinWedge in "Send
Keystrokes" mode may be more suitable. Using the Wedge in "Send
Keystrokes" mode is much easier and much quicker to configure than
using WinWedge in "DDE Server" mode.
For example if you are reading data
from a simple instrument like a bar code reader, electronic balance
or an electronic caliper and you simply want to input a small amount
of data into a spreadsheet or database, then using "Send Keystrokes"
mode may be a better and much simpler approach than using DDE.
There may also be situations where
it might be convenient to input data from WinWedge using "Send
Keystrokes" mode and also send data out the serial port by sending
DDE commands to WinWedge.
WinWedge does not have to be in
DDE Server mode in order to accept and process DDE commands. You
can still send DDE commands to WinWedge to have it transmit data or
prompts out a serial port even when it is in "Send Keystrokes" or
"Log to Disk" mode. |