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
http://www.ni.com/support