How to connect to an instrument using RS-232 to USB converter?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I'm trying to remotely control an instrument through a serial port. To make the connection an RS-232 to USB converter is used. I have installed all the latest drivers of the converter. The following commands are used to create the serial object and connect to it.
s = instrfind('Type', 'serial', 'Port', 'COM3', 'Tag', '');
s = serialport('COM3',9600);
fopen(s);
The property values, baud rate etc., are matched with the instrument's one. The serial communication is opened with success but unfortunately, neither can I send data to the instrument nor receive. A timeout error is shown when trying to receive data. The pin status of the RS-232 is:
s.PinStatus
ans =
struct with fields:
ClearToSend: off
DataSetReady: off
CarrierDetect: off
RingIndicator: off
Also, when trying to query the IDN:
fprintf(s,"*IDN?\n")
s.NumBytesAvailable
ans =
0
I've tested the converter in other applications and worked as intented.
What would the solution be? Does it have to do with the converter itself?
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Instrument Connection and Communication dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!