09-24-2010 02:54 PM
I am trying to go through an array but instead of autoindexing I want to skip every other element or maybe a number of elements that will be specified for the user.
Basic functionality that I want to acheive is the following in C code.
int temp_var = 10;
int i=0;
for(i=0; i<=1000; i=i+temp_var)
{
}
I am very new to LabVIEW and I did not know how to use internal variables.
Can this be acheived using shift registers?
I am attaching the code I currently have for this. Let me know what you think.
Thanks guys.
Solved! Go to Solution.
09-24-2010 04:01 PM
You need to implement this a a While Loop with a shift register to hold the index. The index must be changed by the step size. Here is the code:
I have been asking for a new For Loop style that would allow us to specify start, stop, and step conditions, but it seems that many people are just not for this idea. Don't know why?
09-24-2010 04:01 PM
I cannot see where you attempted to do anything with every other element or anything called temp_var. Do you want to process certain elements in the array called Gray Code or something in the 1D or 2D integer arrays?
Look at the Decimate functions and search the Forum for "decimation."
Lynn
09-24-2010 04:38 PM
I'm brain dead, I didn't even notice that the OP had attached some code. I just responded to his text. Time to go home.....
09-24-2010 09:26 PM
@tbob wrote:
I have been asking for a new For Loop style that would allow us to specify start, stop, and step conditions, but it seems that many people are just not for this idea. Don't know why?
I wouldn't say there aren't many people for it. The idea you linked to was one of a half dozen of basically duplicate ideas, including another one of your own.
These two ideas have a fairly large number of kudoes showing people want the idea.
09-28-2010 07:25 AM
I apologize for leaving out essential details in my first post. But you are correct I was trying to downsample in data acquisition. Thanks guys for your help.