LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FOR loop + Case structure to accommodate indicators in small space - performance?

Solved!
Go to solution

In a particular case I just used a simple FOR loop and a Case structure to accommodate many indicators to save BD space (42 indicators...I swear, this number is accidental! 😄 ).

I know I should use clusters to group up indicators (in this case this was not an option due to special GUI reasons), or to use SubPanels loaded with display VIs (neither was a comfortable option).

 

Anyway, my actual question regards to performance of such (not really elegant) constructions during runtime: distributing many indicators into such structures impact the runtime performance? If so, should I enable loop iteration parallelism? Would it make any difference?

Extra info: the loop where this construct is placed, iterated with a slow speed of 1 Hz.

 

many_indicators.png

0 Kudos
Message 1 of 19
(3,638 Views)
Solution
Accepted by topic author Blokk

As long as those indicators are NOT set as "Syncronous" I suspect it will not make much of a difference.

 

Going even farther...

 

Since they only get updated 1/second you would most likely be able to update those indicators using control references in a sub-VI... unless your UI Thread is already over-loaded.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 19
(3,621 Views)
Solution
Accepted by topic author Blokk

Blokk wrote:

Anyway, my actual question regards to performance of such (not really elegant) constructions during runtime: distributing many indicators into such structures impact the runtime performance? If so, should I enable loop iteration parallelism? Would it make any difference?


It will affect performance.  Enough for you to care?  Probably not.  Will parallelism help?  Try it an see.  My guess is not.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 19
(3,617 Views)

@crossrulz wrote:

Blokk wrote:

Anyway, my actual question regards to performance of such (not really elegant) constructions during runtime: distributing many indicators into such structures impact the runtime performance? If so, should I enable loop iteration parallelism? Would it make any difference?


It will affect performance.  Enough for you to care?  Probably not.  Will parallelism help?  Try it an see.  My guess is not.


I suspect we would have a very difficult time even measuring a difference in performance between doing it in a For loop or not.

 

It becomes a philosophical question;

 

"If a code change impacts performance but there is no way to measure the impact, ...?"

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 19
(3,597 Views)

Have you ever had guys a feeling like "....hmm, I might ASKED THIS BEFORE???" 😄

Voalá: https://forums.ni.com/t5/LabVIEW/Make-BD-space-for-indicators-trick-FOR-loop-Case-structure-combo/m-...

 

Does this mean I am getting older?

😄

 

edit: ok, to be fair with myself, I asked about alternatives in that summer post, and here I asked about performance 🙂

0 Kudos
Message 5 of 19
(3,585 Views)

The broken wires distract a little bit. So is this only one big cluster or several small clusters that you unbundle in the various cases?

 

I agree with Ben that you won't notice an impact, these are just scalars. Updating the UI thread is asynchronous anyway.

 

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

 

Personally, I would also move the terminal labels to the right and stack the terminals nicely without wire bends, but that's just me. 😄

 

 

Message 6 of 19
(3,581 Views)

@altenbach wrote:

The broken wires distract a little bit. So is this only one big cluster or several small clusters that you unbundle in the various cases?

Yes, several smaller ones.

I agree with Ben that you won't notice an impact, these are just scalars. Updating the UI thread is asynchronous anyway.

Ok.

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

Hmm, sounds reasonable!

Personally, I would also move the terminal labels to the right and stack the terminals nicely without wire bends, but that's just me. 😄

This was a kind of "fight back" against my OCD 😄

 


 

0 Kudos
Message 7 of 19
(3,577 Views)

@altenbach wrote:

 

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

 


This triggered an idea for a new structure, the "parallel stack". It would look like a stacked sequence, but would simply instruct the compiler to do all frames in no particular order and as parallel as possible. 😄 It would be just a cosmetic diagram organization tool and would be treated as if all frames were flattened out to the diagram. 😄 Hmmm....

 

Frames could be freely named according to function and clicking would expose a pulldown with all frame names for direct access.

Message 8 of 19
(3,566 Views)

@Blokk wrote:

...

Does this mean I am getting older?

😄

...


Well since you asked, I do have a theory...

 

 

Spoiler

After watching my son grow-up and now entertain G-daughters weekly I have found that people will forget what they do or say... otherwise "de jevu" would not be part of our vocabulary.

 

When infants the world is new and wonderful and full of learning experiences. I watched my son's eye light up when he was an infant, wildly waving his arms around and after smacking himself in the face, he looked at his hand and it seemed he was thinking "Wow, I think I just did that!"

 

The interest in new things can then decline and about 8-9 years old the phrase "I'm bored!" is uttered.

 

As we get older we start to create lists of things we plan to do some day..

 

As time passes we keep adding to that list and our spare time is spent doing some of those things.

 

Eventually we get to a point where we recognize "I have more things on my list than I have time left in this life!"

 

That is getting close to being old but you eventually have to give up, admit you are getting old and you let you better-half prioritize the list for you.

 

 

 

And just for the record, I am old!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 19
(3,561 Views)

@altenbach wrote:

@altenbach wrote:

 

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

 


This triggered an idea for a new structure, the "parallel stack". It would look like a stacked sequence, but would simply instruct the compiler to do all frames in no particular order and as parallel as possible. 😄 It would be just a cosmetic diagram organization tool and would be treated as if all frames were flattened out to the diagram. 😄 Hmmm....


If you put this on the idea exchange, i will vote for it! 🙂

0 Kudos
Message 10 of 19
(3,554 Views)