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.
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.
02-10-2012 05:46 PM
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.
02-12-2012 04:44 PM
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.
02-13-2012 01:30 AM
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-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/
02-13-2012 07:23 AM
...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
02-13-2012 03:14 PM
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,
02-14-2012 07:08 AM
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
02-14-2012 07:49 AM
@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:
02-14-2012 07:58 AM
Yes I should have remebered that!
Kudos for "the kick in the head" I needed.
Ben
02-14-2012 08:31 AM
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?