LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Let's speak about serial communication speed...

Hi all, I'm trying to design a solution for a SW upgrade for a customer of mine, but I would like to share some ideas with someone.

Environment: the customer actually has two different computers with several testing devices attached to each of them via a RS232-to-current-loop proprietary adapter. OK, they have been working for several years till now with DOS-based programs. Now they are looking for a SW upgrade mainly to switch to Windows environment (more user-friendly, more flexible in printing, with the possibility to connect computers to plant network and collect test data remotely... many good reasons to do this; a little aspect of fashion maybee too).

The problem is that the two sets of devices run at different speed, 'cause they have been developed during several years. We're not supposed do upgrade the hardware too.

I can see at least two ways for managing this situation.

Solution A: I can configure two serial ports in the computer with different speed and connect the existing equipments to the ports: with a little modification in the software I can take care of all the devices and manage all the stuff. This is probably the easiest and cheapest solution -and we surely will use it.

Solution B: rely on the ability of VISA to reconfigure the COM port without need to close and re-open it. I have tried this when answering to a question here on the DE (http://forums.ni.com/ni/board/message?board.id=180&message.id=14258&query.id=0#M14258) but now I'm wandering if this is completely safe if running for very long time. Consider that I will have to reconfigure the serial port every second (one second at 9600 baud, the next at 4800, then again 9600 and so on...) and that the program is supposed to run indefinitely: two months working without shutting down the computer are common in my customer's laboratory.

Now the question is: have some of you ever tried solution B? Are you aware of some reason for which this could not work in the conditions I described? Can someone share some tip with me on this particular problem?

Any help will be appreciated.
Thanks all


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 4
(3,185 Views)
Howdy -

I wonder if it's really a VISA "driver" managing the serial port under Win32. NI serial cards, for example, use the native Win32 driver - the software NI delivers is a library that uses the native driver. So the answer may lie in what the native driver does, not what NI may have done in the VISA "driver".

I'd also be surprised that any driver, native or not, would be able to synchronously switch speeds without potential data loss. If you're using a messaging scheme with forward error checking you'd be able to detect a loss perhaps and retry - but then wouldn't this screw up the schedule (alternating the bitrate each second?). The driver has to be manipulating the UART - perhaps the answer lies there - can a UART switch baud rates on the fly without loss of data?

Sure seems to me it would be way less hassle to use two ports - even if you have to add a serial card. Lot's of PC's seem to have only a single serial port nowadays. I've had good luck with the NI PCI serial boards, though they're pricey. If you get the opto-isolated version bear in mind they don't provide the modem control lines. You can use the NI serial library with any serial port - doesn't have to be one of NI's.

Good luck.
0 Kudos
Message 2 of 4
(3,148 Views)
Thank you for your answer.

Yes, of course two port solution is the fastest and easiest, and in fact I have already run this way and the program is actuallty under test.

I was trying to figure out whether the other solution is completely out or is someway practicable.

Since the communication on the serial channel is modeled in polling way driven by the computer, I am always able to switch serial speed when there is no communication running: infact, in the tests I have made till now (a few hours working) I suffered no significant data loss.

I have not completetly understood your discussion about Visa vs. "native" serial driver: can you detail it a little nore?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 4
(3,139 Views)
Microsoft provides a "driver" for the serial ports in any of the Win32 OS's, a piece of software that is part of the OS that communicates directly with the hardware (a UART in this case). It's this Microsoft-provided SW I'm calling the "native" driver. Here's info on the native driver:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp

I believe most third party "serial port" SW are actually libraries that "wrap" the native Microsoft driver. NI's serial library works this way, as does Greenleaf's.

So if there's a "VISA" serial driver, my suspicion is that it is doing the same thing.
0 Kudos
Message 4 of 4
(3,117 Views)