LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialising Shift Registers

Hi

I am totaly new to labview so assume that this question can be easily solved!

I am trying to implement a FIR filter (can't use pre-designed sub vi's because it must operate in accordance with a specified transer function).

I think I have the design sorted except that I am having trouble with initialising shift registers. I can't get them to work,

any help would be apriciated.

Chris
0 Kudos
Message 1 of 6
(3,749 Views)
I think to initialize the shift register, you just have to wire a constant to the left of it. Put the constant outside of your while or for loop. I hope this helps. Goodluck!
0 Kudos
Message 2 of 6
(3,749 Views)
Initialization is done by wiring the initial value into the left hand terminal of the shift register (from the outside of the loop). If you choose the wire tool and let i hover above the left hand terminal you will see that it has a wire entrance on it's left side.
0 Kudos
Message 3 of 6
(3,749 Views)
One caution on initializing shift registers. If you use this bit of code in a sub-vi, the shift registers will get re-initialized with the constant value each time the sub-vi is called. This will change the way the sub-vi behaves as values from previous calls will be overwritten.


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 6
(3,749 Views)
In such cases instead of initializing the register by wiring something to the left terminal, use the "first call" function from the advanced-> synchronization palette and do the initialization inside the loop in the true part of a case structure with the first call status as input.
0 Kudos
Message 5 of 6
(3,749 Views)
You're correct. I should have mentioned this technique.

The attached image shows how to do this.

The "First Call" function will only produce a True the first time a VI is called, so the shift register will get initialized the first time the sub-vi runs, then the shift register will retain the value after each call.


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 6 of 6
(3,749 Views)