LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Max/Min not working with Waveform chart - History data property node

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

0 Kudos
Message 1 of 13
(1,969 Views)

 

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 13
(1,963 Views)

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.

0 Kudos
Message 3 of 13
(1,962 Views)

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!

0 Kudos
Message 4 of 13
(1,958 Views)

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.

 

 

Message 5 of 13
(1,912 Views)

@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

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 13
(1,905 Views)

Ben and RF's excellant suggestions not withstanding,....

Try This

Capture.PNG

Oh yes, there is a Waveform min max 

 

OT: With a mind boggeling hidden control!

Mind boggling hidden control.png

The only thing I can think of is a Unit Test required that Waveform ERROR rather than use default if unwired.


"Should be" isn't "Is" -Jay
Message 7 of 13
(1,896 Views)

@JÞB wrote:

Ben and RF's excellant suggestions not withstanding,....

Try This

Capture.PNG

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!

 

Spoiler

 

I believe the hidden control is there satisfy the Clear as Mud monster.

And if you have brain left-over

Spoiler
Not you RF, you have to concentrate for tonight's game!



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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 13
(1,891 Views)

@Ben wrote:

@JÞB wrote:

Ben and RF's excellant suggestions not withstanding,....

Try This

Capture.PNG

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? Smiley Very Happy


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 13
(1,868 Views)


Spoiler

 

Spoiler
Not you RF, you have to concentrate for tonight's game!

 

 

 LOL.  Smiley Very Happy
Important game, get back to that first place tie with the tie-breaker edge!
Christmas day will will most likely decide the division.

 

 

Ben


 

0 Kudos
Message 10 of 13
(1,866 Views)