LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using mouse to operate controls while not looking.

We are using LabView to control an electron gun power supply. We need to view the spot on a phosphor screen while operating the controls. It is very difficult to keep the mouse on the up/down arrows, when not looking at the front panel. It would be nice if we didn't need to point the mouse at anything in particular, rather could move it right/left or up/down. Ideally, we'd click on the parameter to be controlled, then have it start at the current value with mouse movements changing the value about that starting point.
0 Kudos
Message 1 of 31
(3,591 Views)
> We are using LabView to control an electron gun power supply. We need
> to view the spot on a phosphor screen while operating the controls. It
> is very difficult to keep the mouse on the up/down arrows, when not
> looking at the front panel. It would be nice if we didn't need to
> point the mouse at anything in particular, rather could move it
> right/left or up/down. Ideally, we'd click on the parameter to be
> controlled, then have it start at the current value with mouse
> movements changing the value about that starting point.

This is a bit different from what you are asking, but if you just want
to do it for a few parameters, you could arrange for them to be sliders
instead, or for a dialog with a big slider to popup up. That way you
are really
tracking a slider, not a numeric. If you need it, you can
also combine several numerics into a 2D slider using the picture
control, with either a joy stick or track ball reaction.

Greg McKaskle
0 Kudos
Message 2 of 31
(3,587 Views)
Also, If by some reason you don't want to use sliders as proposed by Greg McKaskle2, other - a bit more sofisticated - solutions are possible. If your LV version is 6.1 or higher you can use event structure to track mouse movements and button state modifiers in your application window. Or, whithout the use of event structure, you can overlay your application window with a transparent picture control and supervise mouse movements/modifiers by getting its mouse properties value.
0 Kudos
Message 3 of 31
(3,587 Views)
This sounds interesting but I have LabView 6.0. I'm not sure how to do the overlay you suggest; some studying required, I guess. Thanks, Peg
0 Kudos
Message 4 of 31
(3,587 Views)
Sliders was the direction I was leaning toward but I still have problems with the voltages jumping to a new value when I first click on the slider if I'm not real careful with the mouse position. I'm aiming for that feel you get turning a pot to fine tune something. Thanks for your help. Peg
0 Kudos
Message 5 of 31
(3,587 Views)
Using overlayed image you do not need LV6.1, as far as I know 6.0 is suffisant. But there is an issue you must pay attention to (in case there is already lack of space on the front panel of your vi): In order to receive mouse position you must place image control above any indicators you have or simply on the first-plan. You can make it transparent, so all indicators will be visible - but they will not be "clickable". So it's not a solution for controls - they must be all placed aside of image control. Here a little example of what I mean.
0 Kudos
Message 6 of 31
(3,587 Views)
> Sliders was the direction I was leaning toward but I still have
> problems with the voltages jumping to a new value when I first click
> on the slider if I'm not real careful with the mouse position. I'm
> aiming for that feel you get turning a pot to fine tune something.

Interesting. If you are going with a screen control and mouse, you can
take the slider into the control editor, grow the thumb horizontally,
shrink it vertically, and then shrink the housing, the background behind
the thumb. This tinkering will make it harder for the slide to jump
around when initially clicked on. You will need to hit the thumb, but
that should have very little bump.

Another approach is to use a real pot or HW knob. A couple years ago I
was play
ing with iMovie and purchased a USB knob. By setting the
increment, min and max for a numeric, and configuring the knob to
produce up and down arrow keys, you can tab to the appropriate numeric,
then turn the knob. It is easy to set the knob to set the rate of the
keys sent, so you can also use the spring loaded lower ring to do a
constant velocity increment, turn the ring farther, and increment
faster, release and stop.

These knobs are not very expensive and can be found on the web. Mine
was from a company called Contour, not sure what their name is now.

A similar approach would be to use a USB joystick. There are some
joystick VIs on devzone I think.

Greg McKaskle
0 Kudos
Message 7 of 31
(3,587 Views)
Peg wrote in news:50650000000500000059000100-
1042324653000@exchange.ni.com:

> This sounds interesting but I have LabView 6.0. I'm not sure how to do
> the overlay you suggest; some studying required, I guess. Thanks, Peg
>

To check the mouse position for older versions of labview:

Windows API Utilities (lvwutil32.zip)

<>f0e41f46862568d5006e4b67?OpenDocument>

--
Rolf
0 Kudos
Message 8 of 31
(3,430 Views)
BTW, I think some joystick related vi's (for windows platform) can be founded here
0 Kudos
Message 9 of 31
(3,587 Views)
Have a look at the picture control. It return the mouse co-ordinates when
the mouse is over it. One way to solve your problem would be to have a row
of buttons in the center of your window to select your mouse function, then
a large picture behind the buttons. When the user presses a button, hide
all the buttons and get the mouse position, then use the relative position
of the mouse to control the electron gun. When the user has finished
controlling the gun they can press escape, which would be attached to a
button that makes the control buttons visible. Hope that that wasn't too
confusing, will make you a demo if you send me an email address.
0 Kudos
Message 10 of 31
(3,430 Views)