LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

front panel controls stop responding

My VI generates a 20Hz trigger, has a one time interrupt (HWFault) that will cause an immediate trigger, and then resumes generating the 20Hz "wave".  After clicking on the HWFault button twice, the front panel controls stop responding.  Why do they stop responding?

 

 

Thanks!

Download All
0 Kudos
Message 1 of 7
(3,167 Views)

You have an event structure trapped inside an one-way sequence, meaning once the code is out of the first while loop, the event structure will never be able to fire again. Still, your value change event is set to "lock the front panel until the event completes". If the button is pressed a second time, the event can never complete, and your panel is locked forever.

 

I don't understand your code. Seem overly convoluted. Get rid of the sequence structure and use a single state machine architecture. All you do is twiddle a boolean with state dependent timing! Why such a code worm???

 

 

0 Kudos
Message 2 of 7
(3,166 Views)

Thanks for your feedback.  I'll look into it.

 

 

0 Kudos
Message 3 of 7
(3,161 Views)

Is this more like what you're talking about? 

Download All
0 Kudos
Message 4 of 7
(3,154 Views)

You you still are not able to return to the event structure. What is the difference between the "before fault" and "after fault" toggling? Aren't they functionally the same? Why not return to the first state?

I also doubt that setting a global variable high for 2 seconds will do you much good. What is the chance that something else will read it during that short time? Your code needs to be much more predictable.

 

Here's a simple draft (LV 2012). (I replaced your globals with LEDs)

0 Kudos
Message 5 of 7
(3,148 Views)

Many thanks!

 

The before and after are functionally the same except I don't want it to watch for another HWFault after one has happened. 

 

This code is going (along with other stuff) into a cRIO (9082) real-time controller.  I would hope it could do a lot of things in 2 ms, but point taken and I'll look in to it.

 

Thanks again for all your help!

0 Kudos
Message 6 of 7
(3,136 Views)

Well, if these are actually real hardware io, and not just global variable writes, you should be OK if you do it all locally on the FPGA.

0 Kudos
Message 7 of 7
(3,095 Views)