LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using SCTL in FPGA VI

Hello, guys.

 

We are running a FPGA VI, and for a time we were using just a While Loop.

But reading some new articles about how to improve my FPGA VI, I've seen about SCTL (Single-Cycle Time Loop).

I tried to replace the While Loop for the SCTL but when I tried to run the LabVIEW shows a message about using For Loops inside the SCTL.

foto 01.jpg

 

02.jpg

 

In order to remove the for loops I would have to split all my build arrays and use all that coding inside the for loop as many times as for the channels I'm monitoring. Then my question is: What is more worth: using the While Loop in order to keep the For Loop or increase my code redundantly in order to use the SCTL structure?

 

Thank you all.

Best 

0 Kudos
Message 1 of 5
(2,435 Views)

Hi andre,

 

instead of worrying about SCTL you should think about usage of float data and lots of divide functions in your code! That loop will run faster when using FXP data instead...

(And use less fabric.)

 

In the SCTL you should not use a for loop, so you need to unroll your code.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(2,429 Views)

On top of what GerdW said, I believe all of the primitives inside of the for loop should be able to handle operating on the arrays. After you solve that problem though you will probably have to deal with not being able to use the divide primitives inside of a STCL and, depending on the hardware you are using, not being able to have the analog I/O nodes inside of a SCTL.

Matt J | National Instruments | CLA
Message 3 of 5
(2,407 Views)

Hello, GerdW.

 

Thanks for the quick answer.

 

I'm quite new using LabVIEW FPGA, and I've never seen the FXP data until then. That's the why I convert the FXP data to SGL, in order to get a real number (i.e. EGU).

What do you suggest by saying in using FXP data to increase improve this VI? 

 

Best.

0 Kudos
Message 4 of 5
(2,385 Views)

Hi Andre,

 

What do you suggest by saying in using FXP data to increase improve this VI? 

Just do your calculations using the FXP datatype.

You need to plan ahead then:

- learn about FXP usage in general

- learn about their limited value range/resolution

- learn about determining which (specific) FXP datatype to use

 

That's the why I convert the FXP data to SGL, in order to get a real number (i.e. EGU). 

FXP data also contains the "real number" - just in the resolution/range supported by your AI module.

 

Do you really need to use a SCTL here? Which datarates/samplerates do you need to handle?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 5
(2,381 Views)