B.3 overview, B.4 development environment, Overview – Schneider Optics Web Embedded Server User Manual

Page 76: Development environment

Advertising
background image

Ethernet Developers Guide

66

840 USE 115 00 Version 1.0

B.3 Overview

The sample application performs the following steps:

z

Calls the window socket function socket to create a socket.

z

Calls the window socket function setsockopt to set the socket attributes.

z

Calls the window socket function connect to establish a connection.

z

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.

z

Calls the window socket function send to transmit the request to the remote
node.

z

Calls the window socket function recv to receive the response from the remote
node.

z

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.

Invoke Identifier

Protocol Type

Command Length

Destination ID

Modbus Message

Advertising