Hi all,
I am currently writing a GUI program in matlab for a simulink real time workshop model. I wish my GUI to control an external plant. I wish the user to be able to edit system variables (such as P I and D of a PID controller) using my GUI. I have had significant difficulty with thus. If this were a non realtime simulink model I would use the following :
options = simset('SrcWorkspace','current');
sim('model.mdl',[],options);
To set the simulations workspace to be the same as the GUI’s, and then simply create the variables in the workspace that I wished to input into my model. Unfortunately using this method is not possible as it not possible to use the sim() command with a real time system. It is instead run using the commands:
set_param('model','SimulationMode','external');
set_param('model','SimulationCommand','connect');
set_param('model','SimulationCommand','start');
I would be most grateful if anyone could point me in the right direction.
Thanks,
Paul
Best Answer