
Ethernet Developers Guide
66
840 USE 115 00 Version 1.0
B.3 Overview
The sample application performs the followin
steps:
Calls the window socket function
socket
to create a socket.
Calls the window socket function
setsockopt
to set the socket attributes.
Calls the window socket function
connect
to establish a connection.
Encodes the re
uest. The re
uest consists of a header followed b
a Modbus
messa
e. The header contains an invoke identifier, a protocol t
pe, the
command len
th, and a destination identifier.
Calls the window socket function
send
to transmit the re
uest to the remote
node.
Calls the window socket function
recv
to receive the response from the remote
node.
Calls the window socket function
closesocket
to close the connection and
release the socket.
The winsock.lib import librar
provided b
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
enerated b
the Visual C++ application wizard.
Invoke Identifier Protocol Type Command Len
th Destination ID Modbus Messa
e
Comentarios a estos manuales