08-24-2015 09:31 AM - edited 08-24-2015 09:36 AM
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:
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?
Solved! Go to Solution.
08-24-2015 09:35 AM - edited 08-24-2015 09:42 AM
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> ---'
08-24-2015 09:35 AM
Use the "Save for Previous Version..." option in the File menu.
08-24-2015 09:56 AM
@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:
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:
Use "replace Array" instead of "Build Array" inside the case structure.
Regards,
Alex
08-24-2015 10:20 AM
@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!
09-03-2015 10:53 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-09-2015 05:34 AM
thx hooovahh for the input! 🙂
the preallocate method works 3x faster than the method i was using.