Showing results for 
Search instead for 
Did you mean: 

ploting setpoint and setpoint ramp

I'm trying to figure out how to plot the steady state setpoint on a waveform chart, but I'm having a mental block at the moment.  I can plot the ramp just fine, but the event is always waiting for a value change of the setpoint, so nothing else executes until that happens.  Of course, when there is no setpoint value change I just want to plot the current setpoint as time elapses.  Any suggestions would be greatly appreciated.  VI attached for reference.



0 Kudos
Message 1 of 12

An event structure is mainly designed to react to user interactions.  A setpoint ramp is something to have an independently running loop to vary the operation of a machine.  Your VI doesn't really show it doing anything other than putting a setpoint value onto a waveform chart, but even if it did, why do you have the ramp action wrapped up in the event structure?

0 Kudos
Message 2 of 12

I only want to plot the ramp for a setpoint change, that was my motive for using the event structure.  I attached the vi where I was thinking about how to get around the event, here is the original, where it plots the ramp from the old setpoint to the new setpoint.


To clarify, in steady state I just want to plot the setpoint.  For a setpoint value change I want to use the ramp, that way it is not a step function.  It would be best if during ramping I plotted the ramp as it incremented, not all at once.  In that case I guess I should have the for loop outside of the event?

0 Kudos
Message 3 of 12

Perhaps you want to wire a timeout into your event structure and add a timeout case.


What is the difference between the "original" VI you just posted and the one you posted in message 1?

0 Kudos
Message 4 of 12

hmm, I don't know what happened with that VI.  I must have mixed it up.


At any rate I took your suggestion on the timeout and I think I'm getting close now.  The problem I have at this point is getting the ramp to plot incrementally and stay on the chart.  Currently the ramp just plots all at once, subsequentially disappearing and displaying the current setpoint.  I'm thinking I have to do something clever with my for loop, but it's not coming to me at the moment.  My latest iteration is attached.


Screen shot 2011-09-18 at 5.18.14 PM.png

0 Kudos
Message 5 of 12

Hi jghfduy6,


Just to clarify, you want to plot the current setpoint and see the historic data with ramps between values, correct? I did a little bit of work with your vi and got the following output:


Waveform chart.png


To achieve this result I played with the timing and ramp settings. With your current set-up, there may be some issues between timeout and the while loop timer. I used a 10ms value for the while loop timing, 5ms for the event structure timeout, and a ramp value of 0.01. I would suggest examining different values for these variables depending on how you want the program to respond and your memory needs.


Please respond if this doesn't work for you, or if you have any other issues with this application


Tim W.

Applications Engineering

National Instruments 


0 Kudos
Message 6 of 12

Thanks Tim.  Unfortunately, we are ramping anywhere from 300 to 7200 C/hr, so a ramp of 0.01 is much too short.  The chart plots the ramps as soon as my for loop executes now, so you briefly see the ramp forcasted on the chart and then you return to the current setpoint and time.  I believe you made the ramp short enough that it did not forecast too far out into the future.


What I believe needs to happen is to execute the for loop in such a way that the ramp is incrementally plotted every second until the setpoint is reached.  Of course, the whole time the ramp is plotting the vi will have to be acquiring data from the furnace, so it can't just be stuck in a while loop plotting the ramp.

0 Kudos
Message 7 of 12

After taking a closer look at the graphing portion of your VI, I noticed the conversion to the Dynamic Data type node placed before the chart. I got rid of the converter and ran the VI with the Double type wired in to the Waveform Chart and the output showed up as I believe would expect it to. Give that a try and let me know if it helps.


Tim W.

Applications Engineering

National Instruments 

0 Kudos
Message 8 of 12

Yes, it plots as I would expect now.  However, I will need to merge the temperature data onto this chart and the x-axis needs to reflect time, not the loop iteration.  Whenever I use the merge signals function it automatically imposes the dynamic data type node and plots the x-axis in time.  Is there not a way to plot the ramp incrementally?

0 Kudos
Message 9 of 12

I'm getting a little closer.  I just need to figure out how to plot the ramp incrementally now.  I thought about creating an array with the results from the for loop, then pulling the elements from the array as time elapsed, but that got pretty messy...


Here is the latest:

Screen shot 2011-09-19 at 10.09.35 PM.png

0 Kudos
Message 10 of 12