LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I return the Maximum value from a voltage sensor, over its current recording history?

Hi,

 

I am trying to setup a LabVIEW block diagram to collect data from an engine study.

One of the sensors I am using is an Oxygen Sensor, and it returns a voltage that is based on the amount of O2 in the air passing over its heated element. (all that is important to know is that it returns a voltage)

 

In order to calibrate the sensor, the sensor is simply operated in room air for several minutes, and the maximum output voltage (over this time period) should be recorded. This maximum value will then be used in a formula to calculate the O2 percentage in the exhaust gases. 

 

In order to make things simpler for me and the next user, I would like the panel to display the O2 percentage instead of a voltage, that will then be used after the tests are complete to back calculate the O2 percentage. Therefore, I would like the VI to calculate the O2% using the formula. 

I have been able to program the formula into the block diagram, but it requires 2 inputs. One is the current output voltage, and the other is the calubration voltage (which would be a maximum value). 

 

My question is how do I find the maximum value over the entire current data collection range?

The way I see myself and others running this is:

1. Turn the system on

2. move the sensor into room air

3. The sensor will be recording and produce high (relatively) voltage outputs

4. The sensor will then be moved to the exhaust pipe of the engine

5. engine testing will occur and the O2% will now be lower and therefore the output voltage of the sensor will be much lower (compared to calibration in room air)

6. the VI will be able to take the max value from the O2 sensor recorded history and use it for calculation of O2%

 

I hope this is not too much to read. I would assume this is possible, but being new to the software, I am unfamiliar. 

If anyone can help, I would appreciate it. 

Thank you. 

0 Kudos
Message 1 of 8
(4,632 Views)

There is a Max Min function.  And you store the max value in a shift register.

 

 

0 Kudos
Message 2 of 8
(4,628 Views)

Hi RavensFan,

 

Thank you for your help.

 

I have seen this Max/Min function, and I tried it, but I get an error becuase my signal is apprently "dynamic data" and the max/min function accepts double precision data, so thats the problem I am encountering at this moment. I have modified the block diagram to convert the "dynamic data" into a double and then do the same thing you suggested, but I will test it tomorrow in the lab. 

 

I am currently working around this by using a numeric input, which the user would simply watch the sensor output over the calibration period and manually input that value into the formula.

 

Thanks again!

PackersFan btw...

Cheers

 

 

0 Kudos
Message 3 of 8
(4,613 Views)

If you've got Dynamic Data, there's a function that will turn this into an array.  You can then use the Min/Max function on the Array Palette to get the maximum.  No muss, no fuss.

 

BS

0 Kudos
Message 4 of 8
(4,594 Views)
Be careful with the evil dynamic data. The conversion can create an array but unless the inherent data is multiple samples, then conversion to an array is meaningless so you will still need to convert to a scalar and use the shift register.
0 Kudos
Message 5 of 8
(4,587 Views)

Good point.  I never use Dynamic Data -- does it ever appear except in NI-created Express VIs?

 

BS

0 Kudos
Message 6 of 8
(4,563 Views)

The statistics express VI has modes for the min and max of dynamic data.

0 Kudos
Message 7 of 8
(4,553 Views)

I've opend a new thread referring to this one

 

http://forums.ni.com/t5/LabVIEW/How-can-I-get-the-current-max-value-of-a-measurement/m-p/3123962

 

[Edited by moderator - Corrected link] 
0 Kudos
Message 8 of 8
(4,273 Views)