Mitsubishi Electric MELSEC-L SERIES Basic User Manual page 356

Melsec-l ethernet interface module
Hide thumbs Also See for MELSEC-L SERIES:
Table of Contents

Advertisement

(4) Sample program on the connected device side
The program example of the connected device accessing the L02CPU in the E71-connected station is described.
When this program is executed, the contents of the following communication messages are displayed in order:
• Batch write command message in word units
• Batch write response message in word units
• Batch read command message in word units
• Batch read response message in word units
Remark
● The following is an outline of how to compile a program created using Microsoft
• Start Visual C++
• Create a project. From [File][New][Project], select ".NET" in "Project Types" and "Empty Project" in
"Templates", and set the project name (e.g. AJSAMP) and location.
• Create a source file. Open Solution Explorer. Then right-click Source Files and select [Add][Add New Item]. Set
the file name (e.g. AJSAMP.cpp) and location, and create a program according to the program example.
• From the project setting window, get WSOCK32.LIB linked. Open Solution Explorer. Then right-click the project
name (AJSAMP) and select [Properties][Configuration Properties][Linker][Command Line]. Type
WSOCK32.LIB in Additional Options and press the OK button.
• On the Build menu, click Build Solution to create an execution file (AJSAMP.EXE).
• Exit Visual C++
• Execute AJSAMP.EXE.
● The following is an outline of how to implement a socket routine call.
(Socket created)
(Communications)
(Sending/reception disabled)
354
.NET.
.NET.
socket()
(Bind)
Passive open
(Open)
listen()
accept()
send()/recv()
shutdown()
(Close)
closesocket
Completed
Start
bind()
Active open
connect()
Corporation Visual C++
.NET.
UDP
sendto()/recvfrom()

Advertisement

Table of Contents
loading

Table of Contents