From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

viGetAttribute(io, VI_ATTR_ASRL_BAUD, &baud) returning wrong value

Hi, I have gone through both MAX and the win2K Config to set my default baud rate to be 4800. However, in my IVI driver, when I call the getattribute function, it continues to return 9600??

rjmiller
0 Kudos
Message 1 of 3
(3,521 Views)
Hey rjmiller,

I would suggest trying to use set attribute in your initialization routine.

/* Set the baud rate to 4800 (default is 9600). */
status = viSetAttribute (instr, VI_ATTR_ASRL_BAUD, 4800);

This will set the baud rate to what you want in your program. This way you don't have to worry about MAX or windows settings. This command will over write any previously defined defaults.

I hope this helps.

-Josh
0 Kudos
Message 2 of 3
(3,521 Views)
Hi Josh.

Thanks for the sugestion. I was re-reading the NI-VISA document and it indicates that VISA does default to 9600 N-8-1.

** IF **, one were to modify the default settings (ie: via MAX), then use the VI_LOAD_CONFIG as the AccessMode parameter to viOpen().

This works great and really should be the default for the IVI Wizard under CVI.

rjmiller
0 Kudos
Message 3 of 3
(3,520 Views)