Info

This question is closed. Reopen it to edit or answer.

Error while creating a serial object

1 view (last 30 days)
Dennis Robert
Dennis Robert on 14 Dec 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
I have a desktop with MATLAB installed on it and a program (m file) which is necessary for an experiment I am conducting. But for that, I have to run the MATLAB program automatically by using an output from an ADC (analog to digital converter) whose only output port is BNC.
I made a BNC to Serial Cable by connecting the cut of ends of BNC and the Serial Cable (RC232), the latter's other end being a female connector. I used the wire corresponding to 'TxD' of the RC232 Cable to connect to the BNC conductor. I checked the continuity with a multimeter and it was fine.
I tried to create a serial object with the following code (after connecting the BNC-Serial to the male DB-9 connector of my desktop) :
if true
s = serial ('COM1','baudrate','9600');
fopen(s)
end
But this simply didn't work out. Error message is 'COM1 is not available. Use INSTRFIND to determine if other ports are available'.
I used many other ports. But none of them worked out.
Can someone help me out?
Thanks in advance...
  1 Comment
Walter Roberson
Walter Roberson on 14 Dec 2012
Caution: the serial port will not be able to handle input derived in this manner unless the input has serial port levels and serial port bit timings.

Answers (0)

Community Treasure Hunt

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

Start Hunting!