LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Iteration duration changes in the RT PC target

Hi,

 

I am using a desktop PC as LabVIEW RT target. I compiled the attached VI on the RT PC target. I expect to have a constant iteration duration time, but when I plot the results (check the attachment) I figured out that it was not. Why did iteration duration change when there was no OS like windows to handle the threads? Was there a thread running that I was not aware of?

 

Also, I want to know if a code is compiled on an RT desktop PC target for a very long time (say 10 years), would it work properly or it needs to restart once in a while? What about running it on a Windows OS?

 

Thanks in advance

Download All
0 Kudos
Message 1 of 6
(2,910 Views)

Hi msad,

 

do you really need to write a text file each 40ms? Exactly 40ms???

 File access isn't the right stuff to be done in a TWL…

 

What else is running in your RT system?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,906 Views)

Thanks GerdW,

 

The attached code was just a test code to determine the iteration duration of the loop and nothing else was running on RT PC target.

Let me ask my question more precisely. If I compile a deterministic code on a desktop PC used as an RT target, the iteration duration of the code changes? Does PharLab manage the threads like in windows or every things are completely 100% real time? How can I check that no other threads were running on RT PC target?

0 Kudos
Message 3 of 6
(2,869 Views)

Hi mads,

 

in theory your TWL should run with it's set iteration time.

 

But:

- when the code inside the loop takes longer than expected to execute the loop will miss it's time target. The TWL tells you such occurances with it's inner loop terminals.

- when your target uses a single core CPU it may run out of CPU time and so the RTOS will prioritize certain tasks. What about all those network handling stuff? What about file handling stuff done by the OS? (On my new cRIO9066 with a dual core CPU I can have my RTEXE run at full load but it will not block RTOS tasks…)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,865 Views)

So you meant in every RT target there is an RT OS and it handles some other threads beside my code. What about AVR or ARM micro-controller? Do they have something like RT OS or they are completely real time? In other words, if I run a deterministic code on a micro-controller for 10 times and calculate the run time very precisely every time, do get the same results? I get different results in RT PC target with PharLab OS.

0 Kudos
Message 5 of 6
(2,855 Views)

Hi msad,

 

in every RT target there is an RT OS and it handles some other threads beside my code

Yes, that's the purpose of any OS…

 

What about AVR or ARM micro-controller?

Those µC neither run your LabVIEW code nor a full blown RTOS. Most often they just run your special code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,846 Views)