11-09-2005 08:49 AM
11-09-2005 08:58 AM
11-09-2005 09:05 AM
Hi LabLeo,
I unfortunately cannot open you vi's at this time because i do not have LV installed at my customer's site.
However, I can suggest the following:
Shift registers are used within a loop (while, for) to pass the last value to the next iteration of the loop. You can initialize the shift register from outside the loop with a default value (shift register to the left of the loop). I think that in your example, the last value would be Vo. At time t=0, you could initialize the shift register to 0 (Vo = 0 for the first iteration). You would pass the sampled speed V1 to the shift register on the right of the loop and it's value would be Vo in the next iteration.
As for storing two values, you have to be careful if you want both in shift registers. For instance if you expand the shift register down (multiple shift registers), it becomes a buffer... the top value works it's way down. But in your example, you don;t really need to store the 2 values, do you? You're newly sampled velocity should be used in the present calculation and passed to the shift register. As for the old one, it is "dropped" at the end of the loop.
Unless you want to keep track of acceleration.. (I can't see your vi). If so, then creating an array would be better.
Hopefully the explanation of the shift register helps. If no one else posts a reply, you can post a jpg image of your vi. I can then look at it from work.
Thanks,
Ray
11-09-2005 09:16 AM
Hi LabLeo,
Please take a look at the following example...
Hope this helps!
Alex
11-10-2005 03:22 AM
Hi
Thank you very much. Now it works. Attached you will find the program. Now I need to adjust the car with the program. Hope this also works.
One more question. Why isn't it possible to use a Numeric Control twice?
Because I wanted to use the Numeric Control that I use for the time constant (time) also for the calculation of the acceleration.
That doesn't work. Than I placed a Numeric Indicator to display the value of the time constant. But it just displayed the default value.
Bye
11-10-2005 03:33 AM - edited 11-10-2005 03:33 AM
Message Edited by GerdW on 11-10-2005 10:33 AM
11-10-2005 03:35 AM
11-10-2005 05:55 AM
Sers
I hope the picture makes it obvious what I am going to do.
I want to use the time constant on top also as the divider for the acceleration function. But when I just connect it to the input of the divide function it doesn't work.
Bye
11-10-2005 06:12 AM