MATLAB: How to use a GUI created with GUIDE to view the numerical data values received from target using connected to host computer via xPC Target 4.0 (R2008b)

Simulink Real-Time

I am using xPC Target 4.0 (R2008b) with hardware in the loop. I have created a GUI using GUIDE which allows me to compile my model, run it, and stop it. I wish to view the numerical values from the Target incorporated into my GUI.

Best Answer

Please see attached demo GUI called ‘xPC_GUIDE_GUIdemo’ which displays data received from the target as numerical output.
Some of the things to note in the MATLAB code for the GUI are:
1) The timer function, xPCShowData(obj,event,hObject), acquires the signal value and displays the results.
2) The GETSIGNAL command gets the value of the target object signal associated with the index identified and the line of code
set(handles.text,'String',getsignal(handles.tg,2));
displays the value in the textbox.