C-/Socket Programming - YASKAWA IM 053MT Manual

Vipa system slio, interface module modbus/tcp
Table of Contents

Advertisement

Deployment
Access to the Ethernet coupler > C-/Socket programming

4.4.4 C-/Socket programming

58
The Modbus/TCP server is accessed via port 502. Via simple C program it is possible to
transfer data between PC and Ethernet coupler with Modbus/TCP. For the deployment of
the Ethernet couplers at a PC you should have a thorough knowledge in C programming,
especially in socket programming. In the following the steps of programming are shown.
1.
Start Microsoft Socket System
ð WSAStartup (wVersionRequested, &wsaData);
2.
Reserve Socket resources for TCP
ð m_lsock = socket (AF_INET, SOCK_STREAM, 0):
3.
Establish connection to external device
ð SockAddr.sin_port = htons
(m_wPort);SockAddr.sin_addr.S_un.S_addr =
inet_addr(m_szIpAddress);connect(m_lsock, (LPSOCKADDR)
&SockAddr, sizeof(SockAddr));
VIPA System SLIO
HB300 | IM | 053-1MT01 | en | 19-40

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vipa system slio053-1mt00

Table of Contents