LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code not running once it's in a project

Solved!
Go to solution

Hi everyone.

I am new to using Labview and have encountered a problem that I do not understand the nature of, I hope you can help me.
I have created a state machine to allow me to restart the code inside the VI after pausing it.
The code runs correctly and does its job if I run it as a simple VI; however once I implement it into a cRIO 9045 project, the event structure does not trigger on command.
What could be the problem?
I hope I have explained myself with the correct terminology.
I attach the simple VI

 

0 Kudos
Message 1 of 4
(903 Views)
Solution
Accepted by topic author SpaceCowboy90

Hi Cowboy,

 


@SpaceCowboy90 wrote:

I have created a state machine to allow me to restart the code inside the VI after pausing it.
The code runs correctly and does its job if I run it as a simple VI; however once I implement it into a cRIO 9045 project, the event structure does not trigger on command.
What could be the problem?


Two reasons:

  1. Don't use "default if unwired" tunnels like you do in your statemachine: always provide meaningful outputs for each case/state!
  2. Main reason: RIO devices (usually) don't support user interfaces as they don't support to attach displays/monitors! Because of this they also don't support the event structure as good as a usual Windows target: when there is no user interface then there is no way to detect any value change events of buttons on your frontpanel!

Suggestion:

Examine all those example projects coming with LabVIEW and RT module: they explain how to exchange data and commands between a PC host and a cRIO target…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(900 Views)
Solution
Accepted by topic author SpaceCowboy90

Read the extended help for the event structure on an RT target:

 

Real-Time Module Details

The following details apply when you use this object in an RT target VI.

Event structures on RT targets do not support events associated with user interface objects, such as VI front panels or controls. For example, associating the Value Change event with a control does not work. RT targets support only user events.

 

Regards, Jens

Kudos are welcome...
Message 3 of 4
(898 Views)

Thank you for your quick and comprehensive response.
I have a long way to go to learn how to use labview.

0 Kudos
Message 4 of 4
(860 Views)