LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA execution time

Hi,

We are working in a HiL device and we want to speed up the execution time of the model. To do that, we have started taking just the most important parts of the model, which are the I/O and the clock calculation. We have seen that the execution time of the while loop is of 6.7 us. Is there a way to read write the modules in a faster way or we won't be able to speed up more the model?

We have a cRIO 9039 with a 40 MHz clock and the modules are 2x NI9401 and a NI9263.

BeatA_0-1718271386992.png

Thanks a lot,

 

Beñat

 

0 Kudos
Message 1 of 8
(772 Views)

You should use Timed Loop with 40 MHz source, then you will see that it iterates at 40 MHz:

 

Screenshot 2024-06-13 12.04.34.png

Instead of per iteration time measurement you can add continuously incremented counter to that loop:

Screenshot 2024-06-13 12.08.15.png

And then check how many increments you have within one second:

Screenshot 2024-06-13 12.08.27.png

I have exactly 40 Millions cycles per second here.

0 Kudos
Message 2 of 8
(756 Views)

Hi Benata,

 


@BeñatA wrote:

Is there a way to read write the modules in a faster way or we won't be able to speed up more the model?

We have a cRIO 9039 with a 40 MHz clock and the modules are 2x NI9401 and a NI9263.


  • You can read/write the DIO and the AO in parallel with two IO nodes.
  • Some DIO modules allow reading/writing whole ports at once using integer values: I used that a lot with NI9403 modules…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(740 Views)

I believe NI-9263 is the limiting factor here.

 

According NI-9263 Specifications

ZYOng_0-1718282369450.png

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 4 of 8
(723 Views)

@ZYOng wrote:

I believe NI-9263 is the limiting factor here.

 

According NI-9263 Specifications

ZYOng_0-1718282369450.png

 


I don't think that the inserted module will affect cycle time, at least in my case I have also "slow" modules, like 9472 which is 100µs, but the Timed Loop still working at 40 MHz, also when I read inputs or write outputs. If inserted Module is not fast enough I just will get same not updated values during multiple cycles, but execution speed is not affected. But may be I'm wrong, I have no experience with 9263.

0 Kudos
Message 5 of 8
(702 Views)

Hi Andrey,

 


@Andrey_Dmitriev wrote:
I don't think that the inserted module will affect cycle time, at least in my case I have also "slow" modules, like 9472 which is 100µs, but the Timed Loop still working at 40 MHz, also when I read inputs or write outputs. If inserted Module is not fast enough I just will get same not updated values during multiple cycles, but execution speed is not affected. But may be I'm wrong, I have no experience with 9263.

In my experience I got compilation errors when trying to handle slow IO nodes inside fast timed loops (aka SCTLs).

That's why I put those IO nodes into plain while loops and added a wait function inside the loop to set the sample rate…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(691 Views)

Some modules have nodes which require them to be in either normal while loops or explicitly in SCTLs. This is defined int he CLIP.

 

The speed of execution of your code and the speed with which the IO is updated are not neccessarily the same thing. One could theoretically have a loop generating data at 40MHz, but if your IO is limited to 100kHz, I would question the benefit of such a design.

0 Kudos
Message 7 of 8
(669 Views)

@Intaris wrote:

Some modules have nodes which require them to be in either normal while loops or explicitly in SCTLs. This is defined int he CLIP.

 

The speed of execution of your code and the speed with which the IO is updated are not neccessarily the same thing. One could theoretically have a loop generating data at 40MHz, but if your IO is limited to 100kHz, I would question the benefit of such a design.


In my particular case if was necessary to generate precision pulse trains from 9401 with different frequencies and delays for high speed cams and xray sync, also reacting on inputs, and I just let run RT Loop running at 40 MHz, then just implemented simple trivial counter, so, in easiest words, if I keep output true for 1600 cycles, then drop low to next 1600 cycles, then get 12,5 kHz output. It was so easy and works like a charm, fully meet my requirements.

0 Kudos
Message 8 of 8
(662 Views)