LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview lags while programming when finnaly totally freezes

Solved!
Go to solution

I had to remove the agilent stuff, becasue I don't have the drivers, but after that, the code complexity reads as 3.7. 

 

Have you tried removing the stack of decorations on the last tab (two flat light grey rectangle decorations partially overlapping a big image, all over a "lowered rouded box")?

 

I would also use bundle by name (see image) to change a single cluster element. Much less code! Of course some of your cluster have a large collection of elements with identical name, so that can really lead to confusions. I would recommend unique names. In any case, you could probably combine most of the similar events into one.

 

 

Lynn: I wasn't sure of any greedy loops, because they have DAQ stuff that could provide some timing. Yes, the timeout in the upper loop is probably too short. None of this should have any bearing on the edit time performance, which was the original complaint.

Message 11 of 21
(1,541 Views)

@johnsold wrote:

Greedy loop!

 

Your while loop has no Waits or other mechanism to slow it down.  It runs several hundred thousand iterations per second. That is completely meaningless for a loop which appears to be intended to display things to human users.

 

Put an indicator on the "i" terminal in the loop and run it.

 

Put a Wait (ms) function in the loop. Set the value to something which is reasonable for your application.  If this is for human interaction, 100 to 200 ms is reasonable.  Even a 1 ms wait reduces the CPU load from all of one core to a small percentage.

 

Lynn




 

Thanks for your reaction and I will change it if it is necessary (the program now checks if 20 seconds, 40seconds and a minute has passed based on the systemclock and I really do want that the program reacts when the seconds passes and not after 200/300 or 400 ms).

 

 

But I don't have any problems when I'm running the executable, no huge amounts of CPU or memory are used while running the executable.

 

 

I only have the problem, which I have been tying to explain in my best English (I'm from The Netherlands), when programming in labview and/or simulating within labview. 

0 Kudos
Message 12 of 21
(1,538 Views)

I would also recommend to simplify the data structures. For example in one subVI, you unbundle by name, rebudle into a new cluster, the immediately convert ot to an array (left). Why not build the array directly (right)?

 

 

 

Try to disable debugging for your subVIs.

0 Kudos
Message 13 of 21
(1,534 Views)

I just looked at the Test Main checks.vi, thinking that was the top level VI.  It has no Agilent stuff.

 

I should read the thread more carefully.

 

Lynn

0 Kudos
Message 14 of 21
(1,531 Views)

@altenbach wrote:

I had to remove the agilent stuff, becasue I don't have the drivers, but after that, the code complexity reads as 3.7. 

 

Have you tried removing the stack of decorations on the last tab (two flat light grey rectangle decorations partially overlapping a big image, all over a "lowered rouded box")?

 

I would also use bundle by name (see image) to change a single cluster element. Much less code! Of course some of your cluster have a large collection of elements with identical name, so that can really lead to confusions. I would recommend unique names. In any case, you could probably combine most of the similar events into one.

 

 

Lynn: I wasn't sure of any greedy loops, because they have DAQ stuff that could provide some timing. Yes, the timeout in the upper loop is probably too short. None of this should have any bearing on the edit time performance, which was the original complaint.


- The lagging still occours when no decorations are present.

- That's true that I've quite a lot of identical names, that's the cause of copying the clusters instead of copying the controls, I've not changed them because of the lagging, even programming is hellish lets not talk about changing about 200 names....

And thanks for the suggestiong about working with the clusters!! that's really helpful!

 

 

But what i do notise is that you all look at the code itself. and I have a question about that because i can understand that decoration or loads of controls can make labview lag after a sertain point but I noticed labview lagging for the first time when I had the frontpage done for about 30% but I had to continue working so all the subVI's etc. have been added laiter, after the lagging started.  maybe I've not been clear with explaining that before.

0 Kudos
Message 15 of 21
(1,530 Views)

@altenbach wrote:

I would also recommend to simplify the data structures. For example in one subVI, you unbundle by name, rebudle into a new cluster, the immediately convert ot to an array (left). Why not build the array directly (right)?

 

 

 

Try to disable debugging for your subVIs.



Yes I know that could be done better, what i've done there is solving a order problem but i've already found the right way to do that. so that what you've posted will be corrected when my lagging problem is solved.

0 Kudos
Message 16 of 21
(1,528 Views)

A few days ago I've installed Labview 2012 on my laptop because my teacher thought that the lagging problem could be a memory bug in Labview 2011 but after installing and testing the lagging while programming still occurs but less frequent.

 

Do you have any ideas left to resolve my problem??

 

For clarity: I'm not searching for comments on how the program has been programmed, I know many things could have been done better and if you have tips I really want to read them but first of all I really would like to get writ of the lagging.

0 Kudos
Message 17 of 21
(1,380 Views)

Mate, I've been where you are & I can feel your pain.

I had the same problem a while ago & it turned out having graphs in tab control is the source of the problem.

Even if you have just a couple of them, it really makes editing very slow & tedious (I had to wait 10~15 sec for any action).

 

Hope this helps.

 

Message 18 of 21
(1,348 Views)

Thanks for your reaction Shiva419!

 

I really hoped removing the graphs would help solving the problem but too bad it didn't.....  After trying your suggestion I've down scaled the program to a program (with the graphs removed) with only four instead of eight of the "bak" control clusters and the problem still remains but less frequent. After I tried that, I've taken all the controls from the clusters to see if the clusters messes with the program but even that doesn't help...

 

The problem occurs in labview 2011 and 2012 (I haven't tested older versions)...

0 Kudos
Message 19 of 21
(1,337 Views)

Hi,

 

Do you still have that issue or is your problem solved?

If you have that issue, could you make a simple version of that code and post it here to check if I can reproduce that problem too?

 

Thanks.

 

Best regards,

Hossein

Message 20 of 21
(1,299 Views)