Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

RT Apply Target Network Settings: Can a cRIO set it's own IP address...

Solved!
Go to solution

Was seeking a way to to progammatically set a cRIO's port 1 IP address from the target it'self -

1) without having to know as-shipped IP

2) and without having to know as shipped MAC ID

 

Get Target Info works fine with loopback address so I undbundle the MAC ID, and use it for the Apply Target Settings. Which errors out on 56.

 

 

NI_Real-Time Libraries.lvlib:FPC Discover systems (all interfaces).vi<APPEND>

<b>Complete call chain:</b>
     NI_Real-Time Libraries.lvlib:FPC Discover systems (all interfaces).vi
     NI_Real-Time Libraries.lvlib:SetTargetConfig.vi
     NI_Real-Time Libraries.lvlib:RT Apply Target Network Settings (Static).vi:1
     TargetInfoTest.vi

Apply works fine when I provide the MAC ID of the target, and run it on the development pc. But I was trying to avoid having to record the MAC ID.

I wanted to have the cRIO set it's own IP address on initialization - and retrieve the address from a gxml file.

 

cCRIO_SetIP.jpg

 

Is this possible?

 

 

0 Kudos
Message 1 of 5
(4,878 Views)

Hi,

 

You could try using the RT Get Target Information (All) rather than  RT Get Target Information (IP). This would retrieve all the discoverable targets on your host computer (example here: https://decibel.ni.com/content/docs/DOC-20299 ) and you could filter (maybe by serial number or model code) to get the MAC address of the cRIO in question. With the MAC address, you said you were successfully able to change the IP address right?

 

(There's also this example: https://decibel.ni.com/content/docs/DOC-17873 , but it seemed like a much more round about option)

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

@Alisha P wrote:

Hi,

 

You could try using the RT Get Target Information (All) rather than  RT Get Target Information (IP). This would retrieve all the discoverable targets on your host computer (example here:


 

The point is, I wish to run this on the target who's IP I wish to set. Not on a host computer.


@Alisha P wrote:

and you could filter (maybe by serial number or model code) to get the MAC address of the cRIO in question. With the MAC address, you said you were successfully able to change the IP address right?

 

 


 

 

I can get the mac id of the target without issue. The loopback IP of 127.0.0.1 does this fine (so long as the port is connected to a switch - I presume).

 

The issue is once obtained, using the mac id on the RT target it'self with the apply target netwrok setting function doesn't work.

I had hoped someone had a clever work around.

 


 

0 Kudos
Message 3 of 5
(4,856 Views)
Solution
Accepted by topic author S1ack

Hi,

 

If you look at the second link I posted, it talks about going into the .ini file and changing the IP address there. I think this method could be done from the cRIO itself; however, in general we don't recommend having the cRIO set its own ip address. I imagine this is why the "Apply Network Settings" VI errors out. Having the cRIO set its own IP address can be problematic if it sets itself to something the computer is unable to find. Good luck!

0 Kudos
Message 4 of 5
(4,854 Views)

OK, I can make that work. If I have to. could be a bit risky. But I will cross that bridge when I have to (production units will require unique IPs - so says the customer).

 

 

0 Kudos
Message 5 of 5
(4,849 Views)