LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI Timer() is 6x too slow

Probably a hardware problem, but I'd be interested in anyone's take on this problem...

 

We have a PC which appears to run at its normal speed. But, intermittently, when we run CVI code that uses the CVI Timer() function in a loop construct to wait for a specified delay period the delay takes about 6x what it should.

 

This code is well used and functions correctly on other Test Stations, and works intermittently on the 'problem' test station.

When the PC is in its failing state I notice that the 'My Computer' properties General Tab shows the CPU ID and CPU clock (read from the processor?) correctly as Intel Pentium 3.00GHz, but shows the actual CPU clock as 18.34GHz.

 

Unfortunately the PC in question is 8000 miles away, and while we can get the operators to push keys, they have no skills to pursue this much further.

 

 

Note. I have also been told that the on the PC in question the Test Stand  'Wait' instruction also takes 6x longer to execute.

 

 

Ideas welcome! 

0 Kudos
Message 1 of 10
(5,542 Views)

I never observed such a situation in our applications so I cannot give you specific ideas on how to address your problem. Useful elements could be the frequency with which you observe this phenomenon, the time the program was live when it happens and how much time you need to wait in your loop (seconds? tenths of seconds? more? less?). From what you are relating I would expect that the loop runs six times faster when the incorrect clock frequency is detected, but I really don't know how this frequency is calculated by the OS, so...

 

Anyway, you could consider moving from Timer () function to other timing related functions like Sleep () or performance counter (both are Windows API calls and need the full SDK installed in developing system).

With reference to the performance counter you can look at this discussion.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 10
(5,530 Views)

Thanks Roberto,

 

Obviously the CPU isn't running at 18.34GHz (I'm sure Intel would be most interested if that were the case...).

 

I guess that one of the motherboard clocks is intermittently running at about 1/6 the normal speed, maybe the My Properties 'actual clock' value is determined by counting the the number of processor clock ticks between [faulty] clock ticks??

 

Unfortunately we don't have the option to change the code because...

(1) It is 'released' software, we cannot change it.

(2) The Test Stand 'Wait' function on the same PC also gives the same problem

 

The Delays in question are in the order of 30s to 2m.

0 Kudos
Message 3 of 10
(5,522 Views)

Perhaps power settings on the PC throttle back the CPU frequency. Dig into the Power Settings in the control panel and make sure you are on a high performance setting.

 

--Ian

0 Kudos
Message 4 of 10
(5,500 Views)

Thanks Ian, We had thought of that, but it seems unlikey that the CPU is overheating as the Test Station (including PC) can run fine for days on end, but can fail when switched on from cold, so I don't think this is a CPU overheat problem. We checked the 'BIOS PC health' page and all voltages, CPU speed, and CPU fan speed look fine (of course though, we don't know if this is with the PC in the failed state!!!).

 

I suppose this problem could be caused by the CPU fan intermittently failing and causing the CPU to throttle-down, but the PC (industrial 'Kontron') is buried in the Test Station cabinet and there are only 'button-pushers' available to help us at the site that the Test Station is housed.

 

Alan

0 Kudos
Message 5 of 10
(5,487 Views)

This is a bit of a shot in the dark, but I think it's worth mentioning.  Is the machine an HP with the CPU SpeedStep feature?  This seems to have been reported and fixed on an external forum.  Initial report here (post #327) and resolved with a Microsoft patch here (#351).  Let us know if this is helpful.

 

NickB

National Instruments 

0 Kudos
Message 6 of 10
(5,449 Views)

Well, on a trip to our customer in Utah I checked out this Test Station. The unit had been moved between work areas several times before I arrived.

 

I power cycled the PC many times over the course of 2 days and was unable to reproduce the problem.

On removing the PC unit (industrial Kontron 600)  from the 19" rack and removing the cover I discovered a loose screw on the motherboard, near the processor fan.

 

I can only assume that the screw had previously been jammed in the processor fan and had prevented the fan from rotating freeling - causing the processor to overheat (and so throttle-down)

 

 

Thanks for all the suggestions

Alan

0 Kudos
Message 7 of 10
(5,122 Views)

Well, over a year on and we've had reports that the PC in question continues to exhibit the same 'slow' problem.

 

I'm making the 16,000 round trip to Utah on Thurday to address some other issues. Ideally I'd like to take a look at this problem while I'm visiting.

 

Any ideas on what might cause this PC to intermittently operate slowly, and show the incorrect clock speed in Windows XP 'System Properties' ?

 

Thanks!

Alan

0 Kudos
Message 8 of 10
(4,439 Views)

Alan,

 

When I suggested the power settings, I was not thinking of over-heating. I recall my older Dell laptop reported a different CPU frequency simply when it was on a battery-saver setting for power management.  Now, I would expect that normally that would not mess up time-keeping, but I'm not a hardware guy at all, and if you have something based on the actual CPU frequency it might be an issue.

 

However, 6x slower sounds like pretty dramatic power-saving.  Have you considered that the reported CPU frequency is a red herring? Maybe it is managing power settings, and everything is just fine, and you have a software issue, or a different hardware issue?

 

Good luck!

 

Ian

0 Kudos
Message 9 of 10
(4,432 Views)

Ian,

 

Thanks for you ideas.  I'll investigate this.  I would think that if this problem is caused by the power settings then the effect would not be intermittent.

 

Alan

 

 

0 Kudos
Message 10 of 10
(4,424 Views)