LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I reinitialize a feedback node in a SubVI and in a timed loop

Solved!
Go to solution

Hi everyone

 

I have a SubVI counter in a timed loop (LabVIEW FPGA ) , in this SubVI I have a feedback node with some initial value , but when it is called multiple times , I noticed it take the last value in previous execution and not the initial value .

 

How can I resolve this issue ? the outer timed loop runs infinitely   

0 Kudos
Message 1 of 5
(879 Views)

Right-click on the feedback node and select "Move Initializer One Loop Out".  Wire an initial value to the initializer terminal.

paul_a_cardinale_0-1703765670913.png  paul_a_cardinale_1-1703765724142.png  paul_a_cardinale_2-1703765784061.png

 

 

 

0 Kudos
Message 2 of 5
(824 Views)

Or just wire the initialiser terminal at the bottom of the Shift Register, same effect.

0 Kudos
Message 3 of 5
(810 Views)

I tried this , but still it doesn't work and maybe because it is an infinite loop and from host the initial value get called only once . 

Still after first call , in the next calls the initial value is previous executed value 

 

Is there a way to solve this issue without shift register or move init out of loop?

ehsan11_0-1703781671250.png

 

0 Kudos
Message 4 of 5
(794 Views)
Solution
Accepted by topic author ehsan11

Hi ehsan11,

 

By definition, a feedback node gives the value from the previous call.

You can add a mechanism to reset your counter under some condition by doing this:

raphschru_0-1703783521621.png

Or similarly:

raphschru_1-1703783555245.png

 

Regards,

Raphaël.

0 Kudos
Message 5 of 5
(787 Views)