LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 real-time plots + curve fits on the same x-y graph

Hello all-

 

Per the title, I'm trying to plot two series, both in real time, plus curve fits for each series on the same x-y plot.  Some background on the subject - this will be used to show the temperature distribution across a counter-flow heat exchanger.  So the x-y plot will plot temperature vs. position for two different flow streams - a hot flow stream, and a cold flow stream.  I would like to plot them both on the same graph so the temperature relationship between the two flows can be clearly seen.  If I can plot 2 series with simple lines connecting the points that would be fine, but would prefer some smoothing on the line or using a curve fit if that is possible to do in real time.

 

A screen shot of my block diagram is linked below.  As you can see, the diagram is symmetrical with the inputs from the cold flow being processed on the top, and the inputs from the thermocouples in the hot flow being processed at the bottom.  I've got 2 issues:

 

1.  Plotting 2 series on the same X-Y graph in real time.  (I've done this before, but never in real time).  Am I correct in assuming, if I append the array so it is a 3-D array (X, Y1, Y2), that I can plot both series on the same X-Y graph?  The individual X-Y graphs are functional, but I would like to combine them.

 

2.  I've circled a bundle output which outputs the X,Y values of a curve fit.  The output here is a string (pink wire), so I cannot plot it on the X-Y graphs which are shown, due to it being 2 different data types.  Is there any way to plot the curve fit on the same graph?  Is LabVIEW capable of doing this in real time?

 

Thank you for any help...   I realize that some of the answers here may be obvious, but visualizing what's going on in LabVIEW is a bit of a challenge for me, since I'm used to seing text-based code in VBA and MATLAB.

 

0 Kudos
Message 1 of 5
(3,215 Views)

To further elaborate, what I've got is a tube-in-tube heat exchanger.  I've got 2 NI thermocouple readers that are 4 channels each, so I've got 4 probes in the hot flow, and 4 probes in the cold flow.  The probes will be in pairs along the length of the heat exchanger, so at x=5 meters I will have a probe in cold flow and a probe in the hot flow, and at x=10m, ect.  And I want to plot the temperature of each flow vs. distance as 2 seperate series on the same graph, prefeerably in real-time, and with curve fits on each series, if possible.

0 Kudos
Message 2 of 5
(3,209 Views)

The output you have circled is a cluster of two 1D arrays, not a string.

 

XY graphs take a varirty of inputs (array of points, cluster of x and y arrays, complex arrays, etc.) but you cannot mix datatypes in a single graph. Since you are graphing arrays of points (a point is a cluster of an x and y scalar), you need to do the same for the data you circled. Simplest would probably be to just wrap an autoindexing for loop around the bundle function. See how far you get.

 

If you want detailed help, please attach your actual VI. We cannot debug a picture.

0 Kudos
Message 3 of 5
(3,203 Views)

Thank you altenbach.  A copy of the VI is attached. 

 

The output from the bundle was a pink wire, so I assumed it was a string by the color coding scheme.  The different data types and how they are constructed has been difficult for me to grasp.

 

Thank you for your help.

0 Kudos
Message 4 of 5
(3,129 Views)

Hi Mark_1042

 

As altenbach said, the pink output you are getting out of the bundle of the polynomial fit function corresponds to a cluster of arrays and you are not able to wire it with the other clusters in the build array because the other clusters are a cluster of DBL elements and you cannot merge those data types to build your graph. I think you should give a try to altenbach’s recommendation and try to access each element of the polynomial output and then proceed to bundle those elements instead of the arrays. The following link contains an example of the basics of using the auto-indexing with for loops, I hope it helps you.

 

https://decibel.ni.com/content/docs/DOC-20828

Regards,

Sil.VI
0 Kudos
Message 5 of 5
(3,092 Views)