How do I pass value of State Button in app designer into a Simulink model?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have created and linked a simple app using app designer that has just one State Button and a basic simulink model that has a switch block. I'd like to use the value of the state button (0 or 1) as the second input to the switch block, so the logic through the switch block changes when the state button is pressed/released. How do I do this? Usually connections are made using bindings, but for a state button app designer states 'bindings not supported'. I'm thinking there must be a way around this maybe using a callback - so that when the button is pressed the callback sets the value of a Variable in the model workspace that is picked up by an input into the switch state etc.. but I've had a go and can't see how to do this.
2 Kommentare
Amish
am 25 Mär. 2025
You can define a variable in the Model Workspace that is connected to the control input of the switch block. This variable can then be modified using a Callback function for the State button in the app using the assignin and set_param function to update the variable.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!