Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change NI-VISA runtime "instrument configuration"?

How to change NI-VISA runtime "instrument configuration"? For example, I want to configure a LAN address (TCPIP::156.140.113.84::inst0::INSTR).

 

I don't have NI-MAX, because its just a runtime install. Do I have to use the NI System Configuration API? Or is there some other mechanism?

0 Kudos
Message 1 of 4
(3,678 Views)

hognala,

 

Can you explain more about what you want to accomplish? Do you want to change the default VISA Resource Name that is assigned to a specific device? What is your application?

0 Kudos
Message 2 of 4
(3,657 Views)

I just want to add a LAN instrument, so it is reported when I call viFindRsrc

0 Kudos
Message 3 of 4
(3,655 Views)

Static VISA resources are stored in the visaconf.ini file located in C:\ProgramDataNational Instruments\NIvisa. When you add a new LAN resource, 2 changes are made to that ini file. First, the NumOfResources token under the [TCPIP-RSRCS] section is changed to reflect the total number of TCPIP. Second, the specific device information is added to the resource list. Here is what my it looks like in my ini file with 2 TCPIP resources:

 

[TCPIP-RSRCS]
SynchronizeAllSocket=0
SynchronizeAllVxi11=1
NumOfResources=2
Name0="TCPIP0::10.1.128.126::Resource1::INSTR"
Enabled0=1
Static0=1
Name1="TCPIP0::10.0.0.0::Device::INSTR"
Enabled1=1
Static1=1

  

I wasn't able to find a way to add a resource using the sysconfig API or VISA, but you should be able to programmatically change this ini file to accomplish what you want to.

 

Message 4 of 4
(3,630 Views)