LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview vi slows down

Solved!
Go to solution

I am doing extensive reading of the Ethernet socket and data processing. When I keep the mouse pushed over the panel it runs ok. As soon As I let it go it slows down to like one cycle per second. I have 4x2.4GHz Intel and 4GB RAM. Task manager does not show any ovewhelming CPU usage. Kepping the mouse button on the bottom taskbar application helps as well.

Why does it happen and how to fight it? thanks

0 Kudos
Message 1 of 20
(4,473 Views)

can you post the vi so we can see what is happening?

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 20
(4,469 Views)
I doubt it could help without the scanner I am reading from. Normally I should be able to read, process and display 20 frames/s. On its own it tends to slow down to a few f/s. Keeping the mouse over the Vi panel speed it up to normal. I was trying to play with the excution priorities but it only made it worse. I appreciate any ideas.
0 Kudos
Message 3 of 20
(4,448 Views)

My first guess is that you are growing an array endlessly.  As it gets larger, LabVIEW needs to juggle memory to find an ever growing space to store it.  The other possibility is a string concatenation you have going on in the middle of the lower loop where you are concatenating more and more data to a string and storing it in a shift register.

0 Kudos
Message 4 of 20
(4,430 Views)
Sounds like it might be a thread priority issue.  When the mouse is over the application, the application gets a boost in priority, making it faster.  Does this sound right?
Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 20
(4,418 Views)

Ravens Fan wrote:

My first guess is that you are growing an array endlessly.  As it gets larger, LabVIEW needs to juggle memory to find an ever growing space to store it.  The other possibility is a string concatenation you have going on in the middle of the lower loop where you are concatenating more and more data to a string and storing it in a shift register.


 

I think I made the arrays fixed size. Initally I did not and it did not work.

 

The way it works is I get  a long string, need to throw out the header, then I store the values into arrays one by one. Based on certain criteria I throw some of them out so the array is almost never full, then I process the data in the array.

I ll check if the memory usage goes up. Could you be more specific as where the problem could be? I concate things more than once.  thanks

0 Kudos
Message 6 of 20
(4,405 Views)

billko wrote:
Sounds like it might be a thread priority issue.  When the mouse is over the application, the application gets a boost in priority, making it faster.  Does this sound right?

 

That is what i thought but still I have no idea how to approach it. Sometimes is just fine without doing anything, The trick with pushing the mouse button over the panel olways works.
0 Kudos
Message 7 of 20
(4,403 Views)

Ravens Fan wrote:

My first guess is that you are growing an array endlessly.  As it gets larger, LabVIEW needs to juggle memory to find an ever growing space to store it.  The other possibility is a string concatenation you have going on in the middle of the lower loop where you are concatenating more and more data to a string and storing it in a shift register.


I just checked the memory usage. For 10 min it stayed still the CPU about 6-7% load. Labview does not allocate any extra memory(it seems like). The whole system actually went dow from 915MB to 913MB RAM usage.

0 Kudos
Message 8 of 20
(4,395 Views)
Have you tried running the profiler? This may help you to narrow down what is taking so much time. You might also want to spend a little time cleaning up the code. When I opened it it was difficult to follow what was happening. The diagram is extrememly large (much large than my 1600 x1200 monitor), the wires are flowing in all different directions and you have hidden code (code that is covered by other structures or hidden inside a structure that was resized to a smaller size). Organizing and cleaning up the code may help you to uncover the problem area.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 9 of 20
(4,389 Views)

AndyN wrote:

billko wrote:
Sounds like it might be a thread priority issue.  When the mouse is over the application, the application gets a boost in priority, making it faster.  Does this sound right?

 

That is what i thought but still I have no idea how to approach it. Sometimes is just fine without doing anything, The trick with pushing the mouse button over the panel olways works.
 
I once used a Timed Loop (with the stop button wired to stop after the first iteration) to allow me to play with the code's processor affinity and priority.  Id be interested to see if that changes anything.

 

0 Kudos
Message 10 of 20
(4,386 Views)