Steps to duplicate:
1. Use NI-Max to configure serial port with Name(alias) and Baud rate = 115200.
2. Verify values are saved to "C:\ProgramData\National Instruments\NIvisa\visaconf.ini"
3. Failure #1 - Use Open VISA Test Panel to communicate with instrument. Port settings do not reflect Baud rate = 115200.
4. Open instrument with pyVISA using NI-VISA backend. pyVISA properly see alias set in NI-Max but baud rate = 9600 (default)
pyVISA Serial port setting work with Keysight and R&S VISA backends and associated configuration utilities.
5. Somewhat annoying that VI_ATTR_RSRC_IMPL_VERSION = 0x1600500 (is this correct or should it be 0x2200500?)
Comments: 2022/07/01 17:45:56, nivisa64/win64U/x64/msvc-14.0/release
InternalName: NIVISA_CORE 22.5.0f60
CompanyName: National Instruments Corporation
LegalCopyright: Copyright © 2000-2022 National Instruments Corporation. All Rights Reserved.
FileDescription: NI-VISA Library
Solved! Go to Solution.
Default Port configuration settings are set using Windows Device Manager. The MAX database does not override that setting because there is no cross platform means to override OS specific settings that are stored in HKEYs on Windows.
I am not talking about the Windows "default" port settings. I am talking about the VISA instrument configuration settings. Once the serial port settings for the instrument are configured in NI-MAX I would expect these setting to be propagated to any application accessing the NI-VISA DLL. This is the way that Keysight and R&S VISA configurations work.
If this was not the intended behavior, why are the serial port settings stored in the NI-VISA ini file?
This is not a bug even though NI-VISA serial setting work different from Keysight and R&S VISA. This NI-VISA behavior is more consistent with the VISA library spec VPP-4.3 rev. 7.2.
NI-VISA Serial help indicates:
If you have configured the settings to a different value in the NI-VISA configuration utility (MAX on Windows, visaconf on UNIX), then you must pass the value VI_LOAD_CONFIG (4) as the AccessMode parameter to viOpen(). This parameter will cause the configured settings to be used; otherwise, if the AccessMode is 0 or VI_NULL, the default settings will be used.
Tested on pyVISA with:
instr = rm.open_resource(key, access_mode=constants.VI_LOAD_CONFIG)