LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait function problem

Hi Jeff,

 

thanks for the reply again. Maybe I did not clearly state my question. Since I was trying to find the reason of the loop speed changing from about 0.1ms to 5ms. I did comparison test to the two VIs. The only difference is one have a wait function inside with millisecond to wait value set as a constant (varies from 0-10) but the other one did not have it, other parts of them were all the same. The speed of them are totally different one is 0.1ms without the wait function, the other one just suddenly jump to 5ms,  So I was assuming the problem was cause by the wait function not by the other parts based on this test. Since the ultimate goal is about 2ms for this loop under control by some wait functions which could work similar as timed loop. I am quite concern about this problem.

 

Best Regards,


@JÞB wrote:

 

Let me get this straight.

@you have a loop you want to speed up to 0.1mSec /iteration and currently runs @5mSec

 

and you think tracking values inside the loop by writing to a local will help???  How fast are your eyes?  you "might" notice a flicker at 50mSec (2 orders of magnatude or 27dB SLOWER than your target speed)  cetrainly you'll never see and register multiple values updating at speed

 

Of course, its all the panel redraws that slow down the loop anyhow!  Think it through again.  For Proof of Concept, toss a defer panel updates method on either side of the benchmark code and watch the loop speed go up signifcantly




0 Kudos
Message 11 of 14
(215 Views)

On which machine you are running the tests. ( how many cores........ )

Can you put your wait function serially ( using error cluster ) before or after  CLF node and check what results you are getting.

some underministic behaviour can be there because every time in loop you are forcing a thread switch ( your DLL is running in UI thread ) but i am not sure if this alone is responcible for the situation. 

0 Kudos
Message 12 of 14
(199 Views)
Hi Neos, 
Thanks for the suggestion, I am using NI cRIO-9022 which I believe is a single core device. I tried to do have the error handler after the CFL and it gives me no error message, however the performance is delayed only by applying the error handler and the speed is about 5ms again, (no wait function this time) I also tried to add wait function after or before the CFL and it gives me no change to the result. It seems whatever I add to the system it delays the iteration duration to 5ms, and only there is nothing exist in the system but the CFL it will speed up to a crazy value which is about 0.1ms per run.
Best Regards,

 

 

@Neos wrote:

On which machine you are running the tests. ( how many cores........ )

Can you put your wait function serially ( using error cluster ) before or after  CLF node and check what results you are getting.

some underministic behaviour can be there because every time in loop you are forcing a thread switch ( your DLL is running in UI thread ) but i am not sure if this alone is responcible for the situation. 


 

0 Kudos
Message 13 of 14
(167 Views)

Hi zzzfreedom,

 

Try eliminating the coercion dots present in your program

 

Regards,

Joel I.
Applications Engineer
National Instruments
0 Kudos
Message 14 of 14
(108 Views)