how to use handles to connect app designer and simulink with each other
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Philipp Küsters
el 3 de En. de 2018
Comentada: Philipp Küsters
el 10 de Abr. de 2018
This is the first time using the option to ask the community because i am stuck for two days now. I had to write a rather complex program in stateflow (stateflow runs inside of simulink) and did so successfully. Now i have to create a user interface for easier usage. I have no experience in doing so and after some unsuccsessful tries in GUIDE i switched to app designer. In the startup funtion off the app i simulate the Simulink model "Simulation".
sim('Simulation');
later by changing a value in a constant block i started the actual simulation:
set_param([bdroot '/start simulation'], 'Value', 'true');
1. However after closing the app the Value stays true. Is there any way of only changing the value temporarily without using a reset button inside of the app?
2. To connect the Simulink model with the GUI i have read in multiple threads, that i have to use handles. ( App Designer to control a Simulink Model and read back model data ) However I don't know where to put the code for the handle (do I have to put both into the startup function of the app?) At the moment i try to access the app from a matlab_function inside of simulink (Gewebeinfiltrationsautomat_EXE is the name of the mlapp-file)
function fcn(process_timer, actual_sample_size, finished,)
app_handle = Gewebeinfiltrationsautomat_EXE;
app_handle.lbl_timer.text = num2str(process_timer);
Do i have to create the handle in the startup function of the app? If yes, can I then simply access the handle from any matlab function without problem?
Thank you for your help.
1 comentario
Bartha Balazs
el 30 de Mzo. de 2018
Hi, did you found any solution to your problem ? I'm struggling with a similar issue so if you have any solution peas let me know :)
Respuesta aceptada
Philipp Küsters
el 1 de Abr. de 2018
2 comentarios
Eric Hannouz
el 8 de Abr. de 2018
Hello Philipp, What Type did you use for the StateFlow Local variable "app" ? If you use an Expression like "gia_app", don't you have a compilation error of the kind "Expression 'gia_app' for type of data 'app' did not evaluate to a valid type" ?
Más respuestas (0)
Ver también
Categorías
Más información sobre Naming Conventions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!