![](/images/new-backgrounds/1205057/205057151x1.webp)
Ethernet Developers Guide
B.3 Overview
The sample application performs the following steps:
Calls the window socket function socket to create a socket.
Calls the window socket function setsockopt to set the socket attributes.
zCalls the window socket function connect to establish a connection.
Encodes the request. The request consists of a header followed by a Modbus message. The header contains an invoke identifier, a protocol type, the command length, and a destination identifier.
Invoke Identifier
Protocol Type
Command Length
Destination ID
Modbus Message
Calls the window socket function send to transmit the request to the remote node.
Calls the window socket function recv to receive the response from the remote
znode.
Calls the window socket function closesocket to close the connection and release the socket.
The winsock.lib import library provided by the installation is used to link the window socket calls.
B.4 Development Environment
The sample application was developed with Microsoft Visual C++, version 1.52. The sample application uses Microsoft Foundation Class. The initial application was generated by the Visual C++ application wizard.
66 | 840 USE 115 00 Version 1.0 |