LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with timed loops and digital output

Highlighted

Hello,

 

We are getting started with compactRIO and labview, and are a bit confused in regards to timed loops with digital output.

 

We've reduced it to something simple (or so we thought) and are attempting to run this in the compactRIO:

 

squarewave.png

The idea is to generate a square wave. This works fine with a period of '10', but with a period of '9' it seems to skip iterations. Here is the output on DIO0 on a scope:

tek0000.png

As I understand, setting the period to '9' would mean the loop iterates every 9/1000 second (given the 1khz time source), giving a period to the waveform of 18/1000 second. However, the period of the waveform seems to never go below 200ms. In addition, once every 4 high peeks is prolonged with exactly one half-period.

Can someone enlighten us? We are probably making some very elementary mistake, but we've been unable to figure it out.

Thanks!

0 Kudos
Message 1 of 6
(2,437 Views)
Highlighted

Hey, 

 

So just to confirm, everything works fine at 10ms period, but once you reduce it to 9ms you get the problem? 

What is the hardware that you are using? 

0 Kudos
Message 2 of 6
(2,392 Views)
Highlighted

@AAlZibdeh wrote:

So just to confirm, everything works fine at 10ms period, but once you reduce it to 9ms you get the problem? 

What is the hardware that you are using? 


Not quite. With 10ms period, we see a square wave as expected but with 200ms period, not 20ms. With 9ms period, we get the scope screenshot posted above.


Our hardware is the NI cRIO-9035 chassis, the output module is the NI-9401 (the scope measurement was done with a 10x probe).

 

0 Kudos
Message 3 of 6
(2,383 Views)
Highlighted

.  

 

0 Kudos
Message 4 of 6
(2,377 Views)
Highlighted

It's interesting that you're seeing that despite both the cRIO and the DO is supposed to be able to have a much faster speed. 

 

Could you try and benchmark the speed of the Timed Loop? You can use the Iteration Duration terminal of the loop. This way we could see what is causing the problem, whether it is your device or a software related issue.   

 

0 Kudos
Message 5 of 6
(2,376 Views)
Highlighted

Hi,

 

We'll have a look at the loop duration terminal. What I did myself earlier while debugging this issue, was to connect an indicator to the 'Finished Late' terminal to see if that triggered. I wired that in such a way that the indicator would light up whenever the 'Finished Late' terminal would become true, and stay lit up ever after.

 

Result: indicator never lit up, even when seeing the problem.

 

Thanks,

 

Koen

0 Kudos
Message 6 of 6
(2,323 Views)