11-08-2018 11:37 AM
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.
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
11-08-2018 11:47 AM
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.
11-08-2018 01:49 PM
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.
11-09-2018 04:29 AM
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.
11-09-2018 04:34 AM - edited 11-09-2018 04:35 AM
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?