LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure not working properly Please suggest the proper solution

I want to control these 3 push button from out side of the loop.. then want to trigger the event structure.. When I am tring with local Variable it not working.... & tring with value signaliing it trigging event more than 1 times ..

0 Kudos
Message 11 of 20
(2,553 Views)

I want to control these 3 push button from out side of the loop.. then want to trigger the event structure.. When I am tring with local Variable it not working.... & tring with value signaliing it trigging event more than 1 times ..

0 Kudos
Message 12 of 20
(2,549 Views)

@altenbach wrote:

You should not trigger a signaling change when the values is true, but whenever the values is different than before.

 

It still boggles the mind why you even use events or the upper loop. All you need is a polling loop as follows (or similar). Keep it simple!

 

 

 

...and why is your front panel maximised to the screen? That so very annoying!


You should never poll for events.  the top loop is certainly "Unecessary" but a better alternative to the lower loop!  delete either and the code improves.


"Should be" isn't "Is" -Jay
0 Kudos
Message 13 of 20
(2,546 Views)

That Mouse Event VI that you're using outputs true as long as the button is down. You can change the case structures so that they only go when the value is changed. What you should do is use altenbach's code instead though, or use a single event structure for the mouse down event.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 14 of 20
(2,538 Views)

altenbach please attactch the Vi 

0 Kudos
Message 15 of 20
(2,528 Views)

@Rahul123 wrote:

@altenbach please attactch the Vi 


It's not hard to make. It will take you 5 minutes at most.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 16 of 20
(2,524 Views)

My requirement was not solved, I want to trigger Event structure from 3 boolen input that is coming from out side of while loop... 

0 Kudos
Message 17 of 20
(2,511 Views)

I still don't understand why you need the event structure. SImply expand my code into a state machine and trigger the relevant stuff depending on the mouse button status.

I am also pretty sure that your "mouse events" interfere with all other user interaction, e.g. if the user tries to click on a control.

0 Kudos
Message 18 of 20
(2,505 Views)

If you want to use events, get rid of the lower loop and use mouse-down and mouse-up events. It'll tell you the button from the event data node. Keep a shift regsiter with an array of three booleans to update according to the mouse-up/mouse-down events.

0 Kudos
Message 19 of 20
(2,499 Views)

Here is a quick draft that executes certain things based on the currently pressed mouse buttons. See if it makes sense.

 

 

 

0 Kudos
Message 20 of 20
(2,477 Views)