App Designer Interrupt while evaluating ... PrivateValueChangedFcn

11 views (last 30 days)
Hello,
I've created an app to stream data over bluetooth and display the data on an App Designer GUI. I am by no means a matlab expert however, attached is my project which worked in the past and then x, y, and z changes have left me unsure why it doesn't work now. If I break a process by CTRL-C the program will actually resume and work semi-properly but that is not ideal. I'm only a few days from a final presentation and demo day, so any help is greatly appreciated. I also appreciate critiques to coding techniques so I may become a better matlab programmer.
Thank you!
Project exported from .mlapp to .m
Problems occur when I change tabs or toggle a switch after changing tabs.
Here are the error messages after I Ctrl-C because the program is not responding:
After changing tabs...
In PL3GUI/readData (line 279)
data = fgetl(app.Bt);
In PL3GUI/TabGroupSelectionChanged (line 729)
readData(app);
In appdesigner.internal.service.AppManagementService/tryCallback (line 330)
callback(app, event);
In
matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event)
Error using matlab.ui.internal.WebTabGroupController/handlePropertyUpdate (line 97)
Interrupt while evaluating TabGroup SelectionChangedFcn.
After toggling a switch...
In
matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 378)
Interrupt while evaluating ToggleSwitch PrivateValueChangedFcn.
  1 Comment
Kennet Thurman
Kennet Thurman on 27 Nov 2018
Solved it.
I created a workaround by checking active tab and switch state based on global variables instead of strcmpi(app.someSwitch.Value, 'On') => isequal(app.someSwitch, 1). I think the issue sprung from changing tab or switch state while it's inside of the loop which executes code when the state is high but changed low or vice versa. I changed a plethora of other things as well like nested functions into functions with return values and so on.
15 stressful hours later I'm good to go. Attached is the working code.

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!