TCP/IP connection problem

3 views (last 30 days)
Juan Pablo
Juan Pablo on 5 Sep 2013
Hello all and thanks for your help,
I was trying to make an easy tcpip connection between my pc and a little board connected to my computer via USB. This one has an IP address (192.168.1.100) and a port address 21845. the simple code on matlab used is:
conn=tcpip('192.168.1.100',21845);
conn
fopen(conn);
fclose(conn);
But when I check the connection status:
TCPIP Object : TCPIP-192.168.1.100
Communication Settings
RemotePort: 21845
RemoteHost: 192.168.1.100
Terminator: 'LF'
Communication State
Status: closed
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
What it should appear in the status field is open, Iam rigth? Thanks for your help.

Accepted Answer

Juan Pablo
Juan Pablo on 5 Sep 2013
No need to answer to this question. Everything works fine now. Anyway the correct sequence is
conn=tcpip('192.168.1.100',21845);
conn %close status
fopen(conn);
conn %open status
fclose(conn);

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!