Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO programmatically Enable 2nd ethernet port

Hi, Experts,

 

I need to configure both Ethernet ports on Real time controller, NI-9022, programmatically through Labview instead of MAX. Now I know I can do the job by using "System Configuration API" (https://decibel.ni.com/content/docs/DOC-23048). I repeated the program in the link, and most of it worked well. However, if the second Ethernet port, Eth1, was Disabled originally, I failed to Enable it through "System Configuration API", althrough I think the API include the function. I attached part of my code. Even if the Second ethernet port Eth1 is disable, the API is still able to detected it, and recognize its AdapterMode as "Disabled". However, when I  Enable it and restart cRIO, the Eth1 cannot be enabled. And there is no error information at all.

Untitled.png

So is there any problem about my code? Or do I have a misunderstanding of the "AdapterMode" in the API, which should not be used as this purpose? Or is it a bug in "System Configuration API". Thanks.

 

Best regards,

Jonelle  

0 Kudos
Message 1 of 4
(7,604 Views)

I'm trying also the same thing in order to programatically change the eth1 port of my NI-9792 and I'm having the same problem when the eth1 is disabled.

I'm not able to properly save the AdapterMode=2 (or TCP/IP Ethernet), I'm getting an error -2147220623 ("property does not exist for this resource") when I try to save the value.

 

Anybody found the same problem? Any tip?

 

Thanks in advance

Alejandro Asensio, CLAD
0 Kudos
Message 2 of 4
(7,450 Views)

This is a fairly old forum, but it looks like it was never answered. Besides using MAX, the standard way to configure the second IP address is normally through the distribution of images.

I'm still trying to find the proper way to do so with the system configuration API. I've seen similar results to what you two have posted in my tests. 

 

Alternatively, you can enable the second Ethernet port by changing a token in the netconf.ini file. If you FTP onto the controller you'll find it under /ni-rt/system/ethernet/netconf.ini 

Setting the mode from "disabled" to "TCPIP" will turn it on. You could also set the mode to be "EtherCAT", if that's what you're looking for.

 

If you choose TCPIP you'll also need to add a few tokens for the static IP, subnet mask, and operation mode.

For example here is a port set to 169.254.0.1 with a subnet mask of 255.255.0.0:  

 

Mode="TCPIP"
IP_Address="169.254.0.1"
Subnet_Mask="255.255.0.0"
OperationMode="interrupt"

 

You could configure the IP in MAX then go look at the file to see what the values are set to if you'd like to double check the syntax. 

 

I hope getting a late answer is better than never, 

 

Zach

Applications Engineer
National Instruments
CLD Certified
0 Kudos
Message 3 of 4
(7,181 Views)

Below is an example on how the set the networks settings on secondary port for an RT target.  Note if you run this VI from your host you will need to set your session in (control or string) to the hostname/IP address of your remote target.  If you run it on the target you will need to set the session in to "localhost".  

 

Running this VI on a target requires that you have NI System Configuration installed on the target.  Running it remotely requires that you have NI System Configuration Remote support installed to the target and the target needs to be in run mode (not safe mode or install mode) unless it is one of the new Linux RT controllers like the cRIO-9068. NI System Configuration Remote support comes preinstalled on NI's Linux RT controllers.

 

Screen Shot 2014-01-10 at 10.30.36 AM.png

Message 4 of 4
(7,174 Views)