Opening COMx for USB port

Windows specific questions.
Post Reply
jilsoft
Posts: 1
Joined: Nov 07, 2015 15:20

Opening COMx for USB port

Post by jilsoft »

Sort of a newbie here. Just started trying to use FreeBasic and am having difficulties. I am running a W7 Pro platform with my laptop connected to an Arduino UNO. The W7 control panel (system>device manager>ports& lpt with my device as Arduino Uno (COM4) so I know the driver is hooked up ok. I also communicated with it using Realterm so I know thi virtual serial port is working. I wrote a very simple program:

var comrtn=99
var a=1
comrtn=Open Com("COM4:9600,N,8,1" AS #a)
Print "Open Com return: ",comrtn

I compiled (no errors) and ran it in a command window and got the print-out:

Open Com return: 1

An error code 1 is supposed to be "Illegal function call" Any idea why ?
Thanks--
Steini63
Posts: 3
Joined: Nov 10, 2005 18:14

Re: Opening COMx for USB port

Post by Steini63 »

The comport handling of FreeBasic expects a high signal on DSR line by default after opening a comport.

You can suppress that by adding DS0 as extendet option.
comrtn=Open Com("COM4:9600,N,8,1,DS0" AS #a)
should do the job.

I recommend to use:
comrtn=Open Com("COM4:9600,N,8,1,CS0,DS0,CD0" AS #a)

Regards
Steini
Post Reply