I'm using the GetSet storage class in my model on a signal which is of type Simulink.Signal. This signal is a control input that is fed to a Discrete PID Controller block. When I proceed to build the model, I observe the following code:
void feedback_control_step(void) { /* First calculation */ a= f(get_control_input()) /* Second calculation */ b= f(get_control_input()) /* Third calculation */ c= f(get_control_input()) }
This means that if the step function execution is interrupted, and then resumed, I might end up with different values of the input "control_input". What I want is to have the following behavior:
void feedback_control_step(void) { local_control_input = get_control_input(); /* First calculation */ a= f(local_control_input) /* Second calculation */ b= f(local_control_input) /* Third calculation */ c= f(local_control_input) }
How do I achieve this?
Best Answer