LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed loop

Hi all ! I have a question ...
 
I have a timed loop (which run on RT target ) . I  parameter this loop with  1Khz clock and 1 ms period. The aim of my program is to transmitt/send CAN frames. When i parameter my programm to send a frame every 10s, I receive my frames after 9993 - 9994ms ! I also tested my program with 1 Mhz clock and 1000 µs and i still have the same problem.
 
I'm almost sure it doesn't come from my program, because i tryed to use an external timing source instead of the internal clock and it works perfectly ! And it can't be beacause my subvi takes too much time, because i receive the frame 6-7ms BEFORE ! It's like the internal clock run faster that it should .... I don't really undrstand, could someone help me ???
 
Thanks... 
0 Kudos
Message 1 of 3
(2,942 Views)

Hi,

I can't believe that the use of the 1MHz clock can give this result but the timing must be always accurate using the 1KHz clock.

I don't think the timed loop itself is the problem. Are you using a timing function or tick count function in your VI or subVIs?

Are you using a PXI target? because it seems that the timed loop is not accurate only in PXI.

Investigate and let me know.

Regards.

Omar S. NI

0 Kudos
Message 2 of 3
(2,912 Views)
Hi Omar, Thanks for your answer,
 
I think i found the solution. I talked with an NI expert , that's what he tolds me : "This is because the Loop Timer uses an internal OS Clock and the CAN Frame Timestamp is generated on our CAN board using the Board clock. These two clocks have naturaly a drift of 1 ms per second runtime. " To answer your question: YES i use a PXI target and tick count function (provided by RT).
 
To archieve what i want, i created an external clock (with 6071-E board counters). I used this external clock as a timing source four my timed loop. Moreover, instead of using TickCounts function for my calculation, i use the Actual End property of the Timed Loop. It seems to work. But i will do some more test to be sure.Because i haven't made anything to synchronize my clock with the CAN board clock !
0 Kudos
Message 3 of 3
(2,901 Views)