|
This can be done using a macro in Excel or Visual Basic. One of the DDE Commands supported by WinWedge is "SendFile". Thus the following Excel macro would send the file data.txt out the serial port COM 2:
Sub SendMyFile()
Chan = DDEInitiate("WinWedge", "Com2")
DDEExecute Chan, "[SENDFILE('c:\data.txt')]"
DDETerminate Chan
End Sub
Alternatively, a string of control codes can be sent out of the serial port by issuing the DDE command "[SendOut()]" to WinWedge. This example sends an escape character (ASCII 27), a capital "P" and a carriage return-linefeed (ASCII 13 and ASCII 10).
Sub SendEscapeP()
ChannelNumber = DDEInitiate("WinWedge", "COM1")
DDEExecute ChannelNumber, "[SENDOUT(27,’P’,13,10)]"
DDETerminate ChannelNumber
End Sub
|