LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback node inside subVI no longer appear to work

I am using feedback node in a subVI to create an integrator.  It use to work properly until last week.  Today, the output of the feedback node inside the subvi is always 0 although the input is changing.
 
This SubVi was created with Labview 8.2.1 and has worked flawlessly under 8.5 until today.  It was never opened for editing/monitoring until last week to do some troubleshooting as I was tracking the source of NaN calculation.
 
Is there an option to change the behavior???
0 Kudos
Message 1 of 9
(4,395 Views)
You probably have a bug in your code. Can you upload the VI?

___________________
Try to take over the world!
0 Kudos
Message 2 of 9
(4,389 Views)
That would not be surprising...  Here it is.  Use the Mold Simul8_5 project.  The Main VI is "New Gen".
0 Kudos
Message 3 of 9
(4,383 Views)
Here is your problem.  With LV 8.5 feedback nodes now allow the initializer terminal to be in the loop.  In the attached picture, you have a zero wired to it, so it gets initialized to zero on every iteration.  Right click on the feedback node and tell it to move the initializer node one loop out and wire the zero there.
 
I think you may have a similar problem in the loop near the top where you wire a value into the node and the initializer.  I think that would effectively cause it to take the current value on every iteration rather than the previous value.
 
I myself have never liked feedback nodes and prefer to use shift registers.  The way they can be placed in LV 8.5 has changed, so pay attention to that and check the help file on feedback nodes.


Message Edited by Ravens Fan on 01-02-2008 01:48 PM
Message 4 of 9
(4,376 Views)

Sorry, I was not clear enough.  The Node you point out in your response appear to work and the integrator function here is working.  My problem is with the one inside the subVI "resonator".  the vi is inside the while loop(2 instances).  The purpose is to create a resonator filter and it integrates the input signal.  See attached picture.

I am not sure how this is all implemented, but effectively the value seems stuck to the initialization value.  When I left click on the node, the option "Initialize Globally" is ticked but also greyed out.  It was my assumption that this means it is intialized only at first load, when the Vi starts.

Funny parts is this as been working for more than 2 months.  Today it stopped.  Last week I had problems with Nan numbers.  That was also funny because it was the first time I had that issue.  It seems that they were generated by the subVI "integrator".  I wanted to go back and understand why I had those.

I understand you preference for shift register but if you see how many node I am using, my main VI becomes  worse than a plate of spaghetti.  I like the new 8.5 feature but need to understand how it works and why the behavior changed.

 

0 Kudos
Message 5 of 9
(4,364 Views)
Maybe I am missing something obvious, but it seems to work just fine after setting "enable to true".


JMZanni wrote:

I am not sure how this is all implemented, but effectively the value seems stuck to the initialization value.  When I left click on the node, the option "Initialize Globally" is ticked but also greyed out.  It was my assumption that this means it is intialized only at first load, when the Vi starts.


How can it be stuck at the "initialization value" if you never initialize it??? 😮
 
It is greyed out because the subVI does not contain any loops surrounding the feedback node. It is never initialized and will contain the default value for the datatype on the first call.
 
0 Kudos
Message 6 of 9
(4,331 Views)
 

I noticed also that your Resonator.vi is duplicate in your code, however, it is not set as Reentrant Execution. This means that your Feedback Node will be shared between each execution. I think you want to set that VI to Reentrant and "maintains state for each instance". Have you tried to do that?

Additional to this, notice that LabVIEW has Module called "Control Design and Simulation Module" that allow you to "integrate", using higher order solvers (Runga-Kutta 4, for example), which would give better precision on your calculation. Also, I noticed that you have limiters and saturations, which all can be handled inside the simulation. Notice that you don't need to control time or feedback nodes to keep control of the simulation. All of this is abstracted for you.

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 7 of 9
(4,313 Views)

Thanks Barp.  Reentrant does the trick.  It was my assumption(obviously wrong) that the system automatically created the Vi's as separate instances.  I am fairly new at this and still have a lot to learn....

I will review your other comments too.  I followed the link and ooch a bit pricey.  I have a Developer Suite license.  Is this Add on included?  How can I check?

Note, this module is only use todevelop the control algorythm I want to implement on a real time CRio.  However I have issues with performance and still struggling with it. But this is another story. 

Thank you very much.

 

0 Kudos
Message 8 of 9
(4,302 Views)
Hi,
If you have the core developer suite package which is the most popular then the simulation module is not included.  If you have the control design and simulation option then  it is included.  If you want to check what your license covers you will need to contact your sales representative but I would guess that if you do not already have it installed your package didn't include it. 
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 9 of 9
(4,284 Views)