LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dyno VI Lag, PC or Code....

My code is messy (size and no doubt format) but it works, for the most part.   I am controlling a dynamometer and supply voltage and control signal to a motor. 

 

The entire program is run in a case structure that contains 8 while loops that control various hardware/operaitons:

-AC supply

-Torque Control

-DC Supply

-Test Report Generation

-Stopwatch Timer plus resets

-Graphing Loop

-AC power meter

-DC power meter

 

 

The first 3 loops, AC/DC Supply and Torque control work great.  After adding in the last components my VI starts lagging horribly.  Any obvious blunders in my plan of attack?  I'm used to VBA and text based programming and I've gotten rid of a TON of local variable use, but still use them for test report generation.  I'll eloborate more after some feedback.  

 

All the sub-vi's that get called I have not included, but those should be fine.  I'm just curious if there are an obvious blunders in the main VI.  Is it possible my machine is maxed out with all these hardware/operation loops?  I'm starting to think my machine is limiting this because the same program runs fine on our other dyno with a slightly better PC.  However, my code is slightly modified because I had to adapt the orginal code to work with different hardware.

 

 

 

 

0 Kudos
Message 1 of 3
(2,242 Views)

It certainly is large!  It is recommended to keep the size of the block diagram to one screen.

 

Most likely the reason things bog down is that some of your loops have no delays or waits in them.  I cannot tell for sure without the subVIs.  Parallel loops need to have a delay so that the loop will pause and allow other loops to run.  A loop without a delay is called a greedy loop because it grabs all the CPU cycles it can get.

 

Try to avoid running wires behind other things on the diagrams.  It makes it hard to see what is going on.  If some code gets hidden back there, it can be very difficult to find bugs!  Lots of other style issues.  Too many local variables. ...

 

Lynn

 

 

 

0 Kudos
Message 2 of 3
(2,233 Views)

Yes, some of them have delays either in the visible code or in the sub-vi's.

 

HOWEVER......some do not....i can try that tommorow.

 

 

Keep the suggestions coming Smiley Happy

0 Kudos
Message 3 of 3
(2,229 Views)