04-01-2013 09:36 AM
I'm still a LabView rookie(so to say). I've written several differential and RSE, DAQmx analog read and write VI's without issue. However, I need some advice regarding my next VI. I need an analog read to to occur for X(ms), then read the results to determine the highest voltage measured surning the sample period. The sample period could be as long as 5 seconds. The only output I need from the VI is the Max Voltage Measured during the specified sample period.
The inputs are not the problem. I just need some advice, guidance, or suggestions regarding how to obtain the desired output. Ex: Do I send the Read results to an array, then determine the highest value from the array?
Any advice would be greatly appreciated.
04-01-2013 09:59 AM
Read the data as an array and then use Array Max & Min to get the maximum read value.
04-01-2013 03:17 PM
While array Min Max does seem to work( thanks by the way), I only get the data from the most recent Read iteration(basically the last second of run time). I have to be able to pull the Min and Max for the entire run duration, possibly 5 seconds. I made some changes to some Analog Read code I already had on hand(changed to contiuous sample, etc). Wrote the output to a graph and could see the realtime Read output just fine. Changed output to Array Min Max, and only see the last iteration.
I also tried modifying some NI Sample Code(Voltage_Continuous Read) with the Array Min Max. Same result.
When finished, the code will be used in a test sequence to measure a voltage that is only present for 20ms max. A MODBUS write triggers the voltage output. The problem is we dont know how long it's going to take for the write to occur to trigger the output. Could be < 1sec, could be three seconds. So I need the VI to record samples from all iterations.
04-01-2013 10:49 PM
Store the max value in a shift register. Every iteration of the loop, use the Max Min function on the comparison palette with the output of the Array Max,Min and the shift register value to get the new max value and put that back into the shift register.
04-02-2013 09:34 AM
I think that'll work. will work on it today and follow up.
By the way, I'm born and raised Maryland. GO RAVENS!!!!