edit text control misidentified as serial port object

1 view (last 30 days)
Hi, I am new to Matlab programming. I am trying to expand the following example code:
to send and receive RS-485 adresses and data (see attached file). I have succeeded to a certain degree. I can send and receive an RS-485 address and data with the modifications I've made. However, I get the following exception:
identifier: 'MATLAB:serial:set:opfailed'
message: 'The name 'String' is not an accessible property for an instance of class 'serial port objects'.'
cause: {}
stack: [10x1 struct]
from the following line of code:
handles.history_box.String = [currList ; ['Sent @ ' datestr(now) ': F3 '] ];
in function rxButton_Callback(hObject, eventdata, handles). History_box is not a serial port object, it's an edit text control.
This line of code is called 4 times: one time each for when the address and then data are sent and received. The exception only occurs the first time this line is processed. All other times it works. Can someone suggest why I'm getting this exception the first time?
Thanks,
Jason Mazzotta

Answers (0)

Community Treasure Hunt

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

Start Hunting!