Why is it not possible to display a signal from a xpc-model on the gui using the function getsignal(handles.tg, signalnr)?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
By running my gui-programming I get every time i click on the start-button a fault message looking like this:
??? Attempt to reference field of non-structure array.
Error in ==> xpc_diagnose_GUI1>startbutton_Callback at 86 fehlerart=getsignal(handles.tg, 18);
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> xpc_diagnose_GUI1 at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)xpc_diagnose_GUI1('startbutton_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Now my question is: Is there something missing regarding the tg or else that leads to this problem?
0 Commenti
Risposte (2)
Ryan G
il 27 Set 2012
Put a breakpoint at the GETSIGNAL line in the GUI and see what options are available when you do:
get(handles.tg)
I believe you should be able to see that the tg is connected and running by doing this and that your handle is correct.
There are a lot of possible issues here. Are you sure you have defined that signal (does signalnr exist)? Is the handle pointing to the target (step above is to diagnose that)? Is this a problem with your GUI and not xPC?
Another thing you should do is try running this code via the command window with xPC running to make sure your syntax is correct before implementing via gui if possible.
0 Commenti
Domenico Leonardo
il 28 Set 2012
Modificato: Domenico Leonardo
il 28 Set 2012
1 Commento
Ryan G
il 28 Set 2012
A couple things. How do you create TG? Once you create it, i assume it's a different call back using it. How do you assign TG to the handles structure? Does handles.tg exist in the new callback?
Vedere anche
Categorie
Scopri di più su Whos in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!