LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview RT cRIO9057 timed loop behaviour

Hi everyone,
I’ve encountered a strange behavior inside a Timed Loop running on a cRIO 9057.
First of all, I’m quite new to this field, so I was wondering why—when using a 10ms periodicity—I’m seeing a delay in the execution trigger of the Timed Loop.

Specifically, in my loop I’m calling a compiled .so library using the Call Library Function Node.
The Timed Loop is configured as follows:

  • 1MHz Clock
  • Period: 125µs
  • Priority: 1000
  • Processor: 1
  • Missed periods: NOT discarded

The strange thing is that every 10ms, the Timed Loop gets triggered about 170µs after the expected time (instead of the configured 125µs), causing a spike.
The Scan Engine is disabled.

Do you have any idea why this phenomenon occurs?

rikimancio98_0-1763127069116.png

 

0 Kudos
Message 1 of 24
(324 Views)

Welcome to the LabVIEW Forums.

 

It's either "hardware" or "software" (or maybe both!).  You've told us a little about the Hardware (cRIO 9057), but almost nothing about the Software (presumably some version of LabVIEW running on some version of computer running some operating system) and executing unknown (LabVIEW?) code.

 

Why don't you provide a little more information, especially details about the software (actual VIs are best, but not everyone is running the latest version, so you might need to "Save for Previous Version" and specify LabVIEW 2019 or 2021, which seem to be available to most Forum participants).

 

Bob Schor

0 Kudos
Message 2 of 24
(305 Views)

I'm using Labview 2025 Q1 version on Windows11 PC with an Intel Core i7-14700.
The code is deployed on the CRIO system.
In the VI, inside the timed loop, I'm using a Call Library Function that calls a .so compiled library, 8 replace array subset (and their shift register for arrays) to have some array to show with waveform graphs at the end of the loop and a progress bar to show the status of acquisition.

0 Kudos
Message 3 of 24
(284 Views)

Can you explain how you're generating that waveform graph? I just want to specifically understand what you're timing.

0 Kudos
Message 4 of 24
(267 Views)

To Calculate the time from one cycle and the next I put an High Resolution Relative Second at the very first start of the VI in a shift register and then a second High Resolution Relative Second inside the loop.

I compute the difference between (and save into the array) the two and the update the shift register with the new value of time.
After a N number of cycles I stop the loop and plot arrays into graphs.

0 Kudos
Message 5 of 24
(259 Views)

take screenshot of your block diagram or better yet, attach your VI to your reply post by clicking "browse files to attach" at the bottom left of the reply window.

0 Kudos
Message 6 of 24
(233 Views)

this is my VI

0 Kudos
Message 7 of 24
(218 Views)

Well, a timed loop cannot run faster than the slowest node it it. As a first step look at the rich timing information of the loop data nodes.

 

altenbach_0-1763219895164.png

 

In your case you can't really tell how how the time executes relative to all the other content of the loop.

 

 

(Also, wouldn't it make more senses to only have very few shift registers with 2D arrays instead of all these 1D arrays?)

0 Kudos
Message 8 of 24
(208 Views)

I don't understand why the presence of many shift registers should affect computational time. I would expect higher memory usage, but not an increase in calculation time. Moreover, if that were the cause, I would expect a constant delay, not a periodic one every 10 ms. I tend to exclude the possibility that the code called via the Call Library Function Node is responsible for this periodic delay, because when I measure its execution time, I get something that at most reaches 35 µs, which is well below the 125 µs set for the timed loop. I would rather suppose that the delay is introduced by something the operating system does silently. I tried checking the interrupts triggered by core1 of the cRIO, but none of them are called every 10 ms, and even their sum doesn't explain this periodicity.

0 Kudos
Message 9 of 24
(166 Views)

This code looks extremely "inefficient" to me.  I suspect that somewhere there is a Cluster that is being built, maybe from an initial Cluster (and getting placed at the beginning of the Cluster instead of at the end).

 

It would greatly help us to help you if you would do as we have suggested and submit your VI in almost any version of LabVIEW except LabVIEW 2025, which I (and many of my colleagues on the Forum who have been using LabVIEW for >10 years) have not yet installed.  [Two frequently-suggests Versions are 2019 and 2021.]

 

I'm certain we would have "solved" this problem much earlier if you had helped us to help you.

 

Bob Schor

0 Kudos
Message 10 of 24
(154 Views)