I have reverted to using CreateFile, etc. for rather simple serial comm. between my computer (WinXP) and a machine. Never could get AsmIo/WinIo to work w/ TASM!!!

IN al, dx and OUT dx, al worked fine before my upgrade to WinXP. The problem is my pgm would hang up and do nothing, so I placed msg boxes after each function call - write 10h to the machine and a Read back of 10h indicates all is OK.

Hutch's DCB structure looked different than the one I had in my .INC file, so I copied his to my .INC file. I noted that for dcb.StopBits my .INC said to use '0' for 1 stopbit, but Hutch's said to use '1'. My code for the DCB looks like this:

call GetCommState, hComm_1, OFFSET dcb
mov dcb.BaudRate, BAUD_19200
mov dcb.ByteSize, 8
mov dcb.StopBits, 0 ;nothing happens - pgm stalls
, 1 ;get error msg
mov dcb.Parity, 0
call SetCommState, hComm_1, OFFSET dcb
.IF eax == FALSE
call MsgBox, hDlg, DCB failure msg........

The control lines on the PCB are jumpered together - RTS to CTS, etc. so only RxD, TxD, and GND are being used. So I guess my question is should I be placing more info in the DCB structure to get this computer and machine talking to each other?

Thanx for any help and advice.
Dave
Posted on 2001-12-03 10:04:03 by DaveTX47
have a look at BuildCommDCB

it fills all the wired data from a string.
Posted on 2001-12-03 13:53:21 by beaster
Thanx for the response. I tried that and all works fine now.

Thanx again.
Posted on 2001-12-03 17:18:44 by DaveTX47