04-24-2024 03:47 AM - edited 04-24-2024 04:10 AM
Hi, I'm using a cRio to control a servo valve with a PID controller. I have a simple functional code (in attach) that does what I need, but I cannot perform more than 100 cycles per second. I'm doing something wrong in my program, it's impossible that it won't be possible to go much faster. My problem is that I am self-taught in LabView (not to mention that my background is in Civil Engineering…). I would like to ask if you could give me a clue as to what I'm doing wrong, I'm somewhat stuck... Maybe I have to compile the code to run within cRio (I'm not doing it, I still don't know how to do it). Any advice would be welcome!
04-24-2024 04:44 AM - edited 04-24-2024 05:00 AM
Hi number,
@numifar wrote:
I have a simple functional code (in attach) that does what I need, but I cannot perform more than 100 cycles per second. I'm doing something wrong in my program, it's impossible that it won't be possible to go much faster.
You use a lot of IONodes (for all hardware IO) in your cRIO VIs: they are not known to be "very fast". They also use the ScanEngine, where you need to be configure the cycle time.
So the questions are:
Even though your project file (from LV2012) is shown as "corrupted" by my LabVIEW (LV2019) I guess the ScanEngine is set to a samplerate of 100Hz (Period = 10000 µs):
<Property Name="target.IOScan.Period" Type="UInt">10000</Property>
@numifar wrote:
Maybe I have to compile the code to run within cRio (I'm not doing it, I still don't know how to do it).
When you run a VI then you execute compiled code.
When you start a VI, that is called on your cRIO target, then you run code compiled for the cRIO.
You don't need to "compile code to run within cRIO" specifically, all you need to do is to place a VI in the correct target tree of the LabVIEW project.
I also recommend:
04-24-2024 12:58 PM
Hello GerdW,
Thanks for your reply, and sorry for my missing name in this forum (my first time…). It’s Nuno. The cRio and IO modules are at the University, but Friday I‘ll have the information you request (tomorrow is national holiday).
For what I understand, I’m using Scan Engine and I should used FPGA. I’ll see if I’m licensed. I also understand that I don’t need to worry about compile the code, so that is not the problem. I’ll remove all property nodes, select modes and formula nodes in a new version of the code. You refer that it is not common to have UI on real-time VI, and I have. What you say makes sense, but it is working... Can this be part of the problem for my slow code? I have play with the time step of the loop on the real-time VI but it doesn’t have any effect… Friday I’ll add the missing information to see if I can correct my code, or if I should start a new one.
Thanks, best regards. Nuno
04-26-2024 08:54 AM
Hi, just checked and I have an cRio 9074, with several I/O modules. But I’m only using modules NI9263 and NI9205. Regarding FPGA, I don’t have it installed. I’ll fix this as my next step.
04-26-2024 11:44 AM - edited 04-26-2024 11:47 AM
Hi numifar,
@numifar wrote:
Hi, just checked and I have an cRio 9074, with several I/O modules. But I’m only using modules NI9263 and NI9205. Regarding FPGA, I don’t have it installed.
With a cRIO9074 you only can choose between using the ScanEngine or use the FPGA to access your module IOs.
The ScanEngine is quite limited on this old cRIO due to its limited resources (FPGA size, RAM, CPU power), so pushing it to 100Hz is already hitting its limits.
You might want to read this article from NI.
When you need higher sample rates then your choice is to handle the IOs in the FPGA: you need to install the FPGA module and activate it with your (valid!?) license.
Be warned: this old cRIO requires an old version of the FPGA compile tools, which only come with older LabVIEW versions. And those older FPGA tools aren't supported on modern Windows. You may have luck when you can use the NICompileFarm service to create the bitfiles…
04-27-2024 04:18 AM
Hi GerdW,
My license gives me access to all features available for LabVIEW up to version 2013. Since the FPGA module I need is old and cannot be download directly from the NI webpage, I asked technical support to send me a link to the module FPGA (2012 version). In this field, I don't expect any problems. Regarding the Windows version, I was not aware of that problem. Fortunately, I ended up being lucky. I am using the resources already installed, that is, a computer with Windows 7 (32 bits). I hope it supports FPGA modules…
I'm not going to close this post right now, I would like to share to what frequency I can go using FPGA (with SCAN ENGINE I achieve 100Hz, I hope to reach 1kHz with FPGA).
Regards
Numifar