FPGA and ethernet communication
Show older comments
I want to use TCPIP protocol on port 80 to connect fpga kit named ML505 with matlab.
Can i do it???
If yes den how??
I know there are some commands like
echotcpip = start or stop TCP/IP echo server
resolvehost = Network name or network address
tcpip = Create TCPIP object
What is the use of this commands i didnot get the meaning of creating TCPIP object when my object is xilixs FPGA ML505 kit???
Accepted Answer
More Answers (2)
Walter Roberson
on 25 Nov 2011
0 votes
"object" in this context means a MATLAB Object Oriented Programming (OOP) variable of a specific data Class. "object" does not refer to physical objects in this context.
For now, you should just interpret "object" in this context as being a complicated kind of variable that MATLAB knows is associated with a particular TCP/IP connection.
4 Comments
amey patil
on 26 Nov 2011
Walter Roberson
on 26 Nov 2011
It is not possible for a software command to physically establish an ethernet connection. To physically establish an ethernet connection requires physical manipulation -- finding appropriate cables with appropriate ends, plugging them in to the two systems, perhaps needing to add a network switch, which might require a robot or a human to plug in an electrical cable; a robot or human might perhaps have to open the main computer up and install a second ethernet card...
amey patil
on 12 Dec 2011
Walter Roberson
on 12 Dec 2011
No. The physical connections would already have to be made before MATLAB could be used to transfer data over the connections.
You need
http://www.mathworks.com/help/toolbox/instrument/tcpip.html
Connection = tcpip('192.168.0.2', 80);
fopen(Connection)
After that you would use fwrite(Connection, ...) and fread(Connection, ...)
There is another possibility in your situation: depending on exactly what the server interface is defined as on the FPGA, it could be that you would not use tcpip() and fopen() directly at all, and that you would instead use urlread() or urlwrite() to send commands to the FPGA and get back the response.
Daniel Shub
on 26 Nov 2011
Prior to r2011a (???) MATLAB could only act as a TCPIP client. Now MATLAB can act as both a client and a server. I believe this requires the instrument control toolbox. Are you trying to connect to or from MATLAB? The documentation is pretty good. You should start with:
doc tcpip
1 Comment
Walter Roberson
on 26 Nov 2011
The MATLAB File Exchange contribution "tcpudpip" is able to act as both a client and a server with earlier versions of MATLAB.
Port 80 is HTTP, so likely the FPGA would act as the server, likely making the point moot.
Categories
Find more on TCP/IP Communication in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!