Accuracy of PtTimer

Hello,

Currently, I am developing a qnx platform to record data from a range laser. I am using PtTimer to invoke the data recording function. I have noticed that there a few milisecons delay in the sampling time, for instance I set the PT_ARG_TIME_REPEAT to 1ms then the sampling time in file is 2-3ms instead of 1ms.

Is it the way how PtTimer works? Any suggestion on how I can improve my sampling time to as close as 1ms? Is there another way so that I can sample my data below 1ms?

Thanks in advance any advices and suggestion!

greenlife

The documentation on PtTimer should answer all your questions.

While it is possible to get the resolution you want with a PtTimer; Photon is not the easiest place to do it. It is much better to have a separate resource manager which samples, and timestamps, and then just have your Photon application read the stream of timestamped data from the resource manager.

If you are a C++ programmer and would like to use a class library to implement the resource manager you may find the library at (community.qnx.com/sf/projects/qfc) useful…

ps: the library I mentioned also has a TimerBank class that creates priority driven timers that are multiplexed onto underlying OS timers for efficiency. It supports 25K timers per process (one timer thread) multiplexed onto a maximum of 254 underlying OS timers per process.

It’s really a great help from both of you two, mario and rqallen! Thank you so much!