LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out our General Code Repository Files. Also, before posting here, check to see if your post doesn't fit into another subforum by category.


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> [CR] Serial Mouse Driver
eaolson
post Jan 23 2007, 05:37 PM
Post #1


Extremely Active
****

Member
Posts: 269
Joined: 15-September 05
Member No.: 3014
Using LabVIEW Since:1998
LV:7.1.1 ,8.0.1 ,8.20
United States us_texas us_illinois



File Name: Serial Mouse Driver
File Submitter: eaolson
File Submitted: 22 Jan 2007
File Updated: 23 Jan 2007
File Category: General

Serial Mouse Driver for LabVIEW v1.0.0
Copyright © 2007, University of Illinois at Urbana-Champaign
All rights reserved.

Author:
Eric Olson
eaolson@uiuc.edu

Distribution:
This code was downloaded from the LAVA Code Repository: http://forums.lavag.org/downloads.html

Description:
This driver is an implementation of the Microsoft two-button mouse protocol, for using a serial mouse or trackball. It polls a specified serial port at a specified rate, and reads any data waiting there. This has been tested under LabVIEW versions 7.1.1, 8.0.1, and 8.20 under Windows 2000 and Windows XP, and under LabVIEW Real-Time 7.1.1 and 8.0.1.

This driver contains components created using the dqGOOP toolkit to enable object-oriented programming.

Note: When using a serial mouse under Windows, it is important that Windows not auto-detect the existence of the mouse (e.g. upon bootup). Otherwise, the operating system will intercept the mouse input and LabVIEW will never see it.

Dependencies:
None

Support:
If you have any problems with this code or want to suggest features:
http://forums.lavag.org/CR-Serial-Mouse-Driver-t5963.html

Version history:
1.0.0:
Intial release of the code

License:
University of Illinois/NCSA Open Source License (view license.txt for complete verbiage).

Click here to download this file


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Jan 23 2007, 05:37 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Chris Davis
post Jan 23 2007, 06:06 PM
Post #2


Extremely Active
****

Premium Member
Posts: 412
Joined: 8-July 05
From: Tullahoma, Tennessee, USA
Member No.: 2547
Using LabVIEW Since:2000
LV:8.20 ,7.0 ,8.0.1
United States us_tennessee Nothing Selected


QUOTE (eaolson @ Jan 23 2007, 11:37 AM) *
Note: When using a serial mouse under Windows, it is important that Windows not auto-detect the existence of the mouse (e.g. upon bootup). Otherwise, the operating system will intercept the mouse input and LabVIEW will never see it.


Just for clarity, could you provide a simple way to do this. i.e. can you just plug in the mouse into a serial port, after the computer is booted? I haven't messed with serial mice in a long time, (can you still buy one?) so my knowledge here is limited. But an example of how to do this important stipulation of your code would be in order so people can make use of it.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
eaolson
post Jan 23 2007, 06:36 PM
Post #3


Extremely Active
****

Member
Posts: 269
Joined: 15-September 05
Member No.: 3014
Using LabVIEW Since:1998
LV:7.1.1 ,8.0.1 ,8.20
United States us_texas us_illinois


QUOTE (chrisdavis @ Jan 23 2007, 12:06 PM) *
Just for clarity, could you provide a simple way to do this. i.e. can you just plug in the mouse into a serial port, after the computer is booted? I haven't messed with serial mice in a long time, (can you still buy one?) so my knowledge here is limited. But an example of how to do this important stipulation of your code would be in order so people can make use of it.

Plugging the mouse in after the computer boots is exactly how I do it. I've always had the vague impression that hot-swapping peripherals was not such a great idea (USB being an exception), but have not had any problems doing it to date.

The reason I wrote these VIs is because I wanted some user input to a program running on a PXI system running LabVIEW Real-Time. Since there is neither mouse or USB support, this was the best solution I could come up with. There, of course, leaving the mouse/trackball attached to the COM port all the time is just fine.

Serial mice are still out there, if barebones. I picked up a $4 one for testing. Most industrial trackballs seem to have a serial version available, as well.

This is my first contribution to the CR, and pretty much the first thing I've released for "public consumpton." Comments and suggestions would be greatly welcomed.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Jan 23 2007, 06:48 PM
Post #4


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3751
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (eaolson @ Jan 24 2007, 04:36 AM) *
The reason I wrote these VIs is because I wanted some user input to a program running on a PXI system running LabVIEW Real-Time. Since there is neither mouse or USB support, this was the best solution I could come up with. There, of course, leaving the mouse/trackball attached to the COM port all the time is just fine.


That's an excellent idea - I wonder how difficult it would be to implement the same with a joystick for rough motion control?

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
eaolson
post Jan 23 2007, 09:24 PM
Post #5


Extremely Active
****

Member
Posts: 269
Joined: 15-September 05
Member No.: 3014
Using LabVIEW Since:1998
LV:7.1.1 ,8.0.1 ,8.20
United States us_texas us_illinois


QUOTE (crelf @ Jan 23 2007, 12:48 PM) *
That's an excellent idea - I wonder how difficult it would be to implement the same with a joystick for rough motion control?

I doubt it would be too difficult, but they're slightly different. If you think about moving something with a mouse, the intuitive way of thinking about it (in my opinion, your brain may vary) is that the object moves in the same direction as the mouse movement and when the mouse stops moving, the object stops moving. Speed of the object should be related to the speed of the mouse movement. For a joystick, the tilt direction controls the direction of the object's moton, and as you tilt the joystick it moves faster and faster. If you push the joystick all the way forward, the object moves and keeps moving until the joystick goes back to its center position. Basically, a mouse controls position; a joystick controls velocity.

The nice thing about the serial mouse is that the protocol is simple, well-documented, and implemented by a number of manufacturers. There's a three button one, as well. I don't think the same is true for joysticks.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Michael_Aivaliot...
post Feb 24 2007, 09:12 AM
Post #6


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2367
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


QUOTE (eaolson @ Jan 23 2007, 10:36 AM) *
This is my first contribution to the CR, and pretty much the first thing I've released for "public consumpton."
Thank You for your submission

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 2nd December 2008 - 04:41 AM