LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make this VI faster

Hi everyone,

 

I'm wondering if I it's possible to make the VI below a faster.

My_VI.png

It's used for reading in variables.

In my application there is a Sub VI in my main VI.
Different VI's can be loaded in this sub VI (selection can be made in a menu, one Sub VI at a time).

 

In one of my VI's I have 231 variables which have to be read in.

This takes a while, about 3 seconds, which is a little bit slow.

Is there a possibility to make the VI faster?

 

I also attached the VI with the corresponding VI's.

 

I hope someone can help me.

 

With kind regards,

 

Kenny Schraven

 

 

0 Kudos
Message 1 of 5
(2,600 Views)

I have one sugestion that may help a little bit. Right click on for loop and Configure Iteration Parallelism. See simple example. I'm running 2012. Should work from LV 2009 and up.

 

parrallelism.png

 

Your code looks like it may work that way. sometimes you need to change things to make it work. Like if you use add to array inside the loop. But since you are indexing an array and making changes to that array item and then indexing it back out it may work.

- A minute saved is a Minute earned!
0 Kudos
Message 2 of 5
(2,587 Views)

Updating the value of a control by reference is probably the biggest hit time wise.

 

See this thread for suggestions about the performance and choices for updating controls by reference.

 

http://forums.ni.com/t5/LabVIEW/Dr-Damien-s-Development-Front-Panel-Control-Indicator-Update/td-p/20...

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 3 of 5
(2,564 Views)

You could use the Defer Front Panel Updates to disable updates before entering the FOR loop and enable after it.  This should speed up your writing to the property nodes.


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
0 Kudos
Message 4 of 5
(2,562 Views)

You may also want to review your architecture. Given you have 231 "variables" which are actually controls I suspect that you are trying to use these controls as you would variables in other languages. LabVIEW is a data flow language and the best analogy that can be given is that the wire is the variable. If you have lots of hidden controls on your front panel this is a good sign you need to rethink your architecture and make it conform to the data flow paradigm.



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
Message 5 of 5
(2,523 Views)