LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time delay in one part of the code.

Solved!
Go to solution

Hi, 

I am trying to develop an application using Labview version 9. the application is to aquire an lightening impulse waveform from  a tektronix 2012B scope on to a PC and generate a report with the waveform parameters such as the rise time, tail time and the Peak of the wave. 

I have been able to aquire the wave and generate with all the parameters. 

However when I built a EXE file of the program, and ran it on a laptop it has a delay for report generation (approx 3-4mins) to pop up the menu for report generation. And Also I find the code not very user friendly. Please guide me so that I could optimize the code for faster output. 

Any suggestions and information to improve my code would be useful.

 

Thanks in advance....

0 Kudos
Message 1 of 4
(3,085 Views)
Solution
Accepted by topic author Sivachandran

Use State machine Architecture.

Avoid using Multiple loops when you actually dont need

You can Exit the Loop by using event structure in State machine rather than handling separate Loop to Kill labVIEW Apllication which is not advisable.

You dont require a separate Loop to update to indicator from Globals.

 

http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav:tu/q/state%20machine/

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 2 of 4
(3,069 Views)

Thank you Mr Palanivel.. I shall try out the same 

0 Kudos
Message 3 of 4
(3,027 Views)

Three of your loops are trying to use 100% of the CPU, each spinning as fast as the computer allows, millions of times per second. This causes a lof of contention and slowdown of the more important processes.

What is the reason for the 5000ms and 10000ms waits. Only the longer one matters.

The mechanical action of the exit button should be latch action, but it is not recommended to run the emergency brake like that during acquisition. Use proper shutdown code instead.

Two loops overall should be enough, one for the UI and one for the measurements. Learn about evet structures.

0 Kudos
Message 4 of 4
(3,011 Views)