10-31-2025 09:51 AM
But be clear: My recommendation is very heavily the RT route for your immediate code needs and the others for further research and learning for the future.
10-31-2025 09:57 AM - edited 10-31-2025 09:59 AM
Just curious, something wrong with my proposal? Seems to be working and fairly straight forward:
Acquisition loop ticks every 200us, fastest is 177us. But this is with my sbRIO-9638.
10-31-2025 10:06 AM
Well, not knowing you had a solution up and running would be part of my reasoning....
Still, the SCTL part is a steep learning curve.
On your included image, the timing of reading from the FIFO does not neccessarily represent the same timing as you write to it (it might, it just depends on your hardware). For me, just to be pedantic, I would include the timing of the acquisition in the FIFO to the second loop so that you retain the actual acquisition timing for proper results.
Also, didn't you write earlier that you wanted to react within microseconds? With a loop timer of 200us, that's not what I would have understood from your text. Trying to solve the problems as you describe them.
I'm pretty sure I could write code 10x faster (useless if your analog hardware doesn't support it) and with 10x less resources (useless if you don't need anything else on the FPGA) and at least equivalent accuracy, but as long as you have something up and running, then you're doing fine.
10-31-2025 10:16 AM - edited 10-31-2025 10:23 AM
I think you confused me with the original author. I just created rough draft in like 30 minutes not intending it as a final solution. Sure, you can set cluster as your data type for FIFO (FXP + T/ dt values).
Even if someone goes this route, there is work to do. But just the concept.
You keep bringing up SCTL, from my understanding, you cannot acquire analog data inside SCTL in LabVIEW. Unless you wire an external ADC IC and read its output.
You sure can process acquired data in SCTL.
10-31-2025 10:55 AM
Ha. Yes, I did. Sorry about that.
That explains my surprise that after the initial code such a working code was produced so quickly. Currently absolutely slammed at work, didn't take time to read properly. I felt a bit confused to be honest, such a relatively beginner question and then suddenly a working example on FPGA, compiled and all. I thought (you - who I confused with OP) was low-balling me in the original post. 😂
.-back to topic. All of our code (exclusively) is in SCTLs. You can do lots of things inside a SCTL, but again, depends on the hardware. If the NI target I/O nodes limits you to non-SCTL then there's nothing to change about that. For an Integration calculation, however, it's still going to be massively faster and more efficient in a SCTL than outside. We often use multiplexing to re-use a single calculation loop for multiple channels (up to 200 channels in a single loop, one per iteration). Scaling up can bring massive advantages with SCTL over standard while loops. Of course, SGL doesn't work with SCTLs either.
10-31-2025 11:15 AM
Haha okay okay, totally understandable. 😀
Yes, I agree SCTL is best for calculation and use it whenever possible. I mostly work with SCTL too and love their deterministic nature. I get surprised every now and then by what you can achieve with them.
But for analog, my mind has been now programmed like "Analog in LabVIEW = While Loop". Since you cannot calculate faster than you acquire. Its like V8 on tiny wheels haha. I dread using while loop in FPGA as it feels like the spiderman trying to stop that metro train (handling all the timings). Although in this case, it might be a good option for the OP.
Peace ⬜.
10-31-2025 12:22 PM
We have consensus. For OP, it's the best option. 😎
10-31-2025 01:37 PM
@Xonmyth wrote:
Haha okay okay, totally understandable. 😀
Yes, I agree SCTL is best for calculation and use it whenever possible. I mostly work with SCTL too and love their deterministic nature. I get surprised every now and then by what you can achieve with them.
But for analog, my mind has been now programmed like "Analog in LabVIEW = While Loop". Since you cannot calculate faster than you acquire. Its like V8 on tiny wheels haha. I dread using while loop in FPGA as it feels like the spiderman trying to stop that metro train (handling all the timings). Although in this case, it might be a good option for the OP.
Peace ⬜.
My favorite example is this https://forums.ni.com/t5/Examples-and-IP-for-Software/RTSA-Host-Reference-Example-for-FlexRIO/ta-p/3... (not available due to export controls) is all done with LabVIEW FPGA (no Xilinx IP or VHDL). You have close to a gigahertz of data being processed in real time.
10-31-2025 01:38 PM - edited 10-31-2025 01:38 PM
deleting duplicate post
10-31-2025 02:50 PM
@Terry_ALE wrote:
My favorite example is this https://forums.ni.com/t5/Examples-and-IP-for-Software/RTSA-Host-Reference-Example-for-FlexRIO/ta-p/3... (not available due to export controls) is all done with LabVIEW FPGA (no Xilinx IP or VHDL). You have close to a gigahertz of data being processed in real time.
That looks WOW. I have so many questions! Thank you for sharing Terry.