LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Let a LED burn on random time between 3 and 7 seconds

Solved!
Go to solution

Simon and Jeff really thanks a lot! I will studie it myself but this will help me a lot to understand more of labview! 

 

THANKS!

0 Kudos
Message 11 of 14
(733 Views)

And DON"T forget to read up on Defer Front Panel updates while you are studing Event structures!


"Should be" isn't "Is" -Jay
Message 12 of 14
(730 Views)

I have a lot of issues with Simon's code.

 

  • Cluttered with local variables
  • two event structures hidden in variuous cases of a case structure (this is really bad, because event structure should never be obstructed, but always in the dataflow).
  • Even structures need to live on the diagram of the main while loop!

Here's a quick rewrite how I would do it. No local variables, no sequences, and a single toplevel event structure doing almost everything.

It also handles the case where stop is pressed too early.

 

Modify as needed ....

Message 13 of 14
(721 Views)

Right you are Christian!  I just wanted to give the OP something that actually worked without getting to critical of a blue bar.  The OP should have good reason to read caveats on using event structures with a critical eye.


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 14
(707 Views)