LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event driven

Solved!
Go to solution

Hello,

Basically I am trying to count the number of click by the user.For that I am using an Event structure but I want that our main loop should not be halted while waiting for the event and for that an additional loop also created.But when I am click the button, count value  is not increasing and I am not able to understand why.

0 Kudos
Message 1 of 8
(2,909 Views)

Word of advice:  Save your code for an older version before you post.  Most of us can't open your VI since we haven't upgraded yet.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 8
(2,907 Views)

You can directly check for the value change event of the boolean button on whose value change you want to increment the counter. look at the code and let us know if that is what you need.

0 Kudos
Message 3 of 8
(2,902 Views)

I currently have LV 2011 installed. The copy saved in LV 2009 works fine.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 8
(2,889 Views)

Event are not triggered by indicator changes, but by user interactions. Associate your event with "clickB" instead of the LED.

 

  • For counting, you should use integers.
  • If you use switch until released, you will get two events, one for the press and one for the release.
  • Use a more reasonable mechanical action (e.g. switch when pressed).
  • The other loop should have a small wait.
  • If you don't use the timeout, you also don't need a timeout event frame.
  • You don't need any local variables for this

 

Attached is a cleanup, see if it makes sense.

0 Kudos
Message 5 of 8
(2,887 Views)

I really forget that thing(compatibility).

I am uploading the vi for earlier version.

0 Kudos
Message 6 of 8
(2,853 Views)
Solution
Accepted by topic author saurabh1989

AOE_3 wrote:

I am uploading the vi for earlier version.


Your version is still 2012.

 

My solution above is also in 2012. Did you have a chance to look at it?

0 Kudos
Message 7 of 8
(2,841 Views)

0 Kudos
Message 8 of 8
(2,820 Views)