eaolson Posted January 23, 2007 Report Share Posted January 23, 2007 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 Quote Link to comment
Chris Davis Posted January 23, 2007 Report Share Posted January 23, 2007 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. Quote Link to comment
eaolson Posted January 23, 2007 Author Report Share Posted January 23, 2007 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. Quote Link to comment
crelf Posted January 23, 2007 Report Share Posted January 23, 2007 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? Quote Link to comment
eaolson Posted January 23, 2007 Author Report Share Posted January 23, 2007 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.