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: 

Labview Feedback Array Problem

Hi everyone,

 

I'm transferring a Simulink controller model to LabVIEW to realize controller function on myRIO. The model of controller is just composed of some arrays and matrix. However, when I was programming on LabVIEW the same way as the Simulink model, all the value after the feedback loop turn to zero.

Please see the attached images and the vi. document is also attatched.

Thank you!

 

Kind Regards

Chenzhe Xiao

0 Kudos
Message 1 of 3
(1,934 Views)

Where do you see arrays turn to zero?

 

On your front panel image, I see 2 arrays that are empty.

 

I think the problem is you don't initialize your feedback node.  So its default value is an empty array, and when you add an array to it, you wind up with an empty array.

 

Try something like this which will initialize the feedback node with an array of zeroes the same size as the array you are putting in.

 

polytopic_BD

0 Kudos
Message 2 of 3
(1,904 Views)

... and please bring some sanity to your diagram!

 

You are building the same 1D array four different times from diagram constants. Wouldn't once be sufficient? You can use a single array diagram constant before the loop and branch to all the places it is needed.

Same for your two matrices. Just use two matrix diagram constants! (the two 2D matrices differ slightly. Is this as intended?)

 

Some of your code constructs are pretty silly, for example the following code produces quite predictable output, right?

zero.png

0 Kudos
Message 3 of 3
(1,887 Views)