LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

alternative to conditional tunnel option (for LV 2011)

Solved!
Go to solution

hi there,

 

i've created a VI in LV 2013 that uses a conditional tunnel in a for loop. 

unfortunately the PC i made the VI for is running LV 2011, where the conditional tunnel option is not implemented yet.

 

so therefore i build a workaround:

 

Untitled-2.png

 

with this workaround it takes much much longer until the loop is done compared to the condtional tunnel option.

 

any idea for a better/faster workaround?

 

0 Kudos
Message 1 of 7
(3,458 Views)
Solution
Accepted by re-fuse

I highly suggest installed the OpenG add-on to your LabVIEW and using the Conditional Auto-Indexing Tunnel VI that they supply in their palette. This was implemented before LabVIEW added the feature and it has worked great for years.

 

It essentially works by incrementing through the indices of True values in an array of booleans and outputting the corresponding indices in the input array.

 

Edit: What you're doing is almost exactly what the code gets converted to when you save for previous version like Aputman said. The only downside to this is that you can't utilize parallelism because of the shift register. If you're trying to process a lot of data, run the loop with all indices going out (with parallelism) and post-process the array using the OpenG add-on.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 7
(3,442 Views)

Use the "Save for Previous Version..." option in the File menu.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 7
(3,440 Views)

@re-fuse wrote:

hi there,

 

i've created a VI in LV 2013 that uses a conditional tunnel in a for loop. 

unfortunately the PC i made the VI for is running LV 2011, where the conditional tunnel option is not implemented yet.

 

so therefore i build a workaround:

 

Untitled-2.png

 

with this workaround it takes much much longer until the loop is done compared to the condtional tunnel option.

 

any idea for a better/faster workaround?

 


 

couldn't you get rid of the inner for loop:

2015-08-24_polymorph.PNG

 

 

Use "replace Array" instead of "Build Array" inside the case structure.

 

Regards,
Alex

Message 4 of 7
(3,416 Views)

@James.Morris:

thx a lot for the amazing hint!

the open-g library is great and iam already using it. i just didnt see the Conditional Auto-Indexing Tunnel VI before.

 

@aputman:

when you do this labview tries to build a workaround itself for the conditional tunnel option ... but the outcome causes the same problem for me.

 

@alexderjuengere:

thx!

i'll try your method later when i got some time ... for now the open-g vi works perfect!

0 Kudos
Message 5 of 7
(3,397 Views)
Solution
Accepted by re-fuse

I also suggest removing the unneeded loops.  But in the future if you have a similar need in 2011 I'd suggest looking at this post I made a while ago.  It does some speed testing on various methods to do a conditional index.

 

http://forums.ni.com/t5/LabVIEW/Conditional-Auto-Index-Speed/td-p/2392500

 

As the thread mentions the methods are a bit off, but asside from that the pre-allocate method is the fastest, which is what I assume 2012 SP1 and newer uses internally.  One of the methods shown in that VI is the OpenG method which isn't the fastest or slowest.

Message 6 of 7
(3,294 Views)

thx hooovahh for the input! 🙂

the preallocate method works 3x faster than the method i was using.

0 Kudos
Message 7 of 7
(3,212 Views)