Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

usb mouse

Solved!
Go to solution

Hi!

I really need some BIG help here! I'm trying to use my mouse as a motion detector...I've been told that's stupid but...I WANNA DO IT! I wanna take his "motion sensor" and set it by the door and...when the door opens the sensor will become "active"...I suppose u know what I mean! 

Now, I have an USB mouse but unfortunately it's some unknown mouse form China or something...can't find any info about him. 

I need the simplest exemple on how to communicate with the USB mouse...something like "0" when the mouse is inactive and "1" when there was some motion in the near vicinity of the "LED". LabView has some examples but far to complicated for me.

I would be gratefull if you could help me out!...at least a site with a tutorial for this kind of application!

Thank you! 

0 Kudos
Message 1 of 18
(5,140 Views)
As long as the mouse is recognized by windows, you can use the functions on the Connectivity>Input Device palette. With Acquire Input Device in a loop, you just have to look for a change in the axis info.
0 Kudos
Message 2 of 18
(5,139 Views)

I'm a bit new to LabView (more into OrCAD or Proteus) and I may sound a bit stupid but... what kind of loop... timed or while?... and how do I "look for a change in the axis info"! :-s

Sorry, but I NEVER EVER worked with LabView and I'm trying to get a hold of it...

0 Kudos
Message 3 of 18
(5,135 Views)
Solution
Accepted by topic author snuk

LabVIEW tutorials

 

A while loop is sufficient. After taking the tutorials, you should know what a shift register is and how to use the comparison functions (i.e. Not Equal).

 

Read Mouse Position.PNG

0 Kudos
Message 4 of 18
(5,130 Views)
THANKS A LOT!!!!! THAT HELPED ME A LOT! 🙂
0 Kudos
Message 5 of 18
(5,127 Views)

It's done...but I still have one problem...how do I make this schematic to show me (as it's running) when the mouse moved! Something like a table or...a record of the new mouse position or something like that! The modified position on the axes! :-?

Sorry I R STUPID!

Thanks for puttin' up with me! 

0 Kudos
Message 6 of 18
(5,120 Views)

It would be nice if you marked my answer as the solution instead of your thank you. You can change the markd solution by clicking on 'Options'.

 

First, you do not have a schematic. You have either a front panel or block diagram. A schematic is for electronic symbols.

 

If you want to know when it changed, then a simple way is to wire a case structure to the Boolean and place a Get Date/Time function in there. If you want to know the current position, that is being displayed in the axis info indicator. If you want to display the delta, then subtract the previous position from the present position. Just wire both clusters up to the subtract function. You could also put a write to a table of the delta information/time inside the case structure. A table is just a 2D string array so you would have to convert the cluster elements to an array with Cluster to Array and then convert to strings, Another shift register with a Build Array would handle the writing to the table.

 

Try writing something and see how far you get.

0 Kudos
Message 7 of 18
(5,116 Views)

Sorry about the solution thing...I was in a hurry to get in a meeting...

The case thing works but...it just saves the time when I pressed the START button...if I continue moving it it stands still...after I stop the process and start again it will show the new start date and timp...I just want to make it real time...to continuously modify to the moving of the mouse! If I am moving the cursor, the date and time has to continuously change!

:-?

Is that possible? :-? 

0 Kudos
Message 8 of 18
(5,106 Views)
Yes. If you had done the 'case thing' correctly, you would see that. Post what you've written.
0 Kudos
Message 9 of 18
(5,100 Views)

1.JPG

This is how mine looks like... And it just displays the moment when I press START! After that it just stands still (both the time and the axis panels)!!! I have LabView 8.0...I know it shouldn't matter but...

What did I do wrong? 

0 Kudos
Message 10 of 18
(5,097 Views)