![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Apologies all, false alarm
Download Menu Item works fine
Suspect it was a residual "cr" used in testing that was
causing the trouble.
Cheers! Anil
-----Original Message-----
From: Anil Rodrigues
Sent: Friday, August 25, 2006 3:33 PM
To: sftalk_at_forth.com
Subject: [sftalk] Re: serial words
Serial Comms more help!
Part of my program needs to send data from a PC to a machine
using the serial port. (9600,n,8,1).
Using SIO.F, the download works fine from the console.
( uses (COM-KEY?), (COM-KEY), (COM-EMIT), modified opencom)
However sticking in "Download" as a Menu Item in an Application
produces an Access Violation. This is running the windowed app
from the console, not turnkeyed yet.
Also I'm sure I shouldn't have the comm status appearing on the
console window, (status bar), as it does.
Any advice apprciated; I'll post the code if that would help.
And should I be using Commdriver instead of SIO? ( seems more
complex).
Here's part of it anyway:
500 value del \ x 2ms = 1 second
: xcr 13 (COM-EMIT) ;
: xsp 32 (COM-EMIT) ;
ICODE C@+ ( a -- a+1 c )
PUSH(EBX)
EAX EAX XOR
0 [EBX] AL MOV
EAX EBX MOV
1 # 0 [EBP] ADD
RET END-CODE
: clr begin (com-key?) while (com-key) drop ( emit) repeat ;
: xsst ( addr n -- ) \ xmt string
0 do c@+ (com-emit) 3 sleep drop loop drop ;
: xhx ( n --- \ asciout) HEX (.) xsst xsp DECIMAL ;
: er! hwnd z" Receive Timed Out" z" ERROR" MB_OK MB_ICONSTOP OR MessageBox ;
: wai 0 to ch
del begin 2 ms
(com-key?) if (com-key) ( dup emit) to ch then
1- dup 0<
ch 13 = or
( key? or)
until
0< if er! drop then
clr
;
: xst\r xsst xcr wai ; \ send string with cr, wait for cr
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Mon Aug 28 2006 - 06:18:40 PDT
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:40 PST