Jump to content

CompactRIO launch an .rtexe from an .rtexe


Recommended Posts

Hi colleagues,

I need some help. 

Description: it's necessary to launch an app startup.rtexe on a CRIO 9075 (OC VxWorks) then launch a second app app.rtexe from the first one and close first app.

Seems System Ecex.vi might be a great solution, but this function is not available in a palette for RIO which is based on VxWorks.

Maybe anyone could help me or share links with relevant information.

 

Thanks, Vadim.

Link to comment
Quote

Seems System Ecex.vi might be a great solution, but this function is not available in a palette for RIO which is based on VxWorks.

No! An rtexe is not a real executable. It is more like a ZIP archive that can not be started in itself but that needs to be started by invoking the runtime engine and passing it the rtexe as parameter. And the exact mechanism is fairly obscure and not well researched and totally not documented. Unless you are a Linux kernel hacker who knows how to investigate the run level initialization and how the LabVIEW rtexe mechanisme is added in there.

Link to comment
13 hours ago, Rolf Kalbermatter said:

No! An rtexe is not a real executable. It is more like a ZIP archive that can not be started in itself but that needs to be started by invoking the runtime engine and passing it the rtexe as parameter. And the exact mechanism is fairly obscure and not well researched and totally not documented. Unless you are a Linux kernel hacker who knows how to investigate the run level initialization and how the LabVIEW rtexe mechanisme is added in there.

Thanks, Rolf for the explanation.

Link to comment
21 hours ago, Rolf Kalbermatter said:

No! An rtexe is not a real executable. It is more like a ZIP archive that can not be started in itself but that needs to be started by invoking the runtime engine and passing it the rtexe as parameter. And the exact mechanism is fairly obscure and not well researched and totally not documented. Unless you are a Linux kernel hacker who knows how to investigate the run level initialization and how the LabVIEW rtexe mechanisme is added in there.

Rolf, I've been looking for this information myself. Not quite in this use case as requested, but simply to restart the application. Do you have any reference for simply restarting the runtime engine and relaunching the configured rtexe? SystemLink is capable of doing this, but I haven't managed to figure out how yet.

Link to comment
19 hours ago, Jordan Kuehn said:

Rolf, I've been looking for this information myself. Not quite in this use case as requested, but simply to restart the application. Do you have any reference for simply restarting the runtime engine and relaunching the configured rtexe? SystemLink is capable of doing this, but I haven't managed to figure out how yet.

We normally just make the executable reboot the cRIO/sbRIO it runs on instead, through the system configuration function nisyscfg.lvlib:Restart.vi, but here are two discussions on killing and restarting just the rtexe on LinuxRT:

https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Launching-startup-rtxe-from-terminal-or-linux-window-manager/td-p/3457415

https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Is-it-possible-to-close-and-re-open-RTEXE-through-Embedded-UI/td-p/3707540

 

 

Edited by Mads
  • Like 1
Link to comment
6 hours ago, Mads said:

We normally just make the executable reboot the cRIO/sbRIO it runs on instead, through the system configuration function nisyscfg.lvlib:Restart.vi, but here are two discussions on killing and restarting just the rtexe on LinuxRT:

https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Launching-startup-rtxe-from-terminal-or-linux-window-manager/td-p/3457415

https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Is-it-possible-to-close-and-re-open-RTEXE-through-Embedded-UI/td-p/3707540

 

 

Oh that’s perfect. Just like OP on that post it’s the reboot time that’s the issue for me. This line is what I was missing:

 

/etc/init.d/nilvrt stop && /etc/init.d/nilvrt start

 

I’ll give this a try. Thank you. 

Edited by Jordan Kuehn
Link to comment

So combining the script to stop and start the NI service, with a couple of file copies or moves, you could get something that works but is pretty clunky.  When the user tries to switch programs, it will need to copy over the other rtexe, replacing the current one, then have it call a script to stop and start the NI service.  That might bring up the new rtexe, but will have issues if you restart the controller as it will run the now new rtexe instead of the older one.  It might be possible to on start up, copy over the first rtexe back before the NI service starts.

All very clunky, and probably not what you want but possible.  Other developers would probably suggest trying to just make a single LabVIEW project that combines the code from both into a single application.

Link to comment
17 hours ago, hooovahh said:

When the user tries to switch programs, it will need to copy over the other rtexe, replacing the current one, then have it call a script to stop and start the NI service. 

The path to the rtexe launched by the RTE is not fixed...so perhaps you could just change the given path before killing the current application?

I have not tried, but if it works it would allow you to keep multiple rtexe files instead of overwriting them:

On LinuxRT the path is in:

etc/natinst/share/lvrt.conf

which is an ini-file formatted file it looks like with the key:

RTTarget.ApplicationPath=/home/lvuser/natinst/bin/startup.rtexe


 

Link to comment
15 minutes ago, Mads said:

The path to the rtexe launched by the RTE is not fixed...so perhaps you could just change the given path before killing the current application?

Oh that is better than renaming EXEs and copying them.  A native solution from NI would be even better but I'm guessing they don't get this kind of request often.  Still if the embedded target has some desktop like functionality it isn't crazy to be able to run arbitrary LabVIEW binaries.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.