fopen() error with serial device
显示 更早的评论
Hi,
under Linux we'd like to send a text string to a serial device:
% --- code ---> >> s = serial('/dev/ttyS0');
% a serial object s is returned
>> set(s,'BaudRate',19200); % adjust the baudrate
>> fopen(s)
Error using serial/fopen (line 72) Open failed: Port: /dev/ttyS0 is not available. No ports are available. Use INSTRFIND to determine if other instrument objects are connected to the requested device.
% the serial device is still there
>> instrfind
Serial Port Object : Serial-/dev/ttyS0
Communication Settings
Port: /dev/ttyS0
BaudRate: 19200
Terminator: 'LF'
Communication State
Status: closed
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
% --- code ---<
Are there special toolboxes neccessary to connect to a serial device?
Regards, Roger
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Acquisition Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!