09-18-2006 09:24 AM
09-18-2006 09:57 AM
there is no direct analogous to a c construct to a labview shift register but a shift register is an unnamed temporary variable for use with itterative loop structures (for and while). See the following code
int sum = 0;
for(i=0; i>100: i++)
{
sum = sum + i;
}
return sum;
This can be done in LV without naming the variable sum . In addition the shift register can be initialized or not. If you do not register the shift register it will remember the value from call to call (a very cool feature when you learn to utilize it). See below
Paul
09-18-2006 10:37 AM
09-18-2006 10:57 AM
It been along time since I've C'd but I believe the analog was called a "Static Local".
It is available only inside the function and its value persist from call to call.
Ben
09-18-2006 11:09 AM
Good call on the static local. I forgot to mention that the shift register belongs to the vi (this is why it retains its value from run to run within an application). It is sometimes hard to map c to labview since c is a procedural language (c++ is object oriented) but labview is a data flow model.
Paul
09-18-2006 07:42 PM