473,473 Members | 2,226 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

long-run repeatly timer?

I asked this question on comp.python.wxpython using the subject "a
wx.Timer like timer without wx package?" and David Fraser there
suggested me to ask here for a more general solution.

I am implementing a long-run sample-and-record system. It collects data
from a PCI card every 10 seconds, saves the data (timestamped with the
current system time) in the hard disk, and shows them on the screen.
There is also a GPS receiver module exists on the system, which correct
the system time (and the hardware time) when it drifts away too much,
however, I can not access the source code of this module.

The system requires the average sample rate is 6 times per minute to
analysis. If the OS clock runs too fast or too slow, we can get the
infomation by the GPS module's log file, and then correct the analysised
result with that infomation.

So, wo need the counter (a repeatly timer for collecting data) to meet
these requirements:

1. fires 6 times per minute, or to say, fires 60*24*360 times per 60 days.
2. will not be affected by the change of system time, foreward or backward.
3. no need for external hardware device, of cource.
4. not depend on any GUI package for it's a console based app.
5. works on a Windows mechine, cross-platform solution is better.

How can I implement such a timer? Thanks in advance.

Jul 18 '05 #1
1 1615
Qiangning Hong wrote:
I am implementing a long-run sample-and-record system. It collects
data from a PCI card every 10 seconds, saves the data (timestamped
with the current system time) in the hard disk, and shows them on the
screen. There is also a GPS receiver module exists on the system,
which correct the system time (and the hardware time) when it drifts
away too much, however, I can not access the source code of this module.

I think that, in order to do this, you may need to discover when the
system time has been adjusted and explicitly correct for that. Given
that system time is the only real source of timing information that you
have (because any other sources are going to be derived from that),
you're going to have a hard time doing anything that's more accurate
than your (possibly self-corrected) system time.

Is there a way to get the GPS module to inform other programs when it
adjusts time? Is there a maximum/minimum time delta that it will
apply? Does it only correct the system time at specific intervals?

Actually, if you can write a C extension (or if there's a preexisting
Windows API call that you can use through ctypes), you might be able to
hook into the hardware clock-tick interrupt and count ticks yourself,
deriving your own time with a little bit of math. You'd probably need
to sync periodically with the system clock, anyhow, to make sure that
your tick count isn't drifting, but it would give you independence from
the sudden discontinuities in the system time from being reset by the
GPS module.

Jeff Shannon
Technician/Programmer
Credit International

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tim Clacy | last post by:
How is a 64 bit type defined in strict C++? It seems C has support for 'long long' since C99, but not so for C++? Looking through one compiler vendor's standard library headers has clouded the...
7
by: William Payne | last post by:
Hello, I have a variable of type unsigned long. It has a number of bits set (with set I mean they equal one). I need to determine those bits and their position and create new numbers from them. For...
29
by: Richard A. Huebner | last post by:
Is the unsigned long long primitive data type supported in ANSI standard C? I've tried using it a couple of times in standard C, but to no avail. I'm using both MS VIsual C++ 6, as well as the...
4
by: Lingyun Yang | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Dear all, I have a file it's binary data viewed in UltraEdit is EF BB BF 0D 0A 3C ....... I want to read them into a int or long...
9
by: luke | last post by:
Hi everybody, please, can someone explain me this behaviour. I have the following piece of code: long long ll; unsigned int i = 2; ll = -1 * i; printf("%lld\n", ll);
21
by: Charles Sullivan | last post by:
I maintain/enhance some inherited FOSS software in C which has compiler options for quite a few different Unix-like operating systems, many of which I've never even heard of. It would be...
12
by: Ahmad Jalil Qarshi | last post by:
Hi, I have an integer value which is very long like 9987967441778573855. Now I want to convert it into equivalent Hex value. The result must be 8A9C63784361021F I have used...
2
by: PengYu.UT | last post by:
Hi, In python, triple quote (""") can be used to quote a paragraph (multiple lines). I'm wondering if there is any equivalent in C++. For the following code, I could write the long string in a...
10
by: ratcharit | last post by:
Currently using cosine function in math.h Currently I get: 1 = cos(1e^-7) Is there another way for cos to return value of high accuracy say: 0.999999 = cos(1e^-7)
15
by: Oliver Graeser | last post by:
I need a >49 bit integer type. tried sizeof(long long), says 8. 8 byte = 64 bit right? but when I try to assign a value with more than 32 bit, it fails. To illustrate: for (i=0; i<64; i++){...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.