Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 07, 2019 10:56 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Enumerating serial ports
PostPosted: Thu Jun 19, 2008 3:50 pm 
Offline

Joined: Sat Oct 01, 2005 5:13 pm
Posts: 53
Location: Kirkland, WA
On Windows, if there is a Bluetooth port that is not connected to a device, there can be a long (30 sec or more) pause when the port is accessed in a loop like this:

PortList.DeleteAllRows
for i=0 to System.SerialPortCount-1
PortList.AddRow System.SerialPort(i).Name
next


Why is this? I'm not opening any serial ports. It is possible to enumerate ports without attempting to open them. e.g. this C++ library works just fine:

http://www.naughter.com/enumser.html

This is driving many of my customers to despair. Is there a solution to getting the list of serial port names fast, without attempting to open them?

Alternatively, is there a way to know the mapping of COMxx to System.SerialPort(yy), so that I don't have to enumerate the names as I do above?

Paul Rodman


Top
 Profile  
Reply with quote  
 Post subject: Re: Enumerating serial ports
PostPosted: Thu Jun 19, 2008 4:34 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Not sure if the WFS has any alternatives
Alternatively port the C++ to RB or compile the C++ to a dll and use it

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Enumerating serial ports
PostPosted: Thu Jun 19, 2008 8:31 pm 
Offline
User avatar

Joined: Tue Oct 25, 2005 1:57 pm
Posts: 332
I have been having the same problem. Apparently, each time you use System.SerialPort(some_number) RB tries to access/open the port, so I'm told. I have another issue that is even worse. Each time I use System.SerialPort with the port that points to my bluetooth device it locks up, and I can't connect to it any more, unless I cycle its power. Very annoying, and apparently there is nothing that can be done except to use MSComm for serial communication.

Read more about the issue here:
http://forums.realsoftware.com/viewtopic.php?f=2&t=21486

Read more about using MSComm here:
http://forums.realsoftware.com/viewtopic.php?f=10&t=16942&hilit=mscomm

If you need an example on how to use MSComm, get it here:
http://opensource.the-meiers.org/index.html#MSCommExample

_________________
http://freeware.the-meiers.org
http://opensource.the-meiers.org


Last edited by roger on Sun Jun 28, 2009 7:31 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Enumerating serial ports
PostPosted: Thu Jun 19, 2008 9:36 pm 
Offline

Joined: Sat Oct 01, 2005 5:13 pm
Posts: 53
Location: Kirkland, WA
roger,

Thanks. That's useful information. I am developing on Mac OS X, but I'm sure I can figure out and use the MSComm stuff. I very much doubt RS has any plans to fix their code, since it's been screwed up since before V5.0.

Paul Rodman


Top
 Profile  
Reply with quote  
 Post subject: Re: Enumerating serial ports
PostPosted: Fri Jun 20, 2008 12:27 am 
Offline
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
Screwed up? I hardly think that's accurate -- it enumerates the serial ports, exactly as expected. You'll notice from the link you posted above that there are at least *seven* different ways to enumerate serial ports on Windows, each with their benefits and drawbacks. The benefit of the approach we take is that it finds all available ports. The drawback is that it can be slow for certain devices. Note: we've actually used four of the seven methods at one time or another, and have run into bugs with all of them. Might be possible to try the dev manager again since we no longer have to worry about Windows 98 support though.


Top
 Profile  
Reply with quote  
 Post subject: Re: Enumerating serial ports
PostPosted: Fri Jun 20, 2008 8:58 am 
Offline

Joined: Sat Oct 01, 2005 5:13 pm
Posts: 53
Location: Kirkland, WA
Aaron,

Perhaps "screwed up" is a bit harsh. However, I cannot count the number of users that have been bitten by this and complained, and the numbers are growing as Bluetooth becomes more common. They also complain that no other apps have this problem. What do I tell them???

Please do consider revisiting the dev manager. In the astronomy community the majority of devices are still serial port based.

Paul Rodman


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group