09-24-2015 02:45 PM
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 ..
09-24-2015 02:48 PM
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 ..
09-24-2015 02:48 PM
@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.
09-24-2015 02:52 PM - edited 09-24-2015 02:53 PM
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> ---'
09-24-2015 03:01 PM
altenbach please attactch the Vi
09-24-2015 03:02 PM
@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> ---'
09-24-2015 03:08 PM
My requirement was not solved, I want to trigger Event structure from 3 boolen input that is coming from out side of while loop...
09-24-2015 03:11 PM - edited 09-24-2015 03:12 PM
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.
09-24-2015 03:16 PM
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.
09-24-2015 03:46 PM - edited 09-24-2015 04:11 PM
Here is a quick draft that executes certain things based on the currently pressed mouse buttons. See if it makes sense.