LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a problem of period stability with an asynchronous timer

I work with a CAN board and I try to send frames on the CAN bus each 10 ms for the first one and 40 ms for the second one.
But I have some problems. I use NewAsyncTimer and when I choose a period of 1s, the real period is not 1s but in a range of 0 to 7s???
In add, if I choose a period under 1s, the CPU load is up to 100%, so I'm far to obtain a period of the 10 ms expected.
If you have any idea, thanks for your help.
0 Kudos
Message 1 of 4
(3,220 Views)
You mean if you select 1second interval, you see intervals between 1 to 7
seconds?

I am using AsyncTimers and have't had any problems so far. I have used time
intervals of 100msec. and lower.

What OS you are using?

vishi


"lilian" wrote in message
news:506500000008000000B8900000-1042324653000@exchange.ni.com...
> I work with a CAN board and I try to send frames on the CAN bus each
> 10 ms for the first one and 40 ms for the second one.
> But I have some problems. I use NewAsyncTimer and when I choose a
> period of 1s, the real period is not 1s but in a range of 0 to 7s???
> In add, if I choose a period under 1s, the CPU load is up to 100%, so
> I'm far to obtain a period of the 10 ms expected.
> If you have any idea, thanks for your help.
0 Kudos
Message 2 of 4
(3,220 Views)
I had no synchronous problem with an asynchronous timer at 1s, even down to 20ms. But below that it could be a problem to synchronize it. That has been stated in the manual and help file. The timer uses Windows Multimedia Thread. Is there any possibility that your CAN board used that thread too? I was using Windows ME with PIII 500MHz.
0 Kudos
Message 3 of 4
(3,220 Views)

Try adding

 

ProcessSystemEvents();

 

inside your thread function. It should help with the CPU usage  Smiley Wink

0 Kudos
Message 4 of 4
(2,854 Views)