LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bypassing shift registers

Solved!
Go to solution

Being a beginner, I was experimenting with loops and shift registers. Originally I had an add operation that added 1 each time and the results passed back around via a shift register. Maybe I was thinking of op amps at the time but I thought why not just loop the output back to the input instead of going thru the shift register. Seems to work, is it a reliable design?

 

thanx,

 

jh 

0 Kudos
Message 1 of 4
(3,046 Views)
Solution
Accepted by topic author jvh75021

Hi jvh,

 

a feedback node is (more or less) the same as a shift register, so both will work here...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,040 Views)

jvh75021 wrote:

Maybe I was thinking of op amps at the time but I thought why not just loop the output back to the input instead of going thru the shift register. 


 

 

 Your shift register has absolutely no function here, because you never even use its output anywhere. Click on the shift register and delete it. Run the VI again. Notice no real difference! Now you could right-click the feedback node and "replace it with shift register and still retain about the same functionality. Shift registers and feedback nodes are interchangeable to some degree.

 

Important Details: Shift registers and feedback nodes are not completely equivalent. Notable differences exists in the way they can be initialized. A feedback node does not require the presence of a loop (at least in newer LabVIEW versions) and shift registers cannot be globally initialized. Feedback nodes can exist entirely inside a single case of a case structure. Shift registers require a loop on the same subdiagram. Shift registers can be resized on the left to access earlier histories. Feedback nodes can only access one history (selectable in newer versions).

 

Shift registers and feedback nodes are central to elegant and efficient code, so make sure to become completely familiar with them. New users often do ugly local variable hacks to approach some of their functionality. 😄

Message 3 of 4
(3,019 Views)

Apologies for the late reply but I agree that the shift register is not used. I forgot to cut the last line when I added the feedback loop.

 

I really appreciate the detail notes you provided, really good and useful info.

 

Thanks again,

 

jvh 


altenbach wrote:

jvh75021 wrote:

Maybe I was thinking of op amps at the time but I thought why not just loop the output back to the input instead of going thru the shift register. 


 

 

 Your shift register has absolutely no function here, because you never even use its output anywhere. Click on the shift register and delete it. Run the VI again. Notice no real difference! Now you could right-click the feedback node and "replace it with shift register and still retain about the same functionality. Shift registers and feedback nodes are interchangeable to some degree.

 

Important Details: Shift registers and feedback nodes are not completely equivalent. Notable differences exists in the way they can be initialized. A feedback node does not require the presence of a loop (at least in newer LabVIEW versions) and shift registers cannot be globally initialized. Feedback nodes can exist entirely inside a single case of a case structure. Shift registers require a loop on the same subdiagram. Shift registers can be resized on the left to access earlier histories. Feedback nodes can only access one history (selectable in newer versions).

 

Shift registers and feedback nodes are central to elegant and efficient code, so make sure to become completely familiar with them. New users often do ugly local variable hacks to approach some of their functionality. 😄


 

0 Kudos
Message 4 of 4
(2,868 Views)