Showing results for 
Search instead for 
Did you mean: 

ploting setpoint and setpoint ramp

I've got it going now, but it has some bugs if you change the setpoint while ramping and I'm unsure how to add a delay prior to starting a ramp.  Any suggestions?

0 Kudos
Message 11 of 12

Consider using shift registers to retain the value of your data between iterations of the while loop, similar to a standard state machine. Your code is already close to the state machine architecture (case structure inside a while loop) so it probably wouldn't be a huge change to your code. If you decided to go for a state machine you could have an emun with cases like "setpoint change," "ramping," "delay," etc. Just something to consider, here's some resources if you'd like more information:


State Machines


Shift Registers: Passing Values between Loop Iterations


It looks like you are getting closer to a fully functional application, keep us updated.


Tim W.

Applications Engineering

National Instruments 

0 Kudos
Message 12 of 12