LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control a Latch when pressed button by event

The questions is, 
 there are two parallel while loops. In the 1st loop, there is a "Latch when pressed button" to control  and start a calculation running.  Sometimes I want to trigger "Latch when pressed button"  by the event in the 2nd loop. Since the local variable cannot be used for a "Latch when pressed button" , how can I trigger a "Latch when pressed button"  in other loop?
 
Thanks.
0 Kudos
Message 1 of 6
(4,790 Views)

Hi weitong.

You can do this with Event Driven Programming. How to do this? Look at the LabVIEW Help, search for "User Events", on this page search for "NewVal". This paragraph tells you how to setup an Event Structure to handle both, the Value Change of a boolean latch   *and*   your user event, that you can fire from your 2nd loop.

Hope this helps, Guenter

 

0 Kudos
Message 2 of 6
(4,783 Views)
I think you can try out using the boolean's Switch Until Released mechanical action instead of the Latch when Pressed action.
 
This l allow you to use locals for that variable in the parallel while loop inside the Event Structure to fire its event on some conditions.
 
Hope it helps.
 
Please update here your results after testing this change.
- Partha ( CLD until Oct 2027 🙂 )
Message 3 of 6
(4,736 Views)
Hi, parthabe
      Thanks.
      But, this doesn't work with my program. I am using the latch when pressed button to trigger measurement once when clicked the button. If using the switch when released button, the measurement will be done repeatedly without another click activity. So the latch when pressed button is needed in my program for one trigger when user clicked once.
 
weitong   
0 Kudos
Message 4 of 6
(4,691 Views)

Hi, Guenter

I cannot find the paragraph. Could you please show me details.? Thanks.

Message Edited by weitong on 06-04-2007 01:44 AM

0 Kudos
Message 5 of 6
(4,687 Views)

Hi weitong.

Attached is a screenshot of the LabVIEW Help. I hope this makes things clear?

Regards, Guenter

 

0 Kudos
Message 6 of 6
(4,665 Views)