11-19-2015 09:02 AM
@Dennis_Knutson wrote:
You've got some questionable code. That bottom for loop is just silly. All that you have to do is wire the array directly to the Build Waveform. To create an array indicator, just right click on the array wire and select Create Indicator. To use numeric indicators, you simply use the Index Array function. Please take some of the free LabVIEW tutorials.
The bottom loop indexes each simulated value and outputs a WF for each reading. That part of the code is valid.
11-19-2015 09:06 AM
11-19-2015 09:13 AM
@Dennis_Knutson wrote:
Sorry, you are right. I didn't look close enough.
That will teach you to criticize my code.
11-19-2015 09:19 AM
Now back to the original problem...Use an array of indicators or two indicators.
11-19-2015 09:34 AM
11-19-2015 10:08 AM
@Allisonb2106 wrote:
now just to wire light indicator for average of two values! Should I use a formula node with say y = (X1 + x2)/2?? And wire to lEDS?
No. Use the Mean.vi that is in the Mathematics->Probability & Statistics palette. That VI takes in your array and calculates the average for you.
11-20-2015 11:45 AM
Ok it works perfectly now, took you're advice, thank you to everyone for their help. The only problem I have is that the alarm doesn't sound accordingly, it beeps when temperature is normal or high but not cold? Could this be to do with my comparison elements? Normal is between 16-25 but it wont beep below 16? Can't seem to resolve this?
11-20-2015 11:56 AM
Look closely at your comparisons and read the help on those.
Just write down exactly what you have wired and you should find your error.
Ben
11-20-2015 12:03 PM
Should I wire the comparisons to the mean value? and get rid of the 'And Array Elements'?