FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow performance of application with 2 while-loops

I made an application with one while-loop addressing several FP devices which runs as expected in a FP-2015. Loop time is 100 ms.
If I add another while-loop with a timer, the performance is very slow. How come?
0 Kudos
Message 1 of 2
(3,086 Views)
I tried to do a simular thing, but I did not notice a performance decrease. However it might be possible that this happens. For example, if you are calling a time critical vi in the second while loop, it will lock all other processes until it is finished. Or maybe you are calling a shared resource (allocate an array, access to a file, using a mutex) that the other loop holds. Until the shared resource is released the first while loop must wait before it can access that resource (memory, file, etc.).
Without looking at the source code it will be hard to say what is causing it. I recommend to remove part by part subVI's from the second loop, to debug where the problem exists. If you want I can have a look at the code, please reply to this thread.

ErikvH
A
pplications Engineering
National Instruments
0 Kudos
Message 2 of 2
(3,086 Views)