LabVIEW E.N.A.B.L.E.D Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

3 way switch

Solved!
Go to solution

Hi,

I have created a 3 way switch using slider (Top:Increment, Middle:Idle and Down:Decrement).

Requirement: when we move the slider from idle(default) to increment position (until release the mouse) the slider should be at increment position and whenever release the mouse it should coma back to idle , same process required for decrement. 

I have made the same using Event structure and mouse release event . Some time,Its working fine and some time its getting stuck at increment/decrement position after releasing the mouse .

I am not ableto  find, why its getting stuck at increment/decrement position?

I have attached the VI. Plz find the attached vi and let me know what is the problem.

Thanks & Regards,

Srikant

0 Kudos
Message 1 of 6
(3,003 Views)

Hi Srikanth,

Instead of using Mouse Leave, try using Mouse Up . This should help you to achieve the functionality you require.

-Ravi

0 Kudos
Message 2 of 6
(2,048 Views)

Hi Ravi,

I have already tried mouse up event and also mouse leave, mouse up mouse down and mouse enter all together in one event block, but still I am getting same response .

Regards,

Srikant

0 Kudos
Message 3 of 6
(2,048 Views)
Solution
Accepted by topic author SKant

Hi Srikanth,

I think I  know why that is happening. The Mouse Up , Down , Enter and Leave are configured for the single control Pointer 2.

When you release your mouse when it is still inside the control boundaries, the event behaves propoerly, and when you move away from the pointer and release your mouse , it remains stuck at increment or decrement as the event is not registered at the control.

So in order to allow the moving of the mouse when pressed down, try using Pane - Mouse Up as well.

Also note that Pane here refers to the Pane of Front Panel. If the mouse moves out of the front panel window, you might not observe desired functionality.

See the attached Vi

-Ravi

0 Kudos
Message 4 of 6
(2,048 Views)

Hi Ravi,

Well, I think I got my solution.

Thanks Ravi

Regards,

Srikant

0 Kudos
Message 5 of 6
(2,048 Views)

Glad to help

-Ravi

0 Kudos
Message 6 of 6
(2,048 Views)