08-17-2009 04:38 PM
Hello,
I am writing an application in LabWindows/CVI 8.5.1 (356). I wrote the program in Windows XP Pro 32-bit, and it worked fine. When I created a release executable and ran it on a 32-bit Windows 2000 machine (with the correct runtime engine) it did not work correctly.
The problem seems to be with Timer(). I have a control that indicates the elapsed time after a certain action, but it incorrectly displays extremely large numbers instead of a few seconds. It uses Timer() to determine this elapsed time. The intended sequence (which is supposed to run based on Timer()) terminates abruptly, but does not glitch the program beyond that.
I don't know what to try at this point. Any ideas?
Thanks,
Jeff
08-18-2009 07:54 AM
You might try editting the Windows boot.ini file and adding the /usepmtimer switch. I've had to do that sometimes when things like the Timer() and Delay() functions add strangely. I've never seen it in Windows 2000 but I suppose it may happen if the hardware is newer than a typical Windows 2000 machine. Here's some more information:
http://support.microsoft.com/kb/895980
08-18-2009 09:19 AM
I just tried it, and it did not change the situation, unfortunately. It still displays extremely large numbers. The "Elapsed Time" control I can see counts up to around 1 second, and then instantly turns into a number around 2^32.
Basically, it's subtracting the current time in the sequence from the start time to find the elapsed time. Could it be a double-precision limit problem?
System specs:
AMD Athlon 64 X2 5600+
3.48GB
08-18-2009 12:33 PM
I sort of fixed the problem. Although the usepmtimer fix did not work, I found a solution. It seems like the issue is local to Windows 2000 and possibly the hardware on this computer.
Since Timer() and SyncWait() were returning incorrect values, I reimplemented them using the ANSI C function clock() and just dividing by CLOCKS_PER_SEC as another option for timing. This mode of timing worked on the target PC.
08-18-2009 02:32 PM
Jeff,
This KnowledgeBase article describes your problem, and as you are using an AMD x64 system, it seems to apply to your system: http://digital.ni.com/public.nsf/allkb/8482E9527AAECB8A8625711400550B0D?OpenDocument . The document states to try the usepmtimer fix mentioned before, but you could also try updating your BIOS if you are interested in getting the Timer functions working, though it looks like you are able to use the clock() function just fine.