Why is it not possible to display a signal from a xpc-model on the gui using the function getsignal(handles.tg, signalnr)?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Ryan G
le 27 Sep 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 commentaires
Domenico Leonardo
le 28 Sep 2012
Modifié(e) : Domenico Leonardo
le 28 Sep 2012
1 commentaire
Ryan G
le 28 Sep 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?
Voir également
Catégories
En savoir plus sur Target Computer Setup dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!