#22 serial port

open
5
2012-10-03
2007-07-05
No

port = "COM3:4800"
fh=opencom(port)

Func OpenCom(cport)
fh=freefile
print "Opening "; cport; " as " ; fh
open cport for output As #fh
OpenCom=fh
exit func
End

should work. But it barks at me every time, saying "Unsupported." When I remove the colon and 4800, I can open the port! This really should support syntax like

cport = "COM3:4800,N,8,1" ' 4800 baud, no parity, 8 data, 1 stop bit
open cport for output As #fh

But it most assuredly does not. I also cannot read the port -- I always get zero characters waiting using LOF() even when the device replies to me. I can't get the characters back.

Discussion