LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save serial VISA settings to MAX, programmatically

I thought this would be relatively straightforward to do using the NI System Configuration library, in fact I'm surprised after all these years I hadn't coded this.  But the method (attached in a snippet) doesn't seem to do what I want.

 

The goal: after I programmatically determine the correct baud rate and character format for a serial port, I'd like to push those settings into MAX, so tomorrow on the next VISA Open call (with "Load Configured Settings"), assuming the hardware is the same, there's no need to search for the correct settings.

 

The attached code doesn't return any errors, but neither do the port's default settings change in MAX.

 

Thanks for any help on this!

 

Dave

 

Save VISA Settings to MAX.png

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 1 of 5
(274 Views)

To my knowledge, NI MAX doesn't store NI-VISA settings. 

You can create a VI to load settings programmatically.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 5
(130 Views)

NI MAX does store VISA settings in the visaconf.ini or similar file. However they are NI-MAX specific and the NI MAX API is not public nor documented. The NI System Config API is a different set of API that exists in parallel to the NI Max application, not on top of it. In fact some of the actual remote target control work inside NI Max is nowadays performed through NI System Control, but NI is since many years trying to discontinue NI Max, which is generally considered a monolithic unmanageable piece of software components that defy any modern software design rules.

The NI SystemLink platform was likely their preferred way of replacing it and monetizing it, before they lost their focus almost completely a few years back. Things are more focused now and I believe that NI Max is eventually going away and being replaced completely with a different application, almost certainly making use of NI System Control to manage all the hardware and probably some sort of NI SystemLink light.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 5
(116 Views)

Rolf,

 

Thanks for your reply.

 

I've generally thought of MAX as a front-end to managing configuration info across most/all of NI's different hardware and software components.  I was unaware after so many years that they would like to move away from it... (...to what, as a replacement? Rhetorical question.)  Perhaps my post conflated MAX with the SysCfg API, but I would have expected some interoperability.

 

Given that the System Configuration API seems to have awareness of all those "experts", certainly NI-VISA, I'm dismayed to find that "save hardware settings" and/or "save system settings" has no way to update VISA configuration.  So, my alternative is to go programmatically locate visaconf.ini and rewrite the file's content?  That seems like an unpleasant (in the US we might say "ham-handed") method.

 

Best regards to you!

Dave

 

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 4 of 5
(101 Views)

It's a little interesting- the function Import  says it'll import a configuration file into MAX, and you can export one from MAX. Unfortunately when I run it on my system it doesn't get the VISA stuff and I'm not sure why. I also can't see a way to modify MAX settings using that API.

0 Kudos
Message 5 of 5
(86 Views)