04-27-2016 06:41 AM
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
Solved! Go to Solution.
04-27-2016 06:49 AM
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".
04-27-2016 06:54 AM
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.
04-27-2016 07:11 AM
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.
04-27-2016 07:17 AM
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
04-27-2016 07:17 AM
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
04-27-2016 07:22 AM
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".
04-27-2016 07:26 AM
Also this piece
04-27-2016 08:18 AM
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
04-27-2016 08:48 AM
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.