10-26-2013 03:13 AM
Even if I read in the file outside of the for loop. I was not able to find a way for labview to iterate by two.
something like this;
for(int 1=0; i<5000; i+=2)
10-26-2013 03:20 AM
Do you want to say you wanted to access the elements like this
10-26-2013 04:23 AM
Dear Neos,
First Time it will access 2nd element not 0th element, 2nd time it will 3rd and so on. hence better use shift register
10-26-2013 04:30 AM
Is this OK?
10-26-2013 04:48 AM
Ranjeet_Singh wrote:
Dear Neos,
First Time it will access 2nd element not 0th element, 2nd time it will 3rd and so on. hence better use shift register
Please pay attention to the original discussion. User has 1D array from which he wants to use 2 elements at a time ( we still don't know How? ) and feed them to a subvi.
My thought from his iterate by two was , he wants to access 0th and 2nd elements, 1st and 3rd elements .........( May be I am wrong here )
You obviosly didnt see it correct.
because your attached image shows as if we want an element from an array like every iteration row no. are changing and column nos. are shifting by two.
Way shifted from target.
10-26-2013 05:48 AM
@kulsman wrote:
Even if I read in the file outside of the for loop. I was not able to find a way for labview to iterate by two.
something like this;
for(int 1=0; i<5000; i+=2)
You please pay attention.
10-26-2013 09:51 AM - edited 10-26-2013 03:29 PM
The solution by NEOS or Ranj are not really what you want. It seems you want "for(int i=0; i<5000; i+=2)" on the first element and "for(int i=1; i<5000; i+=2)" on the second element. Here's how you would do that.
Note that it is i=0, not 1=0, which would not make any sense.
Note that N needs to be wired at half the input array size (not shown). In the code I had attached earlier, I reshape the file into two columns, making everything simpler while getting two adjacent elements automatically. Have you looked at it?
It would seem more reasonable to read the file as U16 and splin inside the loop.
10-26-2013 12:12 PM - edited 10-26-2013 12:15 PM
No No Christian........
In my post i wasn't talking about solution
Don't get me wrong for that
I was actually asking what he wants, that i have mentioned n my post also saying i may be wrong
your solution infact as given me something if i would have done that probabaly ( i am sure ) it must have been rubed.
10-26-2013 02:30 PM
I want to personally thank altenbach, Neos, and Ranjeet_Singh for assisting me on this problem.
I have learned that it is a bad idea to read in file every iteration of the for loop. Also differences between N and I in the for loop.
I have implmented something similar to what altenbach proposed.
10-26-2013 03:39 PM - edited 10-26-2013 03:41 PM
@kulsman wrote:
I have learned that it is a bad idea to read in file every iteration of the for loop. Also differences between N and I in the for loop.I have implmented something similar to what altenbach proposed.
You are still doing things way too complicated.