01-14-2012 02:10 AM
Hi
I have several embedded units that need to be maintain by untrained technicians
so replacing unit from stack needed to change the IP address according
the unit location
so
I am using sbrio 9642XT
the IP need to be changed by using digital inputs that coming from IP connector
so I need to write code that change the IP of target on reset using some IP address
can anyone help me?
01-16-2012 07:43 AM - edited 01-16-2012 07:45 AM
I believe you can change the IP of the target by programatically editing the ini file on the root of your RT target. (Just open it in notepad, its human readable). After modifying it, you need to reboot the target. This can be done using VI's from the RT utility palette. I'm not sure what you mean by "using digital inputs that coming from IP connector"? Your digital inputs would need to come from a digital input module.
Alternatively, you could have the technicians ftp in and edit the ini file, or make a small utility they can run on their laptop to configure the sbrio. Another way could be to include some code on the sbRIO which looks for a USB drive to be attached (look for U:\ drive) then if the file "updateIP.txt" exists on the thumbdrive, read in the new IP from the file, update the ini on the rio and reboot. This way the technician only has to insert a thumbdrive with a "config file" provided by engineer to update/configure the sbRIO.
EDIT : Just noticed that your particular sbRIO does not have USB so that would not be an option. Do note that using VI's in the RT palette, you can scan for and edit IP's for unconfigured devices too, either by scanning (can take awhile) or if you know the MAC of the RIO you can skip the scan and just apply new network settings that way.
Hope some of these ideas help you out.
01-17-2012 03:28 AM
The technician have no skill of computer and software
the solution is outside and is integrated in big system the idea is that
after booting the system get an IP that the lsb's are bits that come from Digital Inputs
the solution needs to be local without intervention of auxiliary equipments or computer
01-17-2012 06:06 AM - edited 01-17-2012 06:11 AM
This should be easy.
Do you know how to get the bits you talk about from the FPGA? I assume you will use some of the 110 digital i/o's on the board?
Once you read the bits, just check the ini text file located on the root of your RT target (using code) to see if the last digits of the IP match your bits. If not, update the file and reboot the target.
I will have similar hardware tomorrow so I could give more detailed instructions then if you need it.
-Q
01-17-2012 11:32 AM
You should look into using the LabVIEW System Configuration API
https://decibel.ni.com/content/docs/DOC-13216
It is automatically installed for certain NI-RIO / LabVIEW configurations. You can look for the pallete in LabVIEW
Otherwise you can manually install it since it support LV 8.6 and higher.
01-17-2012 12:25 PM
I've never noticed that pallete before.. maybe because it is "hidden" away under the measurement pallete?
I would still look into the "RT Restart Target" and "RT Apply Target Network Settings.vi" under the "Real-Time --> RT Utilities" pallete as it may be a faster simpler way to accomplish what the thread opener is trying to do?
hummm. I'll have to take a look at that "new" pallete I found now.. 🙂
01-18-2012 12:21 AM
how can i find out the structure of the folders and files at my target?
and do you know how to restart prorammly, the vi in the RT utilities are used for remote targets
Thanks for your quick and accurate answers
01-18-2012 07:10 AM
The VI in RT can also be used to restart the "local" target. It is a polymorphic VI, just drop it in your code and select the instance "restart self".
To see the file structure of the target, just open up windows explorer (not internet!) and in the address bar type ftp://192.168.0.1 except you replace the numbers with your ip address. Or use any other ftp browser/program you are familiar with. You can use this to copy files to and from the cRIO or sbRIO, such as data log files and such.
Hope this helps
01-18-2012 11:07 AM
For compactRIOs there's an FPGA I/O on the targets that allows you reboot the controller programatically.
http://digital.ni.com/public.nsf/allkb/25825D24D1DF688D8625709D0053FF68
NOTE: This will only reset the Host/RT side. Code on the FPGA will continue to run uninterupted.
In addition to the response above (FTP) you can also use some of the Advanced File Functions. I believe they should work on RT.
Functions >> File I/O >> Advanced File Functions
It contains functions like "List Folder" and "Recursive File List"
02-09-2012 05:02 AM
I have tryed to find in the files structure the file that contain the IP
do anybody know which file contain it
Shai