LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count time between 2 readings from serial port... help!.

Hi guys,
 
I am using my application to get the readings sent by microcontroller from serial port. It works perfectly. But i have the problem, the pic uses 16bits counter, and sometimes i measure frequency lower than 15hz (65535-->16bits). Thats why I thought to measure the time between each pulse that it recieved in serial port. So i could multiply the reading about the time which spend in arrive to serial port. I know if any pulse spend more than 15hz, i should add 65535 to this reading.
 
Then, the idea is count the time spent between each reading in serial port. SInce pics count and later send each turn.
I dont know if it is possible, and exist any easy way.. Can ayone help me?.
I would like to see any example of it, always it is possible.
Regards, Fonsi.
0 Kudos
Message 1 of 4
(2,811 Views)

Hi!,

Any advise please?. I would need precison 1us.

Regards, Fonsi.

0 Kudos
Message 2 of 4
(2,783 Views)
You're not going to be able to get even close to 1 usec resolution using the built-in time functions though I don't see any of those in your attachment. The windows clock is simply not that accurate. If you need to precisely time your serial reads you might want to look at using the timed loop. You can set the period of that to 1 msec.
Message 3 of 4
(2,766 Views)
Hi Dennis,
 
Thanks for your entry. I saw, i need presicion of 1us. So i will try change the pic program to adjust the pullovers in another byte.
Thank you Dennis.
 
0 Kudos
Message 4 of 4
(2,737 Views)