Jump to content

Recommended Posts

Hi All,

After struggling on my recent CLD-R with feedback nodes, I've decided to try using them in some projects. I've got stuck on my first trial however!

I've tried replacing a fairly common conditional incremental count within a For Loop, that I would usually do with a shift register, but I just can't get the correct result with a Feedback Node. Code is attached, is this a correct usage case for a Feedback node?

In the current configuration, when count value returned from the Shift Register is zero, the count returned from the same code using a Feedback node is 1. I've tried other configurations, but still get incorrect results.

post-15570-0-55740300-1334221983_thumb.j

Feedback Nodes.vi

Link to comment

The enable terminal will prevent the FEEDBACK VALUE (FV) being propegated not prevent the action of the +1 as it does in your top scenario. So,after initialisation (FV=0) you get an output of 1 since 0+1 =1.

So the feedback node is behaving as expected, however your shift register example is not equivelent.

Below is how the feedback node behaves in your example.(I agree with Todd-the enable terminal is not a good usage for this scenario).

Edited by ShaunR
Link to comment

I think this is a bad example usage of the feedback node. I would just use Add Array Elements and call it a day. Or if you feel like being complicated, keep the equality comparison and use the Boolean to (0, 1) node and iterative sum that.

Link to comment

Feedback Nodes have amazing potential that NI needs to unleash. The first step is to get this excellent idea implemented.

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/An-output-terminal-for-feedback-nodes-that-mirrors-the/idi-p/927458

This would solve this problem (the need to handle the last iteration as a special case), and also eliminate the need to wire the output of the FN through all frames of a Case Structure.

I have been lured many times by the siren song of the feedback node in this instance, so close, so very close, yet in the end, denied!

I like using them to build up dictionaries using variant attributes. Nice tight loop from variant out to variant in. Of course this is only after LV10 when they fixed an annoying bug which affected the combination of variants and feedback nodes (like they went out of their way to target two of my favorite things).

Link to comment

Yeah, I'm late to the game on this one.

<meme>I don't always use feedback nodes, but when I do, it's only when I don't need the output outside the scope of a loop.</meme>

No seriously, I don't see what feedback nodes bring to the table versus shift registers when you need to use the output outside of a loop. I would consider it if altenbach's idea made it in, but I still don't like them as much as shift registers because they break data flow insomuch as the initializer terminal (and would be final value terminal) isn't visibly linked to the actual feedback node. I find this can lead to confusion in all but the smallest loops.

I use them all the time on the top level of a VI for static data, but if it's in a loop, more often than not I use SRs.

Link to comment
I think this is a bad example usage of the feedback node. I would just use Add Array Elements and call it a day. Or if you feel like being complicated, keep the equality comparison and use the Boolean to (0, 1) node and iterative sum that.

Agreed.

Link to comment
No seriously, I don't see what feedback nodes bring to the table versus shift registers when you need to use the output outside of a loop.

1) In pipelining, particularly common in FPGA, they're critical. Of course, those are configured for feedforward, not feedback.

2) I'm told (and anecdotally find to be true) that electrical engineers are used to reading the feedback notation in other schematics. They read them much easier than the shift registers.

Link to comment

Of course this is only after LV10 when they fixed an annoying bug which affected the combination of variants and feedback nodes (like they went out of their way to target two of my favorite things).

Ugh, don't remind me of that. I based a low-level widely used component on this combination and I stress tested it before I started writing the relevant application to make sure it performs well, and it did. Fast forward to a couple of months later, when I test the app and lo and behold, this performs really badly. For a while, I thought that maybe my original tests were flawed (or worse, imagined). It took some debugging to understand that the bug only manifests itself with a particular combination which wasn't there when I ran the tests (I think it was if you use the initializer terminal to globally initialize the variant, so I ended up initializing it using a first call and select primitive).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.