From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure Problem

Hi everybody

 I want when "LED1" was "True" , "LED2" be "True", but "LED2" wasn't "True" .

Could you please tell me why my program doesn't work , I attached it.

Sorry my English not very good!

Thanks.

 

0 Kudos
Message 1 of 7
(2,467 Views)

Changing a control with a local variable will not trigger an event.  To do this you need to change your Local Variable to a Value (Signaling) property Node

 

Ken

0 Kudos
Message 2 of 7
(2,453 Views)

Hi Mayayi

 

A change in value of local variable will not generate an event.

 

"Events can originate from the user interface, external I/O, or other parts of the program." (From LabVIEW Help)

 

To generate events programatically you can use the Value Signalling property of the Object.

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

LED 2  will blink only when you click LED1 from the GUI provided you disable the code in the timeout case.

Since you have given timeout as 500 msec, the GUI will be polled once every half second

 

See help here

 

However if you are just looking for making LED1 and LED2 ON/OFF once every predefined time ( secs), this is not the good way

 

 

0 Kudos
Message 4 of 7
(2,446 Views)

You should also add a way to stop the loop.  Using the Abort button is not good.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(2,404 Views)

Thanks everyone :womanhappy:

0 Kudos
Message 6 of 7
(2,350 Views)

Mayayi wrote:

Could you please tell me why my program doesn't work , I attached it.


The program works just fine, just not the way you want ot to. 😄 It is not broken per se.

 


Mayayi wrote:

 I want when "LED1" was "True" , "LED2" be "True", but "LED2" wasn't "True" .



Sorry, I have no idea what that means. LED2 cannot be TRUE and FALSE at the same time, so somethings must have gotten lost in translation. Can you give us a full truth table? How should the LEDs depends on time and on each other?

 

LED1 seems to be a control, so it can be operated. However the timeout case directly interferes with its state, potentially fighting the operator. Please describe in detail how the program should behave.

 

What should happen over time if nothing is pressed. What should change if LED1 is pressed?

0 Kudos
Message 7 of 7
(2,340 Views)