LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Output Values into an Array?

Please Help.

 

I am trying to create a fancurve model for an HVAC system in LabVIEW. The trouble I am having is initializing my array to take in 17 iterations, as well as displaying the output into an array. I am not sure if using the formula node is the best option for my code but everything seems to work except the array.

 

 

Thank you

0 Kudos
Message 1 of 13
(5,078 Views)

Hi Austin, please upload for an older version (say LV 2012) using the File >> Save for previous version... buttons.

Message 2 of 13
(5,059 Views)

here is version 12

0 Kudos
Message 3 of 13
(5,052 Views)

Let me start by saying that I don't think I've used a single formula node in any of my programs, but I think I see your confusion of arrays. 

  • Each time the formula is run you will calculate a value DP. To get the array of each iteration's result, simply wire DP over the edge of the for loop. You will get an auto-indexing tunnel with the array at the output. 
  • For the input, it looks like you are using "i" as an index in your calculation. In that case, get rid of the initialize array stuff. Just wire the "i" from the for loop into the "i" of your formula. Get rid of the line in your formula which sets i equal to an array.
  • I don't know why Density and VFR are built into 2D arrays, as it looks like you only use a single index in your formulas. I would get rid of those 2 build arrays. Better yet, take Density and VFR outside of the for loop and wire them in through an auto-indexing tunnel, it will do the indexing for you. Then get rid of the [i] in your formula.
  • Waveform chart is meant to take points as you read them, so you could update this inside the loop. 
  • Waveform graph is meant to take an array of points, so update this just outside the for loop.
0 Kudos
Message 4 of 13
(5,040 Views)

Fairly close and some fundamental misunderstanding on formula node. I've tweaked it some, you created 2D arrays and sent in dummy variables which isn't needed.

Formula node'.png

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 13
(5,022 Views)

@Yamaeda wrote:

Fairly close and some fundamental misunderstanding on formula node. I've tweaked it some, you created 2D arrays and sent in dummy variables which isn't needed.


Why not just autoindex on the input arrays with the FOR loop? Then you don't need the i input to the formula node.


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 6 of 13
(5,018 Views)

But the code needs to run for multiple values of VFR ( from 0 to 4000 in increments of 250). So how wouldn't I use VFR in an array? I created density as an array because the code did not like me using one value for an array.

0 Kudos
Message 7 of 13
(4,975 Views)

It would still be an array, but you pick off each element by passing it through an auto-index terminal. You are currently indexing inside your formula node with "[i]" notation. You could also do it with "index array" in LabVIEW. Or you can use the auto-index terminal. The following 3 pieces of code give you the same result, but the auto-index terminal makes it much neater.

 

 

0 Kudos
Message 8 of 13
(4,969 Views)

Insert image wasn't working earlier, here is the snippet:

 

temp.png

0 Kudos
Message 9 of 13
(4,957 Views)

I understand the auto-indexing now. Thank you. But I am still having trouble generating the VFR array from 0-4000 in increments of 250, to generate and then graph an output of DP(delta pressure). The Code did not break on me, but it's not generating an output. I have attached my block diagram and front panel.

Download All
0 Kudos
Message 10 of 13
(4,955 Views)