PROCEDURE TransmitTesting
CmdString="[SENDOUT('testing 123',13)]"
*** transmit the string "testing 123" followed by a carriage return (ascii 13)
gnChanNum = DDEInitiate('WinWedge', 'COM2')
IF gnChanNum != -1
glExecute = DDEExecute(gnChanNum, CmdString)
= DDETerminate(gnChanNum) && Close the channel
ENDIF
RETURN
*** the following procedure is a variation of the above procedure that transmits a
*** string passed as a parameter to the procedure (gData)
PROCEDURE TransmitData
PARAMETERS gData
cmdstring="[SENDOUT(' " & gData & " ' )]"
*** transmit the string passed in the variable gData
*** note the use of both single and double quotes around the gData variable
*** refer to the syntax for the SENDOUT command in the Wedge manual for details
gnChanNum = DDEInitiate('WinWedge', 'COM2')
IF gnChanNum != -1
glExecute = DDEExecute(gnChanNum, CmdString)
= DDETerminate(gnChanNum) && Close the channel
ENDIF
RETURN
Other DDE macros and code examples
Visual FoxPro: communicating with devices through WinWedge
Send a command from Visual FoxPro out the serial port to your device with WinWedge using its more advanced DDE mode.
The following procedure demonstrates how to transmit a string out the serial port by sending a DDE command from FoxPro to WinWedge.
Last modified on November 3, 2026