LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
cpschnuffel

Native drivers for serial interface (RS232 etc.)

Status: New

For ethernet and GPIB communication I have the choice between the LabVIEW "native" drivers (residing in function palettes "Instrument I/O" and "Data Communication") and VISA. LabVIEW 6.1 was the latest version which also supports "native" drivers for serial interface. In LabVIEW 7.0 and later you are forced to use VISA.

 

Besides all advantages of VISA - the biggest disadvantage of it is its HUGE communication overhead it produces. If you use interface sniffer like PortMon, you will see that VISA heavily communicates with the interface chip (requesting its status etc.). So for sending a simple "Hello" over RS232 you don't have only four actions (configure port, open port, sending "Hello", close port), but ten and more.

 

As consequence VISA often lockes out if you have heavy traffic on your serial interface (e.g. if you have to send data every 250ms over the interface) - and if VISA lockes out, you have a serious problem...

 

So PLEASE, give us the native driver for serial interfaces back!

7 Comments
GuenterMueller
Active Participant
I have not experienced any problems with VISA on RS232 even when sending and receiving a couple of bytes every 20ms. Did I miss anything?
Dennis_Knutson
Knight of NI

I've never had any problems either. If you have problems running at 250ms, then there is probably something wrong with the code. Post it in the LabVIEW or Instrument Control Board.

kegghead
Member
I've run into bandwidth limitations with the VISA serial interface. Even at slow speeds like 38400 bps the latency/overhead in the VISA operations was prohibitive for my application where I had to slow down my control loop because I could not move enough data across the bus. One might be quick to dismiss it as the fault of the device on the other end, but I replaced the VISA calls with calls to the Win32 API and everything worked as expected. In my experience the VISA calls can send data large amounts of data quickly, but only if large strings are sent in single operations. The VISA calls are too slow to use for things like regular handshaking where two devices continuously share a few bytes of data resulting in data rates approaching the maximum.
Intaris
Proven Zealot

@kegghead

 

I've never had that problem.  I've done these kind of communications int he past and never ran into an API bottleneck assuming I had configured the VISA ports properly.

 

Timeouts and End conditions are very important......

cpschnuffel
Member

@kegghead

 

I absolutely agree with you. IMHO quick communications with small amounts of data are the main problem of VISA because of the resulting communication overhead. I also replaced the VISA calls with Win32 API calls, and everything worked fine.

 

@all

 

As I mentioned, use PortMon and compare VISA communication with Win32 API communication (e.g. by using lvserial by Martin Heinz Systemtechnik) and you will see what I mean...

 

cpschnuffel

Brian_Powell
Active Participant

I second @Dennis' request to see the code.  Let us know if you post it.

 

Fair disclosure:  I was the guy who decided to stop shipping "serpdrv" and move everybody to VISA for serial communications.

 

kegghead
Member

@Brian @Dennis,

 

Please see this topic I created on lavag last year when I observed this problem. I never did determine why VISA was operating so slow on that system, once I had the Win32 implementation working I kept it for the lifetime of that application (about a month).