From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

feedback node global

Solved!
Go to solution

Were these just a fad? I stopped using them years ago because I heard they had performance problems. But I also heard that they were not intirely implemented correctly and NI was going to fix it.

 

Feedback Node Functional Global.png

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 1 of 9
(4,150 Views)

I haven't heard of any problems with them.

 

I tend to use the classic while loop, shift register, True wire to stop terminal version of a functional global.  But the feedback node method is generally functionally similar.

0 Kudos
Message 2 of 9
(4,133 Views)

For the example that you gave, you might as well use a global variable.

 

Feedback nodes were said to have some performance problems when they were introduced in 7.0, but I believe that since ~8.0 they should be fine. I certainly don't have problem with them and since the addition of the free-standing FN in 8.5 they have helped simplify some of my code. I would still use a while loop if I think that a shift register makes the code more readable.

 

The only later performance issue I'm aware of is that if you have a variant in a FN and you wire an empty variant to the init terminal, then you might run into some serious performance problems, but that was fixed in 2010 (or possibly 2011).


___________________
Try to take over the world!
0 Kudos
Message 3 of 9
(4,125 Views)

They are almost identical (Feedback is about 4-5% slower in my timing compairison tests) However, I've never noticed that having any impact on the code I write.

 

Instead, I've noticed that it can make significant impact on block diagram complication. I use to have a 1000 pixel wide loop with 4 or 5 wires always being wired through, now I can get rid of most of them (they were only used in one location each) and the block diagram appears a lot cleaner.

Certified-LabVIEW-Architect_rgb.jpgCertified_TestStand_Architect_rgb.jpg


"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books

0 Kudos
Message 4 of 9
(4,115 Views)

I have been playing on a AE twist that uses the FBN for private data where the resource API has standard Error in functionallity.  I can clear two sync barriers (the error case and the while loop) and improve "Close" functionallity so that close on error in is attempted.  No, I don't think its a fad..... just not fully understood where they can provide benefit.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 9
(4,101 Views)
Solution
Accepted by topic author PaulG.

39812294.jpg

Message 6 of 9
(4,082 Views)

I remeber doing a test not long ago and found that the FBN was slightly slower than the SR for creating FGVs.  I'll have to test it again with the lastest LabVIEW version.  I do remember back in the 8.6 days of Darren stating the the FBNs were faster due to not needing the loop overhead.  So a lot of my FGVs use feedback nodes.  I think they make it cleaner.  Some I work with think the SR is easier to understand.


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 7 of 9
(4,036 Views)

I've noticed the benchmarks tend to flip-flop between LabVIEW versions, depending on whatever changes/optimizations were made to the compiler. But with every release in recent memory, the benchmark differences have always been very small either way. So I consider the two approaches to have effectively the same performance, and thus, I prefer the feedback node approach...I find the code simpler and more readable.

0 Kudos
Message 8 of 9
(4,032 Views)

@crossrulz wrote:

I remeber doing a test not long ago and found that the FBN was slightly slower than the SR for creating FGVs.  I'll have to test it again with the lastest LabVIEW version.  I do remember back in the 8.6 days of Darren stating the the FBNs were faster due to not needing the loop overhead.  So a lot of my FGVs use feedback nodes.  I think they make it cleaner.  Some I work with think the SR is easier to understand.


There is simply no visable indication of how the initiallize terminal is configured in a FGV.  Of course this obfuscates the code.  I'm sure there is a IE post on it somewhere if there isn't a CAR written against this.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 9
(4,030 Views)