09-07-2012 02:22 AM
Hi everyone,
I'm wondering if I it's possible to make the VI below a faster.
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
09-07-2012 03:28 AM
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.
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.
09-07-2012 07:06 AM - edited 09-07-2012 07:06 AM
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.
09-07-2012 07:08 AM
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.
09-07-2012 12:04 PM
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.