LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multi plots

Solved!
Go to solution

Hello,

 

I am programming a PID temperature controller and need to plot two curves on the same graph. The first is the desired setpoint temperature--a straight line--and the other is the fluctuating temperature with respect to time. The missing vi's configure the serial port, set the PID values and get the current temerautre. They all have been tested and work fine. Any suggestions?

0 Kudos
Message 1 of 8
(3,312 Views)

Add another plot to the graph with two points; (xmin,ysetpoint) & (xmax,ysetpoint). This will create a straight horizontal line across your plot.

 

Chris

 

 

Message Edited by C. Minnella on 04-29-2009 12:00 PM
Message 2 of 8
(3,300 Views)
Solution
Accepted by wowden

You have some major problems with the way you are plotting. First, you are using an XY graph so you only get a single plot. If you want to plot two separate, then you should be using a regular graph or chart. Second, the way you are creating the array with the GetTemp VI is totally wrong. With each iteration of the while loop, you create a new array and replace one element. You are throwing away the old data. The simplest thing for you to do is to use a chart. Wire the scalar from the ReadTemp and a constant to a bunle function and the output of this to the chart.

 

Message Edited by Dennis Knutson on 04-29-2009 10:20 AM
Message 3 of 8
(3,292 Views)

No comments on the GetTemp vi from me, I didn't even look at the rest of the code.

 

"First, you are using an XY graph so you only get a single plot. If you want to plot two separate, then you should be using a regular graph or chart."

 

huh? You can certainly put more than one plot on an XY graph, and the decision to use a XY vs. waveform graph really has nothing to do with how many plots you want to display. It should be based on whether your data is evenly spaced (constant dt) and all waveforms have identical dt and phase (let's just say T0).

 

Like I said, I didn't even look at the rest of the code, but Dennis's suggestion to go with a chart may be the simplest way to go assuming your data meets the conditions I outlined, and you don't need to change what's on the chart (adding or removing plots from the chart will wipe the history).

 

Chris

0 Kudos
Message 4 of 8
(3,273 Views)
You're right about multiple plots on an XY. What I meant was that since there was only a single x array and a single y array, the graph was only going to display a single plot. The desciption of what the op wanted to do was not at all consistent with a XY Graph, imho.
0 Kudos
Message 5 of 8
(3,270 Views)

ah, I see. There is definitely more than one question there about the code. Wowden, take a look at what we've said, and then ask more questions. We'll get you squared away. :smileywink:

 

Chris

0 Kudos
Message 6 of 8
(3,256 Views)
Thanks alot, I solved the problem based on both your suggestions. The output i was looking for is from the waveform chart. I attached a mockup vi just to show you my solution.
0 Kudos
Message 7 of 8
(3,238 Views)
All that code with the Initialize and Replace Array Element still does not make any sense. What's the purpose? You create an array of all 0's then replace element 0 with a value. Then you create the array again and just replace element 1, an array of all 0's and replace just element 2, etc.
0 Kudos
Message 8 of 8
(3,223 Views)