LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the mouse/mousewheel as a "hardware" control

Hey,
Let me first situate my problem.
 
Together with another student we are doing our internship + thesis writing a program that controls several parameters of a Van De Graaf accelerator.
The current control of these parameters is done with Knobs,Belts etc. So no PLC,Labview whatsoever.
Our job is to modarnise this using some modules in a loop controlled by Labview.
 
At the moment we are using Sliders to control these parameters, but since the people that have been working/controlling the accelerator are used to knobs to control these parameters we thought it would be a nice feature if they could use the mouse and specifacly the mousewheel as a sort of "knob".
So scrolling up would mean the scrollbar goes to a higher value.
Scrolling down does the opposite.
 
My colleague has been doing most of the programming on this one and based his program on a VI he found
 
Now for both of us this is the first time coding a program of this size in Labview and adding this for 14parameters in an already "big" program seems a bit overkill.
 
I was wondering if there might be a more elegant way to implement this or if we should abandon all hope of ever realising this 😉 .
Any ideas would be grately appreciated.
 
Thanks,
Kristof.
 
 
0 Kudos
Message 1 of 3
(2,505 Views)
You have multiple options:

- Create one event case for one control test it and when it works duplicate the event case 14 times.
- Make one event case for the scroll wheel event and check which control has mouse focus.

I don't know if you can easily find the control that has mouse focus.

- Maybe track the mouse enter event for all controls in one event case and store the focussed control in a global (shift register or LV2global).
- Track the mouse movements and verify against control bounds whether it machtes with a control.

Hope it helps.

Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 3
(2,482 Views)

Thanks Andre,

We got it working now using one event struct to detect wich slider is active.

Kristof

0 Kudos
Message 3 of 3
(2,462 Views)