03-15-2016 03:46 AM
Deploy RT and FPGA from Windows Host using normal file transfer?
Hi All.
Hardware: NI LinuxRT sbRIO, 9607.
Is it possible to copy the rtexe file (including the fpga bitbile) to a linux target, and set it to autostart? I want to make a Host program, that can program the RIO with 2 very different setups, thus I would like to transfer 2 different RTexe to the target (only 1 at a time).
I imagine making a Host, that points to 2 directories on the host itself. In these directories I can place the two different RTexes. This also means, that if I have an updated version of one of the RTexe files, I can simply place it in this directory, run the Host program, and the RIO is flashed with the newest version.
I would like to make a custom Host program for this, with Company logo etc.
Is it possible?
Thanks.
03-15-2016
04:31 AM
- last edited on
06-20-2025
02:12 PM
by
Content Cleaner
Yes, you can just copy over the rtexe and any dependencies to the target and reboot it and it will run your new code (assuming it uses the same toolkits/software etc.) - don't forget to include any DLLs/dependencies that your project has as well (it might not be just the rtexe that you need). The FPGA bitfile, is usually a separate file to the rtexe, for example.
To switch between the rtexes, you can either use 'run as startup' on one from the project, and then give the other the same name when you overwrite it. If you want to have both on the target, and just switch between them (or set to 'run as startup' without doing it from the project), there is a guide to do this here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHpnCAG&l=en-US
Finally - have you seen the RAD tool? It is an NI tool (with source code available), which allows you to create images of RT targets and flash/load them onto the RT target - it's based on the system configuration VIs. The fact the source code is there would make it very easy to modify with your own UI / company logo etc. The link for that is here: https://www.ni.com/en/support/documentation/supplemental/12/archive-of-the-real-time-application-dep...
03-22-2016 03:03 AM
Hi Sam.
Thanks for your help.
I have now played around with the RAD tool, which seems to be working fine 🙂
I'm using a sbRIO with NI RT-Linux. I have installed some apps, like minicom and nano, but also an application called ser2net, which I start automatically using a scartup script. Will all this also work if I deploy the image to another target?
03-22-2016 05:38 AM
To be honest - I am not sure - I am not sure if the RAD tool only takes the LabVIEW / NI related directories or if it images the entire folder structure. I think so - but I'd want to try it (e.g. on another target or by formatting and then deploying the image).
03-22-2016 07:32 AM
Just did a test by formatting my target.
Seems like everything is working, all my custom Linux apps are working, and even my startup script is working! I'm thinking that I'm going to use this tool for the first time installation of a new target, because it then gets setup with all my custom software as well. Thanks.
However, it is a fairly slow process. It can easyli take up a couple of minutes. When I want to switch between the two RTexe files, I want it to happen fast, so I don't have to wait 🙂 I see two options:
1) Make 1 RTexe that includes my 2 setups. The RTexe reads a config file to know which VI to start in that exe. I then only need to change the config file, and reboot the target.
=> How can I write in a file on RT from my Windows host?
2) Make 2 RTexe, and copy each RTexe whenever I need to use it, and reboot the target.
=> How can I copy a file from my Windows host?
03-22-2016 07:41 AM
@A.E.P wrote:1) Make 1 RTexe that includes my 2 setups. The RTexe reads a config file to know which VI to start in that exe. I then only need to change the config file, and reboot the target.
=> How can I write in a file on RT from my Windows host?
Use WebDAV or, if you enabled it, FTP to update your config file.
03-22-2016
07:42 AM
- last edited on
06-20-2025
02:13 PM
by
Content Cleaner
=> How can I copy a file from my Windows host?
It really depends on the target and more specifically on the used OS on the target. For Pharlap ETS and VxWorks based targets you would generally use FTP, but on the new NI Linux based targets FTP is typically not installed or at least disabled when you start it up first, since FTP is a completely unsecure connection method. By default you use WebDAV there but can also sftp, which you have to enable first though, see this document. Then you can either use a webdav or sftp client to transfer the according file and using a command line version you can directly call that through SystemExec to automate it in a small LabVIEW tool.
03-22-2016 07:43 AM
Can this be done programmatically?
So my user only sees a user friendly GUI?
03-22-2016 07:43 AM
These approaches sound reasonable. You can copy files between RT and Windows using FTP. To modify a file, get it using FTP, modify it locally and then copy it back to the RT.
Be careful though, you can't overwrite a running RTexe. What we do is send a quit command to the RTexe first. I'm not sure if this is sufficient, we also rename the existing file.
As a 3rd option you could have both RTexes on the RT with different names and modify the startup path (RTTarget.ApplicationPath) in the ni-rt.ini, then reboot the target.
(We did this all with PharLap RT targets, so I'm not sure what is the difference to a Linux RT target).
03-22-2016 07:57 AM
dan_u wrote: Be careful though, you can't overwrite a running RTexe.
Actually, you can when the RTexe is completely in memory. There is an update tool that uses a USB to look for updates and copies over the RTExe when there is one.
Yes, FTP and WebDAV can be completely done programatically. Though, a simpler way might be to send a command via TCP/IP or Network Stream telling the RT to write the value to the configuration file and reboot. You have to be able to connect to the controller already, so why not?