fopen() error with serial device
Afficher commentaires plus anciens
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
1 commentaire
2000rogers
le 20 Juin 2013
Réponses (0)
Catégories
En savoir plus sur Data Acquisition Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!