LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting 2 ports introduces "Feedback Node"

Solved!
Go to solution

Hello,

 

While connecting 2 ports LabVIEW imposes Feedback Node.

What could be a reason of this ?

 

Thanks.

 

P.S. The code is huge, so I've put just a fragment

 

initialization_feedback_node.JPG

0 Kudos
Message 1 of 13
(4,276 Views)

That happens when LabVIEW sees a circular connection (output of A going to input of B which has an output going to A).  I turn that setting off by going into the options (Tools->Options), then Block Diagram, and then uncheck the "Auto-insert Feedback Node in Cycles".


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
0 Kudos
Message 2 of 13
(4,270 Views)

Have you tried to remove the feedback node and see if still can run the code?

 

Just a hint, if your code is so big you need to make it more modular, i suggest that if you have time to rewrite using best practices.

 

 

Guilherme Correa
0 Kudos
Message 3 of 13
(4,267 Views)

crossrulz a écrit :

That happens when LabVIEW sees a circular connection (output of A going to input of B which has an output going to A).  I turn that setting off by going into the options (Tools->Options), then Block Diagram, and then uncheck the "Auto-insert Feedback Node in Cycles".


I was also thinking about it. But in my case the wire, where Feedback Node is introduced, is input for a Fitting Block, i.e. this input is termination for the wire.

I've followed your suggestion (i.e. uncheck "Auto-insert Feedback Node in Cycles") ... indeed, this time there is no feedback, but wire remains invalid, exposing the following error: Wire: Is a member of a circle 

Then I've tested another solution - imposing execution order by introducing error constant (please, see the image below), this time Feedback node on error wire is introduced.

initialization_feedback_node (1).JPG

0 Kudos
Message 4 of 13
(4,256 Views)

Guilherme_Correa a écrit :

Have you tried to remove the feedback node and see if still can run the code?

 

Just a hint, if your code is so big you need to make it more modular, i suggest that if you have time to rewrite using best practices.

 

 


When I remove feedback node, the wire becomes broken, when I reconnect borken edges, feedback reappears.

The place where it occurs is a particular state in state machine. This state contains a lot of small peaces of processing parts ... so difficult to make it modular

0 Kudos
Message 5 of 13
(4,250 Views)

It really is difficult to tell where, in the tangle of wires of which you only show a part, the feedback (circle) is located.  We've handled huge VIs before, and sometimes have been able to suggest specific ways to "improve" the code (for myself, I've adopted a principle I learned from Peter Blume's "LabVIEW Style Book" to ensure every Block Diagram fits on a single "reasonable-sized" Screen).

 

Please attach your VI (as a VI so we can edit or otherwise manipulate it).  We have a much better chance of being helpful with full information.

 

Bob Schor

0 Kudos
Message 6 of 13
(4,248 Views)

Bob_Schor a écrit :

It really is difficult to tell where, in the tangle of wires of which you only show a part, the feedback (circle) is located.  We've handled huge VIs before, and sometimes have been able to suggest specific ways to "improve" the code (for myself, I've adopted a principle I learned from Peter Blume's "LabVIEW Style Book" to ensure every Block Diagram fits on a single "reasonable-sized" Screen).

 

Please attach your VI (as a VI so we can edit or otherwise manipulate it).  We have a much better chance of being helpful with full information.

 

Bob Schor


Ok, thank Bob

 

Here it is.

The phenomena occurs inside the state "PROCESS".

 

Download All
0 Kudos
Message 7 of 13
(4,235 Views)

Also this piece

0 Kudos
Message 8 of 13
(4,225 Views)

Found your loop.  Here's what I did you "reduce" your Block Diagram and make it easier (not easy, just easier) to follow -- I used the Clean Up Diagram tool (the "broom" on the top toolbar, the right-most tool) to reduce the height to about a screen and the width of the big Case structure to about two screens.  I could then spot the Feedback Loop and understand why it was present.

 

You introduce an input to your Lev-Mar solver, "Initial Parameters", but you do not calculate them before you call Lev-Mar, but instead after, using the results from Lev-Mar to (eventually) make their way into the small Case Structure to the right (the output of which is the input to the Feedback Node).  Bad!

 

You really need to calculate your Initial Parameters first, using no knowledge of the output of the Solver, but based solely on the data points that Lev-Mar is using (or your own intuition of what you think the results will show). 

 

Bob Schor

0 Kudos
Message 9 of 13
(4,204 Views)

Bob_Schor a écrit :

Found your loop.  Here's what I did you "reduce" your Block Diagram and make it easier (not easy, just easier) to follow -- I used the Clean Up Diagram tool (the "broom" on the top toolbar, the right-most tool) to reduce the height to about a screen and the width of the big Case structure to about two screens.  I could then spot the Feedback Loop and understand why it was present.

 

You introduce an input to your Lev-Mar solver, "Initial Parameters", but you do not calculate them before you call Lev-Mar, but instead after, using the results from Lev-Mar to (eventually) make their way into the small Case Structure to the right (the output of which is the input to the Feedback Node).  Bad!

 

You really need to calculate your Initial Parameters first, using no knowledge of the output of the Solver, but based solely on the data points that Lev-Mar is using (or your own intuition of what you think the results will show). 

 

Bob Schor


Thanks a lot Bob,

 

Indeed, in the version that I posted the entries fit_pars_X, fit_pars_Y and fit_pars_Z were not properly initialized (empty arrays).

In the actual version (I've also modified some other staff in the "PROCESSING" state) these arrays are properly initialized (please see the snapshot below).

Nevertheless the problem persists.

In this new version all entries are defined: fit_pars_X, fit_pars_Y and fit_pars_Z and also "Fitting Parameter Initialization" control.

 

Concerning  Clean Up Diagram ... sure I'm aware of it, but I didn't like the results of its job: in my diagrams I try to arrange the blocks in certain order, but Clean Up Diagram brokes it.

 

initialization_feedback_node (3).JPG

 

0 Kudos
Message 10 of 13
(4,193 Views)