LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

slide bars slow EVERYTHING, I dont understand!!!!!

I have couple of scroll bars in my VI. It's big, and it does many things, millions of things, and well does.A big program that is.

However I when I needed to add couple of scrollbars it just SLOWS EVERYTHING miserably. And my CORE 2 Duo loaded FULL just because of couple of scroll bars!

I don't understand why slide bars in Labview are that SLOW? What's wrong with it?

 

This is just an example of my code, in attachment.

It is placed inside the loop. And the iteration of loop is set by a 100ms timer. But when I enable peace of this code, it BARELY does two executions in a second. When I disable it does about 10 executions just as intended, although the rest part of the code is bazillion times bigger and complex.

 

Any clue?? Or replacements??

 

0 Kudos
Message 1 of 21
(3,043 Views)

Hi aias,

 

one clue:

It's an overuse of property nodes. PNs are known to slow down the code due to heavy thread switching. So try replacing them with terminals (better option) or local variables (not so good option)...

 

another clue:

You might have overlapping indicators on your frontpanel, which also slows down panel redraws...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 21
(3,016 Views)

Well, I don't know the conversion factor between millions and bazillions, but the code you show should execute in much less than half a second.

 

You don't really provide any useful information. What's the rest of the code? Are there event structures?  Are the slides controls or indicators (one of the problems with value properties is that we cannot tell from the picture). Are any indicators set to syncronous mode? DOes the VI behave correctly except for the slowness?

 

What are the execution settings?

 

I am not familiar with the expression "loaded full". Are you saying that you run at 100CPU on both cores?

 

Is the code shown an indication of how the rest of the code is wired? What is your obsession with value property nodes? 

 

As Gerd said, you cause a lof of thread switching with all these property nodes. As a first step, replace them with local variables to see if there is any difference.

 

Can you isolate a small section of the code into a simplified VI that still shows the problem? Please do so and attach it.

 

 

 

 

 

0 Kudos
Message 3 of 21
(3,003 Views)

 


GerdW wrote:

one clue:

It's an overuse of property nodes. PNs are known to slow down the code due to heavy thread switching. So try replacing them with terminals (better option) or local variables (not so good option)...

 


Yeah, ofcourse, I thought of it too ofcourse, then I replaced it with the indicators themselves - directly. And the outcome was the exactly same thing. I even tried to avoid that input variable and replaced it with a shift register.

 

 


@GerdW wrote:

another clue:

You might have overlapping indicators on your frontpanel, which also slows down panel redraws...


 

Oh, that could be the issue then, if it is so as you tell. I got them placed on top of the canvas, there are plenty of things. I will attach a picture then. There are 12 slides and 6 are working at a time to imitate the flow of water.

But what would you suggest instead?

 

0 Kudos
Message 4 of 21
(2,989 Views)

 


@altenbach wrote:

Well, I don't know the conversion factor between millions and bazillions, but the code you show should execute in much less than half a second.

 


Is it a jest? Dont you think a progress bar updating every 0,5 seconds is a bit overkill? My program is very timing, by no means I can afford that 0,5 seconds on each cycle, (esp. while the rest of the code, which would take couple of print screens bonded together to post, executes in a couple of dozens of ms).

 

 


@altenbach wrote:

You don't really provide any useful information. What's the rest of the code?

 


 

Why would I give you the the rest of the code?

 


Are there event structures? 

 

Whole program is a while loop with an iteration of 100 ms.

 


Are the slides controls or indicators (one of the problems with value properties is that we cannot tell from the picture).

Indicators only.

 

 


Are any indicators set to syncronous mode?

No, I'm not familliar with that.

 

 


DOes the VI behave correctly except for the slowness?

Well, it actually does, by and by.


What are the execution settings?

What do you mean by execution settings?

 


I am not familiar with the expression "loaded full". Are you saying that you run at 100CPU on both cores?

Guess that, Sherlock Smiley Very Happy

 

 


Is the code shown an indication of how the rest of the code is wired?

There are plenty of structures inside, but they all have different conditions and are executed efficiently, and no, they are not wired from the constants, that was just a test.


What is your obsession with value property nodes?

That proved to be not related to the issue.

 

 

 


Can you isolate a small section of the code into a simplified VI that still shows the problem? Please do so and attach it.

I might actually do it, if when I will have some free time.

 

 

 

0 Kudos
Message 5 of 21
(2,978 Views)

I wonder how much help you'll get by being so rude. People on this forum help you in their sparetime and for free.

 

------------------------------altenbach wrote:

You don't really provide any useful information. What's the rest of the code?

-------------------------------------------------------------
Why would I give you the the rest of the code?

---------------------------------------------------------

 

We have no interrest in your code. But if you want help and your question is not clear enough, you might have to come with more information so that we can help you.

 

---------------------------------------------

I am not familiar with the expression "loaded full". Are you saying that you run at 100CPU on both cores?
------------------------------------------------
Guess that, Sherlock
 ---------------------------------------------

 

You should use proper terms and not slang. We don't read minds. Even though I understand(or guessing) what you mean I would prefer if you'ld be more specific and for example refer to the CPU precentage.

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
Message 6 of 21
(2,958 Views)

Even Deejay, Well said, i was thinking the same but couldn't be bothered to respond.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 7 of 21
(2,952 Views)

 


@Even Deejay wrote:

I wonder how much help you'll get by being so rude. People on this forum help you in their sparetime and for free.

 

@------------------------------altenbach wrote:

You don't really provide any useful information. What's the rest of the code?

-------------------------------------------------------------
Why would I give you the the rest of the code?

---------------------------------------------------------

 

We have no interrest in your code. But if you want help and your question is not clear enough, you might have to come with more information so that we can help you.

 

---------------------------------------------

I am not familiar with the expression "loaded full". Are you saying that you run at 100CPU on both cores?
------------------------------------------------
Guess that, Sherlock
 ---------------------------------------------

 

You should use proper terms and not slang. We don't read minds. Even though I understand(or guessing) what you mean I would prefer if you'ld be more specific and for example refer to the CPU precentage.


 

Well, I beg for a pardon then, I didn't mean to be rude at all. Smiley Sad It just seemed strange to me when someone asks me about the entire code of my vi., you know it's kinda not for sharing. I thought the provided info should be more than enough though.

 

About the CPU, well it does about 10-20% when I avoid the animation of scrollbars, and it runs it fine; but when I put it in, one of my CPU does 100%, the other always 0%, it seems Labview uses only one, but it is being overloaded already and yet too slow.

0 Kudos
Message 8 of 21
(2,940 Views)

@ altenbach wrote:

You don't really provide any useful information. What's the rest of the code?

aias wrote:

Why would I give you the the rest of the code?


 

He is asking so that he can help you. Don't worry about Christian stealing your code. Just looking at the subject and the small bit you did post I can assure you that he does not need to. Anyone else who wanted to learn from your code would only be interested in how not to do things. You say that it is slow even on a fast system. The only code anyone would be interested in leveraging would be refactored (but probably completely rewritten) by Christian.

 

I can understand that you might be embarrased by your code. But nobody will think less of you if you are here to learn from your mistakes. That is what these forums are for - to learn how to do things and how not to do things!


@ altenbach wrote:

Can you isolate a small section of the code into a simplified VI that still shows the problem? Please do so and attach it.

aias wrote:

I might actually do it, if when I will have some free time.


You might not want to bother spending your free time on that now. I am not too sure you will get a lot of help after that reply to someone who only wanted to help you. Maybe it came off in a way that you didn't intend but to myself and others it seemed extremely rude.
=====================
LabVIEW 2012


Message 9 of 21
(2,873 Views)

Look, we are trying to help here, but you need to cooperate too.

 

Nobody will steal you ingenious algorithms and sell them on e-bay. Nobody will laugh at your code. However, if you are lucky, some of it might get a honorary mention in the Rube Goldberg thread. That's considered an honor! 😮

 

If you feel sick, you don't fax a picture of your finger-tip to the doctor for a full differential diagnosis. Right? 😮 So why attach a code image of an area covering only 1/bazillion'th of the code. Obviously, you cannot tell what's important for us, else you would also have shown a picture of the overlapping controls of the front panels. 😉

 

Many here have 10+ years of programming experience and we've seen it all. We've seen the code with a bazillion property nodes and overlapping controls. Since each property node forces a switch to the UI thread and needs to execute synchronously, your style of programming (if we can call it that) alone can be 3-5 orders of magnitude more demanding on computing resources. If you keep programming like that, you'll run into the wall 1000x earlier than with equivalent efficient code. The community here is good at identifying performance issues. Just recently we were able to take a VI that took several hours to execute and tuned it so it did the same thing (actually more) in under 10 milliseconds. 🙂

 

If we don't see the code, our hands are tied. I cannot debug a picture.

 

If your stamp sized snippet is of any indication, you are one of these newbie LabVIEW programmers that have all controls and indicators nicely parked and disconnected in an empty area of the diagram, while the loop code reads and writes everything via value property nodes. I was hoping it's not, that's why i wanted to see the code. It is likely that you are (somewhat) experienced in text based code, which often causes issues when transitioning to graphical code. You tend to stick to old paradigms that are no longer suitable in the new environment. I strongly recommend to listen to our advice and change your coding habits as soon as possible. Once you get really used to bad habits, it will be more difficult to change.

 

As with any advice, you have two viable options. (1) take it. (2) leave it.

 

So, back to the problem at hand: Were you able to solve the problem? Do you still want us to help?

 

 

 

 

 

Message 10 of 21
(2,811 Views)