Error while creating a serial object

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

Walter Roberson
Walter Roberson 2012년 12월 14일
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.

답변 (0개)

이 질문은 마감되었습니다.

질문:

2012년 12월 14일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by