NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NI System Configuration API

We need to be able to reconfigure the IP settings for the Secondary NIC. This is possible via NI MAX and the web interface, but I cannot find a way to do it programmatically, not even in this System Configuration API?

This is a critical feature for us (especially since the secondary port does not support DHCP). It should be possible to run this from the controller itself; the goal is to automatically set up the secondary IP based on either the IP of the primary NIC, or based on a received command...

0 Kudos
Message 41 of 96
(3,925 Views)

Configuring multiple NICs is a bit more advanced with the API, since you can't use just the System Property Node, howerver it is possible.  Open the LV example finder and under the Hardware Input and Output, System Configuration folder you should see one called Network Settings Viewer.  Now the example just shows how to read the configuration from multiple NICs, so you will need to change the reads to writes and call Save after you have made you changes.  The biggest difference is that you will be doing a remote call on Find Hardware to get a list of NICs that you can then get and set properties on, but remember to call Save and Reboot if needed.

0 Kudos
Message 42 of 96
(3,925 Views)

Like Joshua said, the Network Settings Viewer is a good place to start. To run it on the controller itself, just initialize the session with "localhost". Obviously in that case, you'll also need to make sure that the controller has the components "NI System Configuration" and "NI System Configuration Network Support" both installed; you can verify this in MAX by expanding that system's Software node. (They should already be installed if you are using the web interface on that system.)

0 Kudos
Message 43 of 96
(3,925 Views)

I'm able to run the Network Settings Viewer example on the real-time module with the session set to be local - and I read the IP of the secondary NIC. I can also write a new IP to the IPAddr property. If I read back the IPAddr property just after setting it it returns the new IP as well.

However - nothing really changed on the controller. I do run the Save function after setting the property, and the save VI does not return any errors..but nothing has happened. If I restart the code the IPAddr node will retun the old IP. And if I restart the controller - MAX reports that it has the old IP as well.

0 Kudos
Message 44 of 96
(3,925 Views)

The error I get when I try to write to the IPAddr property of the secondary NIC is -2147220623 (Property Node (arg 😎 in Network Settings Viewer.vi).

Is it an unlock issue - or is it just not settable? As mentioned it read the property fine, but that's it.

0 Kudos
Message 45 of 96
(3,925 Views)

Are there any plans to support programmatic modification to IOV properties such as scaling.  It appears that the IOV properties are available in the variable.xml file on the cRIO target and could be parsed and modified to accomplish this.  It would be nice to be able to create a sort of MAX for the cRIO where IOV's could be viewed, modified and deployed without having to recompile your rt executable.

0 Kudos
Message 46 of 96
(3,925 Views)

Never found out what went wrong, but it works fine now. At first I though maybe I needed to make a new administrator and provide that user name and password (I was using admin and blank a long time), but as it is now I do not provide any user ID at all and it still works.

0 Kudos
Message 47 of 96
(3,925 Views)

Some things you may not have set initially, that you need to ensure if you're doing this programmatically:  AdapterMode must be set to 2 for wired TCPIP.  IPAddrMode must be set to 1 for Static addresses.  Only then can you actually change the value of IPAddr.  If things are working now, it may be that once the other properties were configured, then it allowed you to set the address.

0 Kudos
Message 48 of 96
(3,925 Views)

sachsm wrote:

Are there any plans to support programmatic modification to IOV properties such as scaling.  It appears that the IOV properties are available in the variable.xml file on the cRIO target and could be parsed and modified to accomplish this.

One cannot really say "never" but this certainly isn't on our immediate radar. The big goals that we are tackling with NI System Configuration API are really things that apply to multiple groups and trying to make them accessible in a consistent fashion. This seems at first glance to be more IOV-specific.

0 Kudos
Message 49 of 96
(3,925 Views)

Hi Justin,

I would like to use the NI System Configuration API to automatically find, add and configure network cDAQ devices (C modules in cDAQ-9181 carriers) without opening MAX.

Unfortunately, the Find Hardware function only returns me the devices that were previously detected (visible in the "Network devices" of MAX), whereas the "Find network NI-DAQmx devices" window or the "NI Network Browser" list them all. I have the same issue in CVI and LV, with the hardware detection or system detection.

Do I am missing something with the API? Is there a lower-level method to use the network 
service 
discovery 
features?

Thanks for your help!

Benjamin

0 Kudos
Message 50 of 96
(3,925 Views)