LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform+Chart+Array Average

Solved!
Go to solution

2.PNG

 

I have used sequence structure so that the mean is calculated after the loop is stopped. Also i know that i converted the temperature twice by introducing expression node on the second sequence. i will fix that. regradless of that i get a broken wire 😞

0 Kudos
Message 11 of 16
(1,289 Views)

Hi Alyssa,

 

What's the point of the sequence structure here? Dataflow is already ensured by the loop border...

 

Right now you output a scalar value out of the loop: what's the point of calculating a mean from a single value??? (Did you read the error explanation for this broken wire in the context help?)

 

Did you already take the beginner courses?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 16
(1,285 Views)
Solution
Accepted by topic author Alyssa001

@Alyssa001 wrote:

Sir, 

I misspoke earlier sorry. So we need to find the average of the data points that shows on the graph.
So, after we hit stop to button on the while loop, the loop should stop running and then we need to take the average of the data that were converted to Celsius and plotted on the graph. I think we need to create an array at the output and show all the points that were converted using a indicator and then take the average of it. i tried few different ways and keep getting broken wires. I really appreciate your help. Thank you again 


Technically what you have is a chart, not a graph.  Since what data is going into the chart depends on how long the chart history is, how much data is in your original array, and how many times you've wrapped around based on how long your while loop ran, the best thing you can do is take the Chart History property node of that chart which gives you the array of data that is in it at that moment, and take the mean of that.

0 Kudos
Message 13 of 16
(1,280 Views)

I think i figured it out this time. Thank you 

I am currently taking my first labview course. So i am all kinds of dumb mistake. I forgot to change my indicator to an array.

Also, i introduced the sequence structure cause my program was outputting average with every iteration of the loop. i wanted to do the sequence inside the loop. 

So sorry again. 

 

I do have one last question. If i wanted to change the plot line color and give the user the freedom to choose between two colors while the program is running. Which property node should i use? Should i use Enum control, if so how would i introduce blue and red color ?

0 Kudos
Message 14 of 16
(1,280 Views)

Hi Alyssa,

 

there are property nodes to change properties of the plot...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 16
(1,262 Views)

Thank you 🙂
I was wondering about which property node i should use. I tried a few different one, and finally found plot.color node. 🙂
Thanks again for all the help. I really appreciate this 

0 Kudos
Message 16 of 16
(1,245 Views)