kodon1 Posted December 19, 2014 Report Share Posted December 19, 2014 Hi, I need to implement some sort of a 'search 1D array' function, but only with simple functions. This means that I can use loops and cases and other simple functions (numeric. boolean, comparison) but not much more than that. The challenge that I'm facing is to create a smaller array out of a bigger one. I wasn't able to find a way up until now. Hope that you'd have some ideas. thanks Quote Link to comment
crossrulz Posted December 19, 2014 Report Share Posted December 19, 2014 Use a FOR loop with a coniditional terminal. Autoindex in the search array. If the current item matches the search parameter, you stop your loop and pass out the data. Quote Link to comment
kodon1 Posted December 19, 2014 Author Report Share Posted December 19, 2014 thanks. so I stop the for loop when the first value is found, but then I want to keep searching the array... should I use some sort of an outer loop? Quote Link to comment
crossrulz Posted December 19, 2014 Report Share Posted December 19, 2014 That is different requirements from the Search 1D Array. If you want the all of the indecies that match, then still use the FOR loop, but use a conditional indexing output tunnel that is wired to the i terminal. Your condition should be if the current item matches the lookup item. Quote Link to comment
kodon1 Posted December 19, 2014 Author Report Share Posted December 19, 2014 ok. thanks for the tip. when you say - 'conditional indexing output tunnel' is it a straight forward option of the for loop? I wasn't aware of that Quote Link to comment
crossrulz Posted December 19, 2014 Report Share Posted December 19, 2014 Make an wire up the i to the right border of your FOR loop. It should default to an indexing tunnel. You can right click on that tunnel and select "conditional". I think it came out in LabVIEW 2012. Very useful tool. Quote Link to comment
kodon1 Posted December 19, 2014 Author Report Share Posted December 19, 2014 Thanks a lot. That was very very helpful!! Quote Link to comment
hooovahh Posted December 28, 2014 Report Share Posted December 28, 2014 Conditional indexing on For and While loops was added in LabVIEW 2012, which should be an issue because you are using...LabVIEW 2015... 1 Quote Link to comment
eberaud Posted December 30, 2014 Report Share Posted December 30, 2014 That's what we call a visionary! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.