|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Storing a variable outside of a loop
We're trying to work on our acceleration algorithm. At first we were going to go with the accelerometer, but the thing is actually a lot more unpredictable than we thought, so we now want to use just a straight line for acceleration, something like y=mx+b. Only problem is, we can't seem to figure out how to store the previous y, since y will become b the next time around the loop. I know how to do this in php, but I have NO idea about LabVIEW.
Since what I just said could be kinda confusing, here's how I would have coded it if robots could run php: PHP Code:
|
|
#2
|
|||
|
|||
|
Re: Storing a variable outside of a loop
What you want in LabVIEW is a shift register (or a feedback node). Select Help->Search Help
and type Shift Registers Select "Using Shift Registers to Remember Iteration Values " I would provide you an example, but I'm pressed for time at the moment. One other note: I know you said storing a variable outside a loop and a shift register requires a loop. However, the beauty is that the loops doesn't have to actually do anything. Frequently, LabVIEW programs make use of loops that only execute once (e.g. while loop that is wired to stop after one iteration) and the only purpose of the loop is to allow it to have a shift register. The newer versions of LabVIEW (I think starting with LabVIEW 8.0) have Feedback Nodes that you can use without loops, but they do the same thing as the shift register. -Nate Last edited by airnate : 14-02-2009 at 19:07. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing functions to variables | Tz0m | Programming | 8 | 18-02-2007 11:36 |
| Storing the balls | Max Brin | Technical Discussion | 4 | 18-02-2006 20:34 |
| Storing Tetras on Robot | MisterX | General Forum | 22 | 15-01-2005 19:26 |
| SCORing vs. STORing | Chris Fultz | General Forum | 3 | 15-01-2004 13:36 |