FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback Node

When I try to use a feedback node I get the error "Feedback Node: Node not supported in current target". What do I need to to to store a previous value in a VI subnode?

0 Kudos
Message 1 of 6
(9,940 Views)

You can use a shift register on a while loop (see below).  After you drop a while loop, right click the outside and choose add shift register.  Another comment if you look at the bottom left corner of the picture I uploaded notice it is orange and says NXT.  If you have this as your target you shouldn't get things on your functions pallete that aren't available on the NXT.

-Steve

Mentor

Team 4150

shift register.JPG

0 Kudos
Message 2 of 6
(3,755 Views)

Steve,

Thanks for the feedback. I have been using shift registers. I want to create a set of sub VI's for things like filters. The only way that I have been able to do this is by sending the feedback signal out of each VI in the hierarchy back up to the top while lloop, connecting it to a shift register, and then wiring the old value as an input down the VI hierarchy to my low-level VI. This works for one or two filters. It gets very old when I need to wire many more than this.

I have tried adding while loops around the filter Sub-VI to store my state. This ends up calling my filter either 0 times or two times. I can not figure out how to get the shift register to give me a past value and to run the filter only one time. Here is a picture of the test Sub-VI. This one does not pass the old value through when I call it from within a parent VI while loop:

Shift Register.png

I tried using a local variable. This works until I try to wire the output of a summer through the local variable and back to the input of the summer. Labview adds a feedback node automatically for me. Isn't that special.

Z1_ic_1.pngZ1_ic_2.png

This Z-1 works great. The problem is when I wire it up in my parent VI I get the following:

ParentVI.png

What good is a Z-1 block when Labview keeps adding a block to break an algebraic loop that isn't really an algebraic loop?

Here is what my navigation program looks like when I have to wire all of the Sub-VI Z-1s back to the parent shif register. I only need one or two shif registers if I find a way to do a feedback node in the Sub-VI's.

Nav.png

Help.

0 Kudos
Message 3 of 6
(3,755 Views)

The first approach you took is the recommended way to accomplish what you are attempting. Just to make sure, I just ran a test with this as my caller.vi:

caller.png

and this as my callee:

callee.png

I targeted my NXT and ran the Caller on it. As I would expect, the NXT display counted up from 1 to 10. I did not see any double calls or skipped calls as you experienced. Does the simple case that I have shown here work for you?

Tony

PS: This is my first attempt at using LabVIEW's code snippets in a document like this. It if works, you should be able to drag these images to a block diagram and it will copy the code in there. Good luck!

0 Kudos
Message 4 of 6
(3,755 Views)

This problem seems to occur when I try to create my own feedback node (Z-1). If I build the entire filter, integrator, PID controller inside of the while loop, things appear to work. Here is a test parent and its child sub-VI accumulator. These seem to work.

Accum_Test.pngAccum.png

The image on the left is the test block. I run the while loop 5 times. The image on the right is the accumulator. The sub-VI accumulates the input signal. The frustrating thing is when the students wire an output from a summer back into one of the input pins, they get a feedback node by default. This causes an error. I don't understand why the Labview target environmen won't support a default behavior of the tool. Very frustrating.

Thanks very much for the help. The comments were very useful. Yay

0 Kudos
Message 5 of 6
(3,755 Views)

Well, I'm glad you figured it out. I see what you mean with the Feedback Node. LabVIEW (obviously) has different compilers for windows and the NXT. The NXT compiler is not nearly as feature rich or optimized as the Windows one, which accounts for the differences in what is supported by each target.

It is frustrating and confusing that the editor auto-inserts something that the compiler can't support. Ideally, the NXT compiler would add support for the Feedback Node, but, frankly, that is unlikely to happen soon. If this is really confusing students, you can turn off "Auto-insert Feedback Node in cycles."

To do so:

1. First switch to the Full LabVIEW environment, not the Lego Mindstorms environment. This will allow some of the more advanced menu items show up. Tools>>Choose Environment.

2. Open the Options window. Tools>>Options

3. Select Block Diagram as the Category, uncheck "Auto Insert Feedback Node in cycles" and hit OK.

4. Switch back to the LabVIEW for Lego Mindstorms environment. (If you don't, you will lose the simplified startup screen and easy access to the robot project, Schematic Editor and Remote Control.)

If you need this done for many computers, it may be quicker to simply add the following line to the labview.ini file:

autoInsertFeedbackNode=False

You can typically find this file here: c:\program files(x86)\National Instruments\LabVIEW <version>\labview.ini

Happy Robotting,

Tony

0 Kudos
Message 6 of 6
(3,755 Views)