The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Initialisation of Feedback Nodes #2

SercoSteveB
Active Participant

The following VI was created, saved and then executed twice.  What is the value of Numeric Value Out following the second execution of the VI?

Feedback Nodes 11_03_2015.png

a) 8

b) 16

c) 32

d) 64

Comments
crossrulz
Knight of NI

D


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
whitecr
Member

And: A

What ever the time user may run this vi. During first iteration of for loop the 0 and 1 are initialized in the feedback node. So at the end of the execution we will get 8.

Ans: D

Crossrulz is correct:

In the above VI intilize on compile or load is selected so if it run twice we will get the ans as 64.

Nice question stev for all these days i am using feedback node I didnt notice this option.

Today I learned a new thing.

Thanks steve.

whitecr
Member

Hi Steve previous question and this looks like same

sathishp91
Member

D

LordNobady
Member

D

@whitecr

It is differend. watch the top feedback node.


Learning LabVIEW since January 2013
hemanth.wnp@gmail.com
Member

A

Hi Steve Previous question and this one is same.

SercoSteveB
Active Participant

I was a bit mean doing two questions that appear to be identical on consecutive days.....but that's how I roll. 

Check out tomorrow for more on the same theme.

MrStevenUND
Member

Top feedback node initializes when VI loads or compiles.  Bottom one initializes on first call of the VI (ie, every time the user presses the run arrow)

Ans: D.

I predict tomorrow's will have the rhombus, which initializes on first call of the vi...  

http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/block_diagram_feedback/

SercoSteveB
Active Participant

Close.....but no cigar.

ashwinilele
Member

D

rsmrostov
Member

I would say A, the majority claims D however, can someone please explain why?  both feedback nodes are initialized one by the loop counter (so every time it's ran the init value is 0) one is moved to the outside of the loop initialization which will also initialize every time the loop is ran (just like a shif register).

sorry, looked under the previous question, but posted here.

rsmrostov
Member

D

mini09
Active Participant

That was a nice point to be noted in this post. Agreed with D.

SercoSteveB
Active Participant

Answer: D.  Nice one crossrulz, whitecr, sathishp91, LordNobady, MrStevenUND, ashwinilele, rsmrostov & gnshmrthy.

A bit sneaky this one, but it always pays to read the question.

echacon95
Member

Not familiar with the concept of feedback node. Would someone mind explaining the block diagram and how the value of 64 results?

crossrulz
Knight of NI

Feedback Nodes behave exactly the same as shift registers: they return the value from the previous iteration.  The difference here is when the shift register is initialized: on first call vs. globally initialized (on load).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
M.P.Bharghavi
Member

Ans:D

64

Simha@999
Member

In labVIEW 2020sp1 , I have ran the VI twice but even though answer is 8

Naidu00_0-1712567111504.png

 

Simha999
crossrulz
Knight of NI

Naidu@00, your problem is how the top Feedback Node is initialized.  Right-click on it and choose Globally Initialize->Initialize On Compile Or Load.  What this does is cause the top FBN to keep the value from the last run while the bottom FBN will re-initialize between runs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Simha@999
Member

Oh, I see Thanks Crossrulz

Simha999