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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Add Network Device to visaconf.ini

For some background, our software can communicate with many devices using VISA, so each device gets a simple VISA resource drop down. In order for a network device to show here, it needs to first be added to NI-MAX. We would like to incorporate something like the wizard in MAX into our software so that the device can be added to the list of available VISA resources. I know how to construct the resource as TCPIP0::<address>::INSTR, but that would need to be selected separately, it wouldn't show in the VISA resource drop down.

 

The visaconf.ini file doesn't look too difficult to edit, but before I dive into that, I was wondering if anyone has used any NI DLLs to accomplish this. I'm not sure why the system configuration VIs don't have this functionality, they all use nisyscfg.dll, but it doesn't look like any functions in that allow for adding a new resource.

 

At this point I assume that NI-MAX is just editing visaconf without using an external library and this is what I would have to do as well, but if anyone knows of an existing way to do this, it would be greatly appreciated.

0 Kudos
Message 1 of 5
(2,421 Views)

I'm still looking for a better, official way to do this, but in the meantime I came up with a quick and dirty solution that I figured I'd share for people that find this thread in the future. This is just to add a new device, and there isn't any validation or checking if what you're adding already exists, but it will give an idea of how it works. It's pretty simple since visaconf.ini is a normal configuration file that LabVIEW can handle.

Message 2 of 5
(2,395 Views)

Hi!

 

In this document you may find useful information about programmatically adding VISA resources in LabVIEW.

 

Regards,

Gaheel17

0 Kudos
Message 3 of 5
(2,373 Views)

That just shows how to find resources that have already been entered. I'm asking how to add a new network resource through Labview without using MAX. Thanks, though.

0 Kudos
Message 4 of 5
(2,364 Views)

Hi,

 

This same issue was discussed here. You can take a look, however, the solution you proposed seems to be the most appropriate.

 

Regards,

Gaheel17

0 Kudos
Message 5 of 5
(2,354 Views)