LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Notifiers not functioning in a RT EXE

Solved!
Go to solution

Hi all, I’m having an issue using notifiers when building my code as a RTEXE on a PXI, and I have tried it on a CompactRIO device as well.

 

The code in the screen shot below demonstrates what I want to achieve. This works as expected when I run the application on the RT target from the project, but fails when I build it and run the RTEXE.

 

When I run the application the Obtain notifier creates a new notifier called SlaveState, which is an Enum with value “init”,”running” and “stop”.  The upper (master) loop is initialised to the “init” case which writes “init” to the Send notification block, then advances to “running”.  In the “running” case I write “running” to the Send notification block and the value of a boolean control (not shown in screen shot) determines whether to stay in “running” or advance to “stop”.  In the “stop” case I write “stop” to the Send notification block and write a True to both loops’ conditional terminal.

 

The lower (slave) loop uses the Get notifier Status block to determine which case to be in, and displays a string value to indicate the current case.

 

As I said this works as expected when running from the project.  However when I build this and run it in debug mode, The created new? boolean remains false, the error out from the send notification displays an error 1 and probing the notifier reference, the value is displayed as “not a refnum”.  Therefore the slave loop does not update from displaying “init” in the string indicator, i.e. is not changing case.  It looks like the notifier is not being created, but I can’t understand why this wouldn’t be the case.

 

Other things I have tried:

Using a producer consumer structure with queues, the result is the same, behaviour OK running the app, doesn’t work when built.

Not running in debug mode – the full code I am using communicates with a master over Modbus and the result is the same, so I can see that it isn’t behaviour unique to using the debug mode.

 

Could anyone help with this please?

 

Thanks,

 

Neil

Neil
Certified Labview Developer
0 Kudos
Message 1 of 5
(2,864 Views)
Solution
Accepted by topic author NEILBH

Your problem has nothing to do with the notifier. The problem is the value property node, and more specifically the error wire coming out of it that is wired into Obtain Notifier. Many property nodes do not work in an RT executable and instead return an error since there is no front panel. That error prevents Obtain Notifier from executing. Please see, and kudo, this idea: http://forums.ni.com/t5/LabVIEW-Real-Time-Idea-Exchange/Warn-about-front-panel-property-node-use-whe...

Message 2 of 5
(2,850 Views)

I don't have much experience with RT, but I'm guessing your problem comes from the Value property - my understanding was that RT apps don't support property nodes, which I'm assuming causes the property to fail and return an error, which in turn causes the obtain not to work at all. This would be easy to check if you replace the node with a local in a sequence structure.

 

In general, you probably want to be careful about how you build your RT app, as I understand it's more sensitive than Windows. LV should have some example apps.


___________________
Try to take over the world!
Message 3 of 5
(2,849 Views)

Thanks both, you are correct this did solve the issue.  It's strange that the property node does not output an error code. However,  I did find a workaround which is interesting in that I can get it to work with the property node still in the code. I put a wait in a flat sequence structure before the property node and passed a "no error" constant into the property node and this seemed to fix the problem.  Shouldn't the property node still cause the error?

Neil
Certified Labview Developer
0 Kudos
Message 4 of 5
(2,813 Views)

Does this solution work when you're not connected through remote debugging? I'm going to guess it doesn't, but if it does I'd love to know. When you connect the remote debugger, it provides a front panel, and the error occurs only when there is no front panel.

0 Kudos
Message 5 of 5
(2,788 Views)