10-14-2025 02:10 PM
I have tried to implement a PID control where a modulation timesieries is generated as output, a timeseries is acquired as input, then a single pont PID correction signal is calculated to be applied at the next cycle.
The output is the slave waiting for the trigger from the input.
Sampling rate 100 KS/s, numeber of point 1 kS, therefore the cycle is completed in 10 ms
The vi works fine for few minutes then the output stops being generated, but the vi continues acquiring without giving an error.
It is not clear to me if it is a problem of trigger, or a problem of clock source.
The key is the synchronization of the master input and slave output . The same problem when the master is the output.
I attach a simplified scheme, where the PID is not reported for simplicity.
What is the reason of the stop of the output?
Max
Thanks in advance
Solved! Go to Solution.
10-14-2025 08:43 PM
Which model of DAQ hardware are you using?
Are you sure the loop is indeed running at 10ms interval? Try to benchmark it with Find My Loop Rate in LabVIEW
10-15-2025 05:38 AM
Thank you for the fast reply.
1) The DAQ is X series USB-6366, WIN11 Pro 16Gb RAM
2) The Loop rate measured with "Tick count" is 10 ms in average. It looks like when there is activity with the PC (open file explorer or open another LV file) the loop rate changes a bit and then the output generation stops.
Is there a way to prioritize the activities in the LV loop with respect to the PC activity?
10-15-2025 06:15 AM
@max_tomatis wrote:
It looks like when there is activity with the PC (open file explorer or open another LV file) the loop rate changes a bit and then the output generation stops.
Now, you're realizing the difference between RTOS and Windows OS.
On Windows OS, as it is designed for multi-tasking and not run time-critical applications, it is possible that an update or an application can use up all available computing resources making your critical application stuck/stall. Now, imagine if Windows or your IT decided to force update and restart your computer when it is running a PID loop and mid-way it restarted.
Typically, for PID application, you get a dedicated hardware and thereby guarantee its performance or in this case go with a cRIO to implement the PID loop to be reliable.
10-15-2025 09:48 AM
I understand your point. I should use RT labview on a real-time embedded system like CRio.
To save time, is there a way to translate directly the LV that I created and works (a part the windows interruptions) into a RT LV and usi in my CRio?
Massimo
10-15-2025 10:46 AM
And.. would a "Timed loop" in LV solve the problem by using the maximum priority?
10-16-2025 06:20 AM
Hi Massimo,
@max_tomatis wrote:
To save time, is there a way to translate directly the LV that I created and works (a part the windows interruptions) into a RT LV and usi in my CRio?
Usually you can transfer VIs from "my computer" target to "realtime" target.
There are some points to consider:
@max_tomatis wrote:
would a "Timed loop" in LV solve the problem by using the maximum priority?
No.
It's a common mistake to use the TimedLoop on a Windows target to become (more) independent from Windows OS timings...
The TimedLoop is made for realtime targets! (It's mainly available on Windows to allow/support debugging of realtime VIs.)