LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error using dynamic event between two VIs with cRIO

Hello everyone,

 

I'm facing a problem using a dynamic event.

 

My goal is to use a button on a VI (we'll call it the topLevel) that will trigger an event case on another VI (we'll call it the subVi).

 

In fact, the topLevel is my project's HMI. To avoid having too much code on this VI, I want to move part of it. One of these parts is measurement acquisition and archiving. The button allows me to launch archiving via a structe event combined with a machine state.

 

This project is implemented in a cRIO.

 

Before writing all the code, I tested it without using the cRIO by making two vi (topLevel and subVI). The program worked perfectly on my computer.

I then naturally copied the code to my project with the cRIO and it no longer worked. 😑

 

I get the following error when I run the project on cRIO:

 

erreur 1043 dynamic event.png

 

Below the code inside the topLevel (HMI) :

 

erreur 1043 dynamic event - topLevel code.png

 

 

 

 

 

 

 

 

 

Below the code inside the subVI (archiving) :

 

erreur 1043 dynamic event - subVI code.png

The error appears at the output of the "Reg Event" property node.

 

To begin with, my question is as follows: Why does the code work on my PC but crash with the cRIO? Is it a compability problem? ...

 

For information, I use LabView 2019 SP1.

 

Thank you in advance for your time and your help !

 

0 Kudos
Message 1 of 4
(567 Views)

cRIOs, I believe, run a Real-Time Operating System, such as PharLap or NI Real-Time Linux.  These operating systems run VIs without support for User Interfaces -- the Front Panel of a VI is just for the purpose of passing arguments in and out of the VI.  Accordingly, there is no implementation of an Event Structure on a cRIO.  

 

Do you have a Host program running on a PC connected to the cRIO?  You can implement an Event Loop on the PC, and then pass the information into the cRIO using something like Network Streams (the cRIO would need to run a timed loop continually checking for a "Value Changed" property coming in on the designated Network Stream).

 

Bob Schor

0 Kudos
Message 2 of 4
(540 Views)

Hi Martin,

 

Unless your RT target has Embedded UI functionality, you cannot handle UI events in your event structures (User events are still usable though).

More infos on event structures with RT targets: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000004AV2SAM&l=en-US

 

If your target cannot have a UI, there is no way you can click on the button! You could argue that when you deploy the code from the project, you have access to the front panels of the VIs on the RT target. However, this is only a debug tool. With a proper RT exectuable, all front panels are removed from the VIs.

 

Regards,

Raphaël.

0 Kudos
Message 3 of 4
(534 Views)

Hello everyone,

 

Thank you very much for your answers.

 

In conclusion, the cRIO I own is not a compatible model for using UI events.

 

So I tried to make the same program with User Events, but that made it far too complicated.

 

So I went back to a simple solution: just have a topLevel with a while loop and a selec case with True or False to launch the code... Archaic but functional!

 

In any case, using User Events is quite possible, but it's necessary to have at least one loop that scans the VI buttons (yes, I won't make a proper RT executable without panel 😋).

 

Thank you very much!

0 Kudos
Message 4 of 4
(462 Views)