Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Change cRIO hostname programmatically

Solved!
Go to solution

I know that I can read the hostname from a cRIO but I would also like to be able to write to this property.

Is there anyway to do this?

 

Thanks

0 Kudos
Message 1 of 4
(1,991 Views)
Solution
Accepted by topic author viScience
08-27-2015 04:09 PM

You can change the network settings of an RT target including the name using \vi.lib\real-time\rtutility.llb\RT Apply Target Network Settings (Static).vi

 

Manually you can retrieve the  ni-rt.ini file, change the machine name, and redeploy it to the target.

authored by
Christian L, CLA
Principal Development Manager - Partner Program
Applications Engineering Senior Manager - Data Acquisition, Control, and Real-Time Test
National Instruments - Austin, TX

  
Message 2 of 4
(1,966 Views)

Ok, thanks that will work but I do not really want to have the controller reset.

I tried to use the FPC write packet vi to change the host name but it did not work.

I opened a connection read the FPC, modified the hostname (with pading) and

then did the write.  Is there something else that needs to be done?

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

Unfortunately what else needs to be done is to reset or reboot the controller so that it goes back out to the DHCP server and re-registers, informing the DHCP/DNS server of its new name.

 

The FPC Write updates the INI file, but does not inform the DNS server of the change. If you query the RT target for its name (e.g. in MAX) it will return the new name even without rebooting.

authored by
Christian L, CLA
Principal Development Manager - Partner Program
Applications Engineering Senior Manager - Data Acquisition, Control, and Real-Time Test
National Instruments - Austin, TX

  
0 Kudos
Message 4 of 4
(1,936 Views)