LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reduce my time delay for my program?

Hi, I would like to ask how can I reduce the time delay for my program (Main Frame) as there is a time delay in each flat sequence structure? Attached is my labview and I am mainly focusing on the Main Frame for the project. Thank you

0 Kudos
Message 1 of 2
(2,216 Views)

You'll have to think of a better approach to make a program.

 

In your current main (I haven't even looked at the rest) each condition triggers an action. Part of the action is 2X.5 seconds waiting. That waiting will stop the while loop from going into the next iteration.

 

So, if there is any action, all other conditions won't be checked for 1 second.

 

Following the LabVIEW 4 style programming, each condition check and matching action should have it's own loop. This is retro programming, that used to be done before the event structure and other techniques existed.

 

As an intermediate solution to the problem (I figure you don't want to or can't redesign the entire program) you might try a few things. Each action is still being polled like it is now. But, instead of setting the values and waiting in a flat sequence structure, start a dynamic VI that does this. Or, make a class with a timer, and the shared variable URL. This class will run in the main loop, and when the time is there, it will turn the shared variable on and off... But this will only be a band aid.

 

Some (free) LabVIEW courses before starting a program would have helped. (Public) Globals are hardly ever needed. (Flat) Sequence Structures are never needed. Polling values is a very primitive way to handle things.

0 Kudos
Message 2 of 2
(2,174 Views)