06-05-2012 04:31 PM
Sorry, it was really out of topic. Could you explein the shift register in the sample, please ?
06-05-2012 04:33 PM
There's nothing to explain. Using a shift register is easier than extracting an element and then replacing that same element in the case that you don't want to calculate the derivative (the false case of the case structure). In the false case, it's just a straight-through wire.
06-05-2012 04:45 PM
Sorry, I still do not understand why the shift register is used. What would happen without it ?
So False case is not necessry, is it ?
06-05-2012 04:48 PM
Shift registers are a basic LabVIEW concept. If you don't understand what's happening here, put together a simple VI that you can run on your desktop - it can be identical to this one, but with a standard while loop instead of the timed loop - and play with it. Note that the image I posted is a "snippet" - it's real code. You can drag the image directly into a LabVIEW VI, as long as you're using LabVIEW 2009 or newer. Depending on your web browser, you might have to drag the image to your desktop first, then drag from there into a VI.
06-05-2012 05:28 PM - edited 06-05-2012 05:28 PM
I am probably so stupid or tired and go to bed, because it is behind my mind....
I know that shift register is used to transfer data from prev. iteration to next iteration. as well as feedback node. It is writen everywhere. Nothing more. I understand it in counter but here not. In my view of understainding it should work even without Shift register but it does not as I found.
06-05-2012 06:36 PM
The shift register contains the entire array. If you remove the false case, then it will calculate the derivative for every value in the array and the "Channels to Derivate" control will have no effect (because it won't be connected to anything). In each iteration of the loop, when you calculate the derivative you update the array, so you need to keep the array in a shift register. If you use a tunnel instead, the array is reloaded at the start of each loop iteration, discarding the changes.
06-08-2012 02:54 PM
Thanks for explanation. I understood it a few minutes later I had posted the reply. ( Lying in the bed )
But why is there only one shift register for y(k) and not another one for y(k-1) ?
06-12-2012 09:55 PM
@charlie87 wrote:
Thanks for explanation. I understood it a few minutes later I had posted the reply. ( Lying in the bed )
But why is there only one shift register for y(k) and not another one for y(k-1) ?
Sorry for the delay, perhaps you've figured this out by now. You don't need a shift register for y(k-1) because it's not being changed in the loop.