キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/8
1,301件の閲覧回数

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 件の賞賛
メッセージ2/8
1,285件の閲覧回数

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 件の賞賛
メッセージ3/8
1,269件の閲覧回数

I believe NI-9263 is the limiting factor here.

 

According NI-9263 Specifications

ZYOng_0-1718282369450.png

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 件の賞賛
メッセージ4/8
1,252件の閲覧回数

@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 件の賞賛
メッセージ5/8
1,231件の閲覧回数

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 件の賞賛
メッセージ6/8
1,220件の閲覧回数

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 件の賞賛
メッセージ7/8
1,198件の閲覧回数

@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 件の賞賛
メッセージ8/8
1,191件の閲覧回数