Why does my MATLAB file application that communicates with a device over a serial bus link stop working when I move my application from MATLAB 6.x to MATLAB 7.x?

1 view (last 30 days)
I upgraded from MATLAB 6.5 (R13) to 7.0 (R14) and my code which uses the serial port no longer works. When I receive a 'C' on the serial bus the device does not respond as it did in R13.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Jan 2010
It is possible that the device does not use standard handshaking, but requires that the RTS pin is set prior to transmitting data.
In R13, there was a bug that the RTS pin was accidentally set even when not using flow control. This resulted in some devices which use flow control being able to communicate in MATLAB without the FlowControl property being set to "hardware". When using these devices in R14 and later versions of MATLAB you need to explicitly set the FlowControl property.
For some non-standard devices you may need to control the values of the RTS and DTR pins manually in cases where this was not necessary in R13. For example if your device requires the RTS pin to be asserted before it will send data you can do the following:
s=serial('COM1');
fopen(s)
s.RequestToSend = 'off';
s.RequestToSend = 'on';
fprintf(s,'C');
data=fscanf(s)
fclose(s)
delete(s)

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!