09-21-2011 09:25 AM
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?
09-21-2011 10:19 AM
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:
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