Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

non-standard baud rate on MacOS X

Hello,

 

I am trying to configure a USB-serial adapter for communications with a Stanford Research Systems residual gas analyzer (RGA) on a Mac (10.6, Intel processor). The RGA device is hardwired for a baud rate of 28800; it can't be changed. Apparently the only serial driver API available on MacOS X is POSIX, which does not support 28800. Even though VISA can support arbitrary baud rates, the underlying driver can not, and VISA returns an error when you try to configure the port. this behavior is true for both LV8.5 and LV2009.

 

There are terminal emulator programs (e.g. ZTerm) that can configure the serial port and talk to my RGA. I guess they bypass the POSIX drivers somehow. Does anyone know of a way to get the 28800 baud capability through LabVIEW? I would like to integrate residual gas analysis into the beamline control system, which is LV-based.

 

Thanks for any help you can offer.

-Rob

 

0 Kudos
Message 1 of 6
(2,861 Views)

Hi Rob,

 

It might help to post an NI Spy Capture file when setting the baud rate to 28800, so we can identify the specific VISA error. If you aren't already familiar with NI Spy, the following KnowledgeBase should be a good resource to step you through the process.

Best Regards,
Swathi B
0 Kudos
Message 2 of 6
(2,839 Views)

Hi,

 

I've attached the  .spy file and the VI that generated the error. The offending call is:

 

VISASetAttribute("ASRL3::INSTR", ASRL_BAUD, 28800)

 

and the return code is 0xBFFF001E (VI_ERROR_NSUP_ATTR_STATE)

 

with a description of "The specified state of the attribute is not valid, or is not supported as defined by the resource."

 

Thanks,

-Rob

 

 

 

 

0 Kudos
Message 3 of 6
(2,835 Views)

Hi,

 

First of all you have to be sure that your hardware (the serial port) support non-standard baudrates.

I use USB UART devices from FTDI. They support any number (up to the maximum) for the baudrate.

 

0 Kudos
Message 4 of 6
(2,821 Views)

Hi,

 

The hardware does support the baud rate. I can communicate with the instrument from a terminal emulator program (ZTerm), so the problem is definitely software in the LabVIEW-VISA-POSIX chain. ZTerm somehow bypasses the POSIX driver, which is supposedly the only serial port API on MacOS. I want to know how to make LabVIEW / VISA bypass the POSIX driver too.

 

-Rob

 

0 Kudos
Message 5 of 6
(2,810 Views)

Hi Rob,

 

Unfortunately, VISA does rely on the underlying POSIX-based drivers for serial communication on Mac OS X, and as a result, it won't be possible for you to achieve the 28800 baud rate directly. Your best bet then may be to identify any libraries associated with the ZTerm program and call into them in LabVIEW with Call Library Function Nodes. I hope this helps!

Best Regards,
Swathi B
0 Kudos
Message 6 of 6
(2,752 Views)