LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback Node Bug?

I came across an odd situation when using a Feedback Node where a established a delay of more than 1 iteration.  (LV2011)

 

I have a waveform datatype.  I wanted to delay the waveform by an iteration of the loop before displaying in a graph, so I added a feedback node.

Then I realized I wanted to delay it by a few more iterations, so I went into the properties and set the delay to be greater than 1.

Because I had stale data in the feedback node after 1 run, I wanted to intialize the feedback node, so I right clicked on the initializer terminal and picked create constant.  An array of waveforms was created, and this broke the output of my feedback node since it was wired to a scalar waveform type.

 

If I do not have a delay longer than 1, (more normal feedback node), then a scalar waveform is created and no problems.

 

 

Interestingly, I tried the same thing with the more basic numeric datatype, an array was created in one case, a scalar in the other, but the array did not break the output of the feeback node.  I'm not exactly sure what an array into the intializer would mean for a long delay feedback node.  It might make sense that it allows you to create an array of different initial values for each step, and this link on the web help mentions that http://zone.ni.com/reference/en-XX/help/371361H-01/glang/feedback_node/.  But the help embedded in LabVIEW doesn't mention that.  (See attached image.)

 

See attached snippet.

 

Download All
Message 1 of 4
(1,958 Views)

Hey Ravens Fan,

I agree with your assessment that this is not the expected behavior.  This was reported to R&D (# CAR 315474) for further investigation.  Is this something that is going to be holding you back such that we should try and find a work around?  

 

 

Kevin Fort
Principal Software Engineer
NI
Message 2 of 4
(1,906 Views)

Thanks.  It is no problem for me.  Once I disconnect the wire, pull out the waveform from the array container and connect that all is well.  I don't need the multiple element initialization.  The empty waveform is all I need it to output until the Z-order fills up.

 

Just to be clear, I think there are actually 2 issues here.

 

1.  The feedback node output is incorrectly copying the array waveform from the initializer when it should remain a scalar waveform element from the input side.  (I haven't tried to see if any other complicated datatypes or clusters do the same thing.)

 

2.  That help screen is lacking documentation on what it means to have an array of elements as the initializer.

 

The only other question I have is whether it is appropriate for an array of elements to be generated at the intializer rather than just an element.  A 1 item delay feedback node generates an element,  a 2 or more delay generates an array as default.  What is the difference in the feedback node that treats the creation of that constant differently if Z=1 vs. Z = 2 or more.  It is just a feedback node with a different delay.  While an array would make sense as a data for the initializer for multi-delay feedback nodes, it is just as valid to have a single element as the input if you want the same output to repeat.

Message 3 of 4
(1,890 Views)

@Ravens Fan wrote:

The only other question I have is whether it is appropriate for an array of elements to be generated at the intializer rather than just an element.  A 1 item delay feedback node generates an element,  a 2 or more delay generates an array as default.  What is the difference in the feedback node that treats the creation of that constant differently if Z=1 vs. Z = 2 or more.  It is just a feedback node with a different delay.  While an array would make sense as a data for the initializer for multi-delay feedback nodes, it is just as valid to have a single element as the input if you want the same output to repeat.


I say yes, it is appropriate to generate an array for a node with a delay > 1, especially given the connection to the unilateral Z transform.  However, you are under no obligation to provide an initial value for all values, you can put a single value into the array and it is equivalent to the scalar input.  You can even put two values in and the second will be repeated until the delay is reached.  With the SR you have to initialize all or none.

 

Not everyone has my handy-dandy QD shortcut to convert scalars to arrays (why not?), but I still think it is easier to either live with single element arrays or rip the constant out of the array and rewire than it would be to create a scalar and then reach for the array container or build array.

 

My 2c, I rarely increase the delay personally, but I do not do FPGA either.

0 Kudos
Message 4 of 4
(1,876 Views)