04-10-2013 02:46 AM
Hi all !
I'm using a SubVI which adds a cluter of parameters to an array, and then sort this array depending on one of the parameter in the clusters.
This works fine, thanks to the examples I found in this forum 🙂
but now I'd like to know if there's any way to get at the end the new index of the cluster firstly added.
see VI attached
Thanks
Solved! Go to Solution.
04-10-2013 03:04 AM
You are taking the size of the array and inserting the new element at that index this is nothing but build array and a simple build would do this.
In your question I guess you are asking about the index of the element that you inserted after sorting the array, right? In this case you can compare the cluster element you are inserting at the initial with the array of cluster that you get after sorting the array. So this will give you the index of the element that you are inserting initially.
04-10-2013 03:22 AM
Hi
You will get the indices of the elements, in the order of sorting from the second For Loop..use these indices to identify the index of the last element that was added.
attached is an image of how it should work
04-10-2013 04:13 AM - edited 04-10-2013 04:17 AM
"You are taking the size of the array and inserting the new element at that index this is nothing but build array and a simple build would do this."
thanks for the tip ^^ I've been using LabVIEW for a few mounths now but I'm still not familiar with some basic things...
"You will get the indices of the elements, in the order of sorting from the second For Loop..use these indices to identify the index of the last element that was added."
it works also very well !
thanks for both answers, my main VI now works as expected 😛