From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Compact RIO ( cRIO )/ LabVIEW Event Handling Bug

Solved!
Go to solution

I have a bug in my cRIO code and it only happens in cRIO and not in Windows PC. To illustrate the bug, I have included a LV 2014 vi that duplicates the problem. 

 

The code is very simple and has teh following capabilities:

 

1) If the user presses the "Test" button, the Enum has its Value Signaled set. Then the Enum change event is triggered two times.

2) If the Enum is changed by itself, only one Enum Change event is observed.

 

 

This bug is only seen in cRIO but not on Windows PC LabVIEW.

 

Michael

0 Kudos
Message 1 of 15
(5,828 Views)

You shouldn't be using the Event Structure like this with RT.  There isn't a user interface on RT (with very few exceptions) so it wouldn't make sense for the user to interact with an interface that doesn't exist. 

0 Kudos
Message 2 of 15
(5,806 Views)

You must not be familiar with the new Compact RIOs that have a display port on them. NI is seeing that there is no reason to have a PC in a test system if you allow for a user interface on cRIO. This is relatively new.

 

If event structure is supported in RT(it is on the palette) , then it should work correctly.

 

 

Message 3 of 15
(5,786 Views)

I'm assuming "with very few exceptions" was lost on you.  Given the range of cRIOs, which do you believe would be the exception to that rule?

 

Now that we've got your misplaced condescension aside, they've been included throughout because there's more than one way to use them.  Registering user events isn't uncommon on RT targets.  If they were eliminated entirely from the RT targets, you wouldn't be able to use them in this way and that's not really a restriction that makes sense.  I can't speak to whether or not they're intended to be used as they are on a host PC with the 903x series.  But, it certainly doesn't surprise me that they didn't make a huge change to their code for just a single family of targets when it's behavior that has never worked with the cRIO before.

0 Kudos
Message 4 of 15
(5,768 Views)

Hi everyone,

 

In the LabVIEW help file for Event Structures, this note is at the bottom:

 

EventStructureRTnote.JPG

 

There is also a similar thread to this one here, which might be of interest.

 

Also, you might be able to use user events to accomplish the functionality you desire. A small example exists here.

 

Hope this helps!

 

 

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 5 of 15
(5,747 Views)

Hello Andrew,

 

Thanks for the info but I had read all of the notes before. I am programming a test system with a Windows PC talking to a NI-cRIO-9035 which was interacting with its FPGA. I am using LV 2014.

 

I set up communication between the PC and the cRIO using UDP. The PC sends a message to the cRIO to perform a task and then send data back to the PC that the task was finished, etc. I programmed the cRIO to use the Event Structure just to test my software out. The cRIO interacted with the FPGA to performa the tasks. Initially things were not working correctly but after going to a LV user group, I found an NI rep who was able to get me going using the UI on the cRIO running source code on the PC.

 

To get the Event structure to work properly on the cRIO, the change I made is shown in the attached file. Under Startup settings, the "Enable Embedded UI" has to be checked. This allowed Events (including Value Signalling) to be seen and used. It works well and helps to test out the interconnection betweren the cRIO and the FPGA. At the LV user group, the NI rep said that the reasoning for allowing Events to be used in cRIO was to allow standalone User Interfaces using just the cRIO and not having to have a PC head on it.

 

As for my test code, if someone could please confirm that this is a bug. This would allow NI to look at this and maybe issue a CAR for 2015 sp 1 or maybe 2016. I am not aware if it was fixed in 2015 because I have not downloaded it yet. 

 

I do have a workaround but would like to see it fixed for future work or so that others that use event structures do not have problems with double events being seen.

 

Cheers!

 

michael

0 Kudos
Message 6 of 15
(5,725 Views)

"event structures on RT targets do not support events associated with user interface objects, such as VI front panels or controls."

 

If you've read that twice, why are you asking if the behavior you're seeing related to your RT target not working with events associated with user interface objects is a bug?

0 Kudos
Message 7 of 15
(5,704 Views)
Natasftw - I've made this same mistake in other threads. Apparently on the newer Linux-based cRIOs, VIs do have a front panel and events are supposed to work. In at least one other thread I said the same thing you've been saying about events on RT, and was corrected.
0 Kudos
Message 8 of 15
(5,679 Views)

The screenshot from above is the LabVIEW 2015 help document on Event Structures. 

The closest thing I can find in any help documentation is here: http://zone.ni.com/reference/en-XX/help/370622N-01/lvrthowto/deskenv_front_panels/  "You can now interact with front panel controls, indicators, and menu items, as well as stop and run the VI, using the embedded UI."

 

Nobody is disputing the 903x series has the Embedded UI, also known as its own Front Panel.  Have you seen any documentation that calls out Event Structures or is this an assumption being made?  I've seen this as an assumption in several threads.  I've never seen any documentation suggesting it's expected the Event Structure will work with the Embedded UI.  So far, the behavior matches the documentation.  If it's a bug, it's a bug in both documentation AND behavior.  It's generally along the same lines as the mentality posted here "it's on the palette so it should work" which ignores that it was there prior to Embedded UI.  It has more than one function and one has historically worked on RT targets. 

 

Where are you seeing something other than speculation?

0 Kudos
Message 9 of 15
(5,662 Views)

nathand - do you happen to have a link to any of those other forum posts?

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 10 of 15
(5,603 Views)