From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Kensington trackball mouse to control motors

Hello experts,

 

I am writing a Labview program using a Kensington expert trackball mouse to control two motors. Here is the mouse that I am using :

http://www.kensington.com/kensington/us/us/p/1444/K64325/expert-mouse%C2%AE.aspx

 

I would like to use the motion of the trackball to rotate the first motor: when I move the trackball left (or right), the motor will rotate left (or right); and the motion of the scroll ring (left/right) to control the second motor (left/ right). Besides, I would like to use the four click buttons as different ON/OFF buttons.

 

I do not want to use the trackball as a mouse, it means that I do not want the cursor of my computer moves when I move the trackball/rotate the scrolling ring!

 

So is there any solution that make only Labview "see" the trackball mouse motion, so that I can control my motors, without affecting the cursor function/position  of the computer?

 

Thank you for your help.

0 Kudos
Message 1 of 9
(3,738 Views)

Do you have the Trackball and a mouse plugged in?  In my experience, when I plug in my Kensington trackball, my PC says "OK, that's a mouse" and moving the trackball moves the cursor.  If I have two "mice" plugged in, it seems to me (if memory serves me correctly -- I haven't done this in a while) that both devices are perceived as "mice" and both move the cursor.

 

If that's the case, you may be stuck.  Windows may look at its mouse ports (or USB) and "recognize" the Trackball as a mouse, "hard-wiring" it to cursor movement.

 

You do know that you can turn the mouse cursor off, and track the "mouse" movements in LabVIEW, don't you?  I've written a routine that tests user pointing ability by lighting up a button on a touchscreen and registering where the user "touches" the screen (it shows up as a mouse click, associated with a cursor position -- I've turned the cursor off, of course).  When I run this routine, I accept the fact that while the test is running, the touchscreen is not a mouse.  Indeed, it seems to me that this is an example of a "two-mouse" routine, as I also have a conventional mouse plugged in that I use when doing other interaction with the touchscreen PC.

0 Kudos
Message 2 of 9
(3,719 Views)

I haven't done something like this myself, but like Bob said, once you plug the mouse in, Windows automatically recognizes it as a mouse. You might want to read these on how you can prevent that from happening and get the data yourself. If I understand correctly, you will need to parse and interpet all the raw data yourself:

 

http://forums.ni.com/t5/LabVIEW/Nugget-1-of-n-GEtting-started-with-USB-communication-via-VISA/m-p/74...

 

http://forums.ni.com/t5/LabVIEW/Nugget-2-of-n-USB-Control-transfers-using-VISA/m-p/757011

 

http://forums.ni.com/t5/LabVIEW/USB-Nugget-3-of-n-Unifying-the-multitude-of-USB-driver/m-p/1814964/


___________________
Try to take over the world!
Message 3 of 9
(3,708 Views)

...adding to Yiar's reply...

 

I also believe that Windows can be configured not to grab the trackball based on the USB port... But I don't know how or have done it since the days when mice ran through serial ports (it's a pain when your motion controler is attached as a mouse).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 9
(3,697 Views)

Hi speczer,

 

You can also use an event structure and capture the events of your mouse, and set tasks for each event. This can work just in case you can’t disable the mouse from windows.

 

But, if you can disable windows to see the device as a mouse but as a USB device, you might want to use VISA to talk to the instrument. Notice that what you will need to disable is Windows from detecting the device as a mouse, but you will still need to detect the device to communicate with it.

 

Another issue is the commands that you need to send or receive from the device, without the drivers it might be difficult to know what command should you send to the device, and what type of command you will receive back, and the meaning of that command. I’m not sure if you will receive something easy to read as a “up” or “down”.

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 5 of 9
(3,683 Views)

Steve,

 

The links provided by Yir earlier in this thread led to Shane's Nugget series on hacking USB devices.

 

The question remaining is how to disable Windows from grabbing the Track ball.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 9
(3,670 Views)

@Ben wrote:

 

The question remaining is how to disable Windows from grabbing the Track ball.


Like I said, Shane did talk about it there, although I haven't done this myself:

 

http://forums.ni.com/t5/LabVIEW/Nugget-1-of-n-GEtting-started-with-USB-communication-via-VISA/m-p/74...


___________________
Try to take over the world!
Message 7 of 9
(3,664 Views)

Yes I should have remebered that!

 

Kudos for "the kick in the head" I needed.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(3,662 Views)

Ben,

     The answer to the question on your Signature is "It's right next to the Asterisk".  Incidently, is the asterisk 5-pointed, 6-pointed, or whatever the type designer wants?

0 Kudos
Message 9 of 9
(3,654 Views)