GUI and COM port interface

1 Ansicht (letzte 30 Tage)
MrPuzzled Marc
MrPuzzled Marc am 8 Mär. 2011
Hi, I have a question. May I can I know how to communicate serial com port with GUI push button? For eg: s=serial('COM15')into the GUI push button so when I clicked on it will directly connect to the com port.Thanks in advance.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 8 Mär. 2011
Open the serial port and save the resulting object in to a convenient location (such as in a handles structure), and then in the callback for the object, retrieve the stored object and use it to read from or write to.
  5 Kommentare
MrPuzzled Marc
MrPuzzled Marc am 8 Mär. 2011
I do not get you in the last 2 reply.I seem puzzled. Could you explain more?Do you have any example that can refer?
Thanks.
MrPuzzled Marc
MrPuzzled Marc am 8 Mär. 2011
I tried using handles=getappdata(serial('COM15')); on the push button M-file.However error occurs. It says conversion of double from serial is not possible.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Use COM Objects in MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by