From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build real-time application with Compact RIO

Good afternoon,

 

I am currently trying to run a VI on compact RIO and would like to control it through remote front panel. I followed steps on this link http://digital.ni.com/public.nsf/allkb/AB6C6841486E84EA862576C8005A0C26 and successfully done everything with a simple example.

 

However when I moved on and did the same thing to a more complicated VI (my purpose is to make this VI work), everything was fine until I reboot the compact RIO. After a few seconds connection lost between the host computer and cRIO, and I had to shut it down and delete the startup file (with extension .rtexe).

 

I am not sure what happened since everthing works fine with simple VI but not the complicated one. It could because the second VI has many sub VIs as well as objective functions loaded in it, it could also because the VI takes too much memories of the CRIO and stop it from connecting to the host computer.

 

If anyone have any ideas of how to make it work please let me know.

 

Thanks very much

Carl

0 Kudos
Message 1 of 10
(2,875 Views)

At reset, the FPGA starts running within a few seconds, and the cRIO starts running in about 20 seconds.

0 Kudos
Message 2 of 10
(2,835 Views)

Hi Todd_lesher,

 

Maybe I did not clearly state my problem, but it was not in seconds, after I reboot the system, it will work for couple seconds, and then disconnected and I can never connecte to it again unless i power it off and on back again. it will disconnect due to the rtexe running automatically in cRIO and I must delete it to prevent it from losing connction again.

 

Regards

 

 

0 Kudos
Message 3 of 10
(2,830 Views)

You are right in your assumption - this usually happens when you max out the CPU usage on the CompactRIO and it is unable to communicate with LabVIEW. Does it run OK in the development environment in interactive mode?


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 10
(2,823 Views)
Hi Sam,

Yes,you are right. I can run it in LabVIEW under compact RIO for no problem, so I am not sure why after turn it into real time app and run as a startup it will take more CPU and lost connection to host computer.

Regards
0 Kudos
Message 5 of 10
(2,817 Views)

I can't think of any obvious cause without seeing your VIs etc. but maybe you could try disabling parts of the functionality to try and rule out what is causing the issue?

 

One thing I've done in the past to try and help me debug issues like these is to have as simple loop that flashes the LED on the cRIO and writes the CPU usage to a network shared variable every 0.5s. If the LED is flashing then you know your cRIO is running and you can view the CPU usage from the shared variable.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 10
(2,810 Views)

Hi Sam,

 

sorry for the late reply. Most of the functionalities will not be started until I press control button in front panel, so it is a little wired that it eats all the cpu power when the vi first runs. 

 

If there is any chance you have time, please, I have attached the VI here, take a look, I could not give all the objective files so you may not be able to run it but I believe you can get some ideas about whats going.

 

The main VI is Nicon_Rio_MDOF_Final.vi, and i will attach the other two sub vis, in next reply

 

Best Regards

0 Kudos
Message 7 of 10
(2,793 Views)

Here are the rest subVIs

 

Thanks again 

 

0 Kudos
Message 8 of 10
(2,792 Views)

Hello zzzfreedom,

 

There are a number of potential issues I can see with the VI you're trying to deploy as a startup executable.  How do you intend to interact with this VI? Are you running the front panel as a remote panel or connecting to the VI using debug tools? A few points:

 

- Your VI will run immediately when the RIO boots unless you're using debugging tools to prevent this from happening, keep that in mind.  It looks like you've accounted for this and required an initialize or network trigger of some sort for some of your loops, but the AI loop will start quickly and appears that it may require user input. 

- You have several "user prompt" style express VIs.  These will not work (or will not work as expected) on a standalone RT target.  There is usually no front panel to interact with!

- Like dialogs, event structures watching for user interaction probably aren't going to do what you want.

- You are writing quite a bit of data to the VI's front panel, and there is at least one chart indicator.  Again, how will the user interact with this VI?  It looks like you need a host VI that will run on a machine the user will interact with.

- You're using quite a few local variables.  It looks like you've taken a lot of care to protect against race conditions, but this causes a lot of data copies and tends to be error prone.

- I've not analyzed all cases, but it looks like you have a number of places where the execution of a timed loop may be blocked under certain conditions.  This will likely rail the CPU due to the much higher priority of the timed loops.

- What will happen if you lose connection with the server in your TCP command loop?  it doesn't look like there is any way for the user to reconnect without restarting the RIO.

 

If you do intend to run this as a remotely accessible VI on your RT target, another point to note is that when running from the development environment, the front panel of your VI executes on the host machine. Once you deploy it as a remote front panel or debuggable RTEXE, everything is hosted on the RIO, and this has the potential to bog things down quickly.

 

Here are a few references I think you might find helpful:

 

LabVIEW Help: Real-Time Operating Systems - see considerations for Express VIs and Front Panel interaction

http://zone.ni.com/reference/en-XX/help/370622L-01/lvrtconcepts/rt_osnotes/

 

LabVIEW Help: Real-Time Module on VxWorks Targets - see unsupported features

http://zone.ni.com/reference/en-XX/help/370622L-01/lvrtconcepts/rt_vxworks/

 

NI LabVIEW for CompactRIO Developer's Guide -lots of good general information on architecting RT applications, network communication and hosts, etc. It looks like you're using the RIO Scan Engine, so the FPGA portion might not be relevant at this time.

http://www.ni.com/compactriodevguide/

 

Best Regards,

Tom L.
0 Kudos
Message 9 of 10
(2,776 Views)

Hi Outlaw,

 

Thanks very much for all the details. I am now running the test in the development environment. It will also take some time for me to go through all your comments, I will let you know if I have any problems in the future.

 

Best Regards. 

0 Kudos
Message 10 of 10
(2,746 Views)