Opening COMx for USB port

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

Opening COMx for USB port

Postby jilsoft » Nov 07, 2015 15:47

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 ?
Posts: 2
Joined: Nov 10, 2005 18:14

Re: Opening COMx for USB port

Postby Steini63 » Nov 09, 2015 17:42

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)


Return to “Windows”

Who is online

Users browsing this forum: No registered users and 0 guests