LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display returns latest data value rather than maximum data value.

I have requested the Maximum value using the Statistics VI.  The display returns the latest value rather than the maximum.  I think it may have to do with specifying the sample size or data packet size but I don't know how to do that.
0 Kudos
Message 1 of 7
(3,165 Views)
What do you have wired to the input? Is it an array or scalar? It would have to be an array to work. What is generating the data? Can you post the code that demonstrates the problem?
0 Kudos
Message 2 of 7
(3,151 Views)
The data is generated by a NI SCC-68 I/O Connector Block that is hooked up to a strain gauge.  The output from the DAQ Assistant is dynamic data.  It feeds the Signals input of the Statistics VI.  Output from the Statistics VI feeds a floating point, double precision display icon.  The display changes with every sample received which is near zero when there is no force being exerted on the strain gauge.  I would like to be able to specify a data/sample/time range over which the maximum value is captured and displayed until it is reset.
 
Also, I do not know how to post the code.  Can you offer a hint on how to do that?  Thanks.
0 Kudos
Message 3 of 7
(3,134 Views)

You probably are only taking a single reading with the DAQ Assistant and the Statistics function expects an array to determine the max value in that array. There are a couple ways to do what you want. One way is to use the Array Min & Max Single Point function (Signal Processing>Point by Point>Other Functions). This has a sample length input and a reset input. Another way is to create an array with a shift register and use the Statistics function or just the Array Min & Max function. You could limit the size of the array with Array Subset for example.

To attach a file to your post, look below the message body. There is a Attachment field with a browse button.

 

Message Edited by Dennis Knutson on 06-29-2007 09:41 AM

0 Kudos
Message 4 of 7
(3,127 Views)
I have attached my block diagram.  I will pursue your ideas, but I wanted to let you see my code in case you wanted to make further comments before I get back with you on my results.  Thanks again.
 
 
0 Kudos
Message 5 of 7
(3,117 Views)
What makes it a bit tricky is getting the time stamp of the max value. I've modified your VI to use the waveform data type. A couple of shift registers is used to hold the y array and a timestamp array. I only did this for the first channel so you would need to duplicate it for the second channel. Please note that using the build array in while loop is not very efficient and if you run this for a long time, you will have performance problems.
0 Kudos
Message 6 of 7
(3,096 Views)
Thank you very much.  You have been a great help.  We are only planning on running the trials for a few seconds (at most a couple of minutes) at a time, so the efficiency is probably not that important at this time.  Thanks again.
0 Kudos
Message 7 of 7
(3,093 Views)