GUIDE Serial help

1 次查看(过去 30 天)
arman Yaraee
arman Yaraee 2012-3-1
Hello guys. I am trying to define a serial object at the opening function. and I am a super beginner. I just want to know how to pass my objet to the other objects. It doesn't work when i try it. here is my current code:
serialptr = serial('COM9'); fopen(serialptr); serialptr.DataTerminalReady = 'on'; serialptr.RequestToSend = 'off'; fclose(serialptr);
I had to put this in every single button callback. Can anyone tell me how to do them in one callback and then send it to the rest. DTR, RTS will be changed in every function. Also I want to open port in one function and close it in another one. I tried nesting but didn't know how to nest all these callbacks into another one without damaging their properties. I really need an global object which will be used in every function and then saved in that function. does matlab have anything like C++ in hich u pass the refrence (pointer) and each function then could save everything onto the main object. Also in this matter security does not matter to me at all.

回答(1 个)

Walter Roberson
Walter Roberson 2012-3-1

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by