Saturday, September 5, 2015

Tethered output going

Got serial cable via usb-serial on Dell and fed by null-modem cable to HP Vectra.  Using Bray terminal both were sending and receiving OK but when I cam to write a simple com program in FreeBasic it froze and reboots were required. Turns out the first "Open COMn" line is very important. see two versions below. One caused lock up. Maybe due to time outs. Here's the version that worked:

'serout2.bas
Dim b as byte
'didn't work --> Open COM "COM2: 9600,N,8,1,BIN,DS0"  As #1
 open com "com2:9600,n,8,1,cs0,cd0,ds0,rs" as #1 
do
PRINT #1,"A"
   
Print ". ";
sleep 500
loop until inkey$ = chr$(27)
close
'Sleep
End

No comments:

Post a Comment