NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to close and re-open RTEXE through Embedded UI

Hello there

 

One of my customer asked that he wants to close and re-open the RTEXE on stand-alone cRIO through Embedded UI. I suggest him to reboot the cRIO but he doesn't like the option due to booting time.

Or I asked him to stop and re-run the VI, but he still curious about the possibility of the way.

 

Regards,

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

You would need to see if Linux has the option to create an Icon that can be restarted.  This is definitely a Linux question.  Ideally, you could make an RTEXE that simply had some state it could go to that would reset the current state of the rtexe (i.e. values, controls, indicators etc.) and then start again.  This doesn't give the same result of completely restarting the rtexe, but Ideally embedded exe's don't need/shouldn't be restarted

 

Just my thoughts,

 

Bear

Regards,

Ben Johnson
ʕง•ᴥ•ʔง
0 Kudos
Message 2 of 4
(4,891 Views)

While it would be possible to create a script (that is run behind a desktop icon) that would kill off the LabVIEW RT runtime (which would lead to the runtime restarting), the issue is that after killing off the runtime twice, any startup application (rtexe or built-app) would no longer load (a safety measure to make sure a startup app doesn't keep crashing the runtime).

 

Instead, what you'd want to look into is installing and configuring sudo to only allow the lvuser user to run a script to restart the runtime. This would look something like the following:

 

First, install sudo

 

opkg update

opkg install sudo

Next, setup the proper (limited) permissions for the lvuser user

visudo

This will open the vi editor and check the additions to the sudoers file to make sure that the syntax is correct. Add something like this to the end of the file, use [i] to enter into editing mode, [esc] to exit editor mode, and [:wq] to write the changes and quit. If you feel more comfortable with another editor (nano is a popular choice), use that.

...

lvuser ALL= (ALL) NOPASSWD: /usr/local/bin/restart_lvrt

Now, create the script that we want to assign an icon to for easy execution, namely /usr/local/bin/restart_lvrt. It should contain something like the following:

#!/bin/bash

 

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

 

Finally, create the panel launcher for the script, giving it the action to run that script, prefixed with sudo

Add_A_Panel.jpg

  1. Right-click the desktop, select Settings»Panel
  2. Add an item to the Panel (select Launcher)
  3. Add a new empty item (the page icon)
  4. Give the launcher a reasonable name, enter the command to point it to the script created above, prefixed with sudo
Message 3 of 4
(4,889 Views)

I built a fairly large LabVIEW RT Project a few years ago that used a PXI system rather than a cRIO.  The Host and RT Remote communicated over a pair of Network Streams, with additional Streams used to stream data from the Remote to the Host.

 

The Host had the option at the end of an Experiment of exiting or restarting (meaning "Let's do another Experiment, as if starting all over").  In both cases, the Host told the RT Remote to exit, but the final command to the RT Remote was to restart itself.  I chose to do this as it puts the Remote in a "known, good State", with the Host waiting to establish Network Streams and start the entire dance all over again.  Yes, it takes a few seconds for the reboot to take place, but the User is busy fussing with the Host, not paying much attention to the Remote, so it isn't such a Big Deal, and (in my opinion) is worth the assurance of starting from a known, safe place.

 

Bob Schor

0 Kudos
Message 4 of 4
(4,509 Views)