12-12-2016 10:58 AM
Hi,
I'm having trouble figuring out why i can't use the Array Max/Min function to retreive the max/min values of my waveform chart..
The error i'm getting is "Polymorphic terminal cannot accept this data type"
attached is the picture of what i'm trying to connect..it seems pretty simple and correct but I guess i'm wrong about the correct part
Any thoughts? my program is basically graphing date/time and one temp measurement every x seconds on a waveform chart.
All i want to do is allow the user to see what the max and min temperatures were from this waveform chart.
If I should be doing this in a different way, please let me know!
Thank you for the help
12-12-2016 11:04 AM - edited 12-12-2016 11:04 AM
The Chart History for a Waveform Data type is a 2-d array. The Max Min accepts a 1-d aray AND it does not accept WF data type.
You will have to pull out all of the Y arrays for the channel you are interested in checking, build those into an array and then use the max min function.
For processing speed you may want to process each update as they are aplied to the chart if you have a lot of data for a long period of time. Otherwise the memory demands could be inflated.
Ben
12-12-2016 11:04 AM
Chart history appears to be an array of waveforms. (It might be a single waveform, but I can't tell from just a picture. If you had attached an actual VI, it would be easier.)
Try using Index Array on the wire coming out of the History node. And if that doesn't work, add "Get Waveform Components" to get the Y data array out of the single waveform.
12-12-2016 11:07 AM
Sorry about the picture
Yes it is a 2d array of waveform data on the chart history property node
I will try the suggestions mentioned
Thank you!
12-12-2016 01:41 PM
I have a suggestion. Instead of trying to get a Max/Min from the history data of the chart, you chould get the max/min of the data at the point where it goes into the chart. Ben may have been suggesting that in his message.
12-12-2016 01:59 PM
@RavensFan wrote:
... Ben may have been suggesting that in his message.
Indeed I was.
Complication there is when the Chart fills up and starts droping data. In that case we would have to use the chart history for the max min to be consistent with what is in the chart. The part I do NOT like about using the chart histroy is if the history is large, all of the data in the chart will be duplicated for the analysis of max and min.
A happy compromise could be to document the max and min are the max and min of all time and possibly add a "rest max/min" function so the user can reset the tracking of the max/min.
Choose "the red pill or the blue pill".
Ben
12-12-2016 02:28 PM - edited 12-12-2016 02:35 PM
Ben and RF's excellant suggestions not withstanding,....
Try This
Oh yes, there is a Waveform min max
OT: With a mind boggeling hidden control!
The only thing I can think of is a Unit Test required that Waveform ERROR rather than use default if unwired.
12-12-2016 02:40 PM - edited 12-12-2016 02:58 PM
@JÞB wrote:
Ben and RF's excellant suggestions not withstanding,....
Try This
Oh yes, there is a Waveform min max
That works for a WF chart that is defined at a single WF. For an array of WF's then another for loop will be required and another pair of Max and Min array checks
I had previously avoid many of the WF functions becuase they were implemented badly. Now that you brought up that VI Jeff, I took another look and it appears have been improved using what we learned from the Clear as Mud" thread. Nice to see it getting better!
Thank you for prompting me to look under that rock again!
I believe the hidden control is there satisfy the Clear as Mud monster.
And if you have brain left-over
take a look at the "WDT Get Final Time Value.vi". Same extra control for the error case but they included an always copy. Betcha the data was flowing backward at one point corrupting the hidden control.
Ben
12-12-2016 03:44 PM
@Ben wrote:
@JÞB wrote:
Ben and RF's excellant suggestions not withstanding,....
Try This
Oh yes, there is a Waveform min max
That works for a WF chart that is defined at a single WF. For an array of WF's then another for loop will be required and another pair of Max and Min array checks
Which loop did I miss?
12-12-2016 03:51 PM