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: 

Intermittent dialog box problems on a cRIO

Hi all, I've been running into ongoing problems with a real time VI in LabVIEW 2020, running on a cRIO 9047, and was hoping you could help me figure out what's going on.

The main VI will be controlling a data acquisition system and is intended to be capable of standalone operation on the cRIO.  The RIO has a touchscreen and keyboard to allow this.

As part of this VI, the user can click a button to pop up a dialog box to enter calibration data for a given channel.  In an earlier, PC-based version of the VI, I did this using the Prompt User for Input express VI.  As this VI would not run on the cRIO, I attempted to make my own, using the express VI as a starting point, and have run into ongoing problems.

 

In my first attempt at the new VI, I used the dialog box VI shown in the attached "Dialog with events.jpg", handling the "OK" and "Cancel" button pushes with an event structure.

I found that sometimes this runs fine, other times it freezes as soon as the OK button is clicked, and execution has to be terminated.  When it does work, it works consistently: I can repeatedly call the dialog box VI to calibrate and re-calibrate as many times as I like without trouble.  Other times, it freezes.  It seems to be especially prone to the freezing behaviour the first time I run it after connecting to or restarting the RIO. 

Probing what's going on, it looks like when it does freeze, it happens at the event structure. After clicking "OK", it registers the event (probe 4 in the screenshot) but apparently doesn't get out of the event structure. Probes 6 and 7 remain un-executed.  I can't figure out why this is happening, and why it it works sometimes but not others.

 

I then tried an alternate approach, removing the event structure entirely.  This is shown in "without events.jpg"

With this version, it does get out of the while loop when OK is clicked and the dialog box closes, but the main VI seems to completely freeze at that point.  Unlike the version with events, this behaviour seems to happen all the time.

Probing the outputs of my dialog box VI call, it seems that they remain un-executed, even though the dialog box VI closed.

 

I've been struggling with this for a while now, and I suspect there are some nuances to this that I'm not understanding. I'd be very grateful for any help in getting to the bottom of this!

 

Download All
0 Kudos
Message 1 of 3
(987 Views)

As a preliminary check, I guess you must have the Embedded UI enabled?

See https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000004AV2SAM but I'm pretty sure it wouldn't work in any situation with the Event Structure if you didn't have this...

 

Moving on to a more serious suggestion/question, is there a reason for the "Main While Loop" in your event-based screenshot? (Basically, is there some other event being handled?)

If not, you could just put all of the controls (Low Cal Level, ...) inside the Event Structure and avoid the loop entirely.

That might not make a big difference (or any), but it could do and is probably worth trying.

 

Since you're also using a static VI and not an express creation thing, you don't need most of the Property Nodes - you can just set the buttons as you like and scrap that code, it will eliminate stuff that could be an issue, maybe. See the bottom section (Additional Information) here: Unsupported LabVIEW Features on NI Linux Real-Time Targets (I'm not sure what the relationship between that paragraph and the embedded UI is though...)


GCentral
0 Kudos
Message 2 of 3
(958 Views)

Yes, the importance of enabling embedded UI was one of the earlier lessons I stumbled into with this project. 

Good points on the main while loop and the property nodes, but cleaning that up doesn't seem to have addressed the problem, unfortunately.

The comments on the limitations of modifying front panel objects is interesting.  Does anyone know if that's universally true of all cRIO's, or only models with less support for embedded UI's?

I wonder how such problems would present themselves: would the VI simply not work at all / give an error, or could it explain inconsistent results?

0 Kudos
Message 3 of 3
(937 Views)