Hi Guys,
I'm new to the App Designer and I have a (simple?) question:
I have two buttons. The first one opens a tcp/ip connection to a device. The callback function got the following code (just ignore the lamps):
% Button button pushed function
function VerbindenButton(app) t = tcpip('192.168.2.3', 29536, 'NetworkRole', 'Client') fopen(t); app.Lamp.Enable = 'on'; app.Lamp2.Enable = 'off'; end % Button2 button pushed function
function CAN0Button(app) fwrite(t,'< open can0 >'); end
When I click the second button (after the first one) I get the error 'Undefined function or variable 't'.' So here is my question: How do I get the value/information of t into the second button function?
Best Answer