Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize mouse capture rate

Hi,

 

I have written a programme to capture movements of the mouse (I will actually be using a touch screen). I have used Initialize Mouse in a while loop. I want to then analyse the movements in terms of speed acceleration etc. To do this I need to know  the capture rate of Initialize Mouse. I can't find this information anywhere, and there seems to be no way to control it. I did write a short programme, capturing over a 1 sec period but the capture rate seemed ridiculosly high, can anyone help me with this. 

 

Many thanks

0 Kudos
Message 1 of 9
(4,755 Views)

Hi Kmut,

 

Good afternoon and I hope your well today.

 

Thanks for your post.

 

I have attached some code that allows you to acquire data from the mouse and a rate you choose - down to a few ms on a windows machine.  I used the acquire input data.vi to acquire the axis info and button info from the mouse. Then using a queue you can do post-anylsis on the data without affecting your acquisation rate. This design is known as a producer.consumer design pattern.

 

In the consumer (anylsis) loop I have created a circular buffer to store the last 10 samples in this case. With this area of axis info you can perform some maths functions to work out what you wish.

 

I have attached the example in LabVIEW 8.6 - please let me know if your using a different version.

 

I hope this helps, and I'd be more than happy to discuss your application furhter - just post back! 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 9
(4,735 Views)

Hi Kmut,

 

I also just wanted to check that your doing this on windows, the acquire data.vi and input vi you mentioned both are only support on windows. I am not sure what Real Time targets have a mouse input.. but please to clarify this for me if this is the case.

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 3 of 9
(4,733 Views)

Hi Hillman,

 

Thanks for your help, unfortunately I am using LabVIEW 7.1 so couldn't open your attachment. Yes I am using windows to run this and I am capturing touch screen data.

 

Kind regards

 

Kmut

0 Kudos
Message 4 of 9
(4,711 Views)

Hi Kmut,

 

Thanks for getting back to me. Sorry, I must have missed what version you were using.

 

Attached is a copy of the VI in LabVIEW 7.1.

 

Note: LabVIEW 8.6 VI was saved to labVIEW 8.0. Opened in labVIEW 8.0 and saved back to LabVIEW 7.1 - for anybodys reference. 

 

Please let me know how the example finds you,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 5 of 9
(4,705 Views)

Hillman,

 

The program was very helpful, I can see were I was going wrong now. Thank-you so much for all your help!

 

Kmut

0 Kudos
Message 6 of 9
(4,686 Views)

Hi kmut,

 

Thanks for the reply and I hope your well today.

 

Not a problem! Thanks for the question and I am glad its all working well for you. 

 

Remember, the forum is a great resource - so please do post a new thread if you have anything you wish to discuss in the future.

 

Best wishes with your applications,

Kind Regards,
James.

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 7 of 9
(4,683 Views)

Hello, this is actually a different problem, but it has to do with Initialize Mouse.vi

We are using both Labview 7.1 and 8.6.1. We use Labview 7.1 where we need to keep the runtime library as small as possible.

This is under Windows with an app built using the application builder.  If a Microschip PICKit is plugged into a USB port, initialize mouse.vi crashes inside the vi, and brings up an application error, and the application closes.

 

Has anyone else had this problem. We have not been able to find a work around. Any help would be great.

 

Under labview 8.6.1 we don't see the problem.

 

Thanks - Bart

0 Kudos
Message 8 of 9
(3,744 Views)

Hi BartSchroder,

 

I hope you are well and thank you for using the NI Forums! The post you have created is on a topic which has been inactive for quite a while. You may receive more success by creating a new forum post in a new thread summarising all the issues you are having.

 

Kind regards,

Ashish Naik
Automotive Business Development Manager
National Instruments UK
0 Kudos
Message 9 of 9
(3,729 Views)