MELSEC-L CPU Module User`s Manual (Built

SAFETY PRECAUTIONS
(Read these precautions before using this product.)
Before using this product, please read this manual and the relevant manuals carefully and pay full attention
to safety to handle the product correctly.
In this manual, the safety precautions are classified into two levels: "
WARNING" and "
CAUTION".
WARNING
Indicates that incorrect handling may cause hazardous conditions,
resulting in death or severe injury.
CAUTION
Indicates that incorrect handling may cause hazardous conditions,
resulting in minor or moderate injury or property damage.
Under some circumstances, failure to observe the precautions given under "
CAUTION" may lead to
serious consequences.
Observe the precautions of both levels because they are important for personal and system safety.
Make sure that the end users read this manual and then keep the manual in a safe place for future
reference.
[Design Precautions]
WARNING
● Configure safety circuits external to the programmable controller to ensure that the entire system
operates safely even when a fault occurs in the external power supply or the programmable
controller. Failure to do so may result in an accident due to an incorrect output or malfunction.
(1) Emergency stop circuits, protection circuits, and protective interlock circuits for conflicting
operations (such as forward/reverse rotations or upper/lower limit positioning) must be
configured external to the programmable controller.
(2) Machine OPR (Original Point Return) of the positioning function is controlled by two kinds of
data: an OPR direction and an OPR speed. Deceleration starts when the near-point watchdog
signal turns on. If an incorrect OPR direction is set, motion control may continue without
deceleration. To prevent machine damage caused by this, configure an interlock circuit external
to the programmable controller.
(3) When the CPU module detects an error during control by the positioning function, the motion
slows down and stops.
1
[Design Precautions]
WARNING
●
●
●
●
●
●
2
(4) When the programmable controller detects an abnormal condition, it stops the operation and all
outputs are:
• Turned off if the overcurrent or overvoltage protection of the power supply module is activated.
• Held or turned off according to the parameter setting if the self-diagnostic function of the CPU
module detects an error such as a watchdog timer error.
Also, all outputs may be turned on if an error occurs in a part, such as an I/O control part,
where the CPU module cannot detect any error. To ensure safety operation in such a case,
provide a safety mechanism or a fail-safe circuit external to the programmable controller. For a
fail-safe circuit example, refer to "General Safety Requirements" in the MELSEC-L CPU
Module User's Manual (Hardware Design, Maintenance and Inspection).
(5) Outputs may remain on or off due to a failure of a component such as a transistor in an output
circuit. Configure an external circuit for monitoring output signals that could cause a serious
accident.
In an output circuit, when a load current exceeding the rated current or an overcurrent caused by a
load short-circuit flows for a long time, it may cause smoke and fire. To prevent this, configure an
external safety circuit, such as a fuse.
Configure a circuit so that the programmable controller is turned on first and then the external power
supply. If the external power supply is turned on first, an accident may occur due to an incorrect
output or malfunction.
Configure a circuit so that the external power supply is turned off first and then the programmable
controller. If the programmable controller is turned off first, an accident may occur due to an incorrect
output or malfunction.
For the operating status of each station after a communication failure, refer to relevant manuals for
each network. Incorrect output or malfunction due to a communication failure may result in an
accident.
When changing data from a peripheral device connected to the CPU module to the running
programmable controller, configure an interlock circuit in the program to ensure that the entire
system will always operate safely. For other controls to a running programmable controller (such as
program modification or operating status change), read relevant manuals carefully and ensure the
safety before the operation. Especially, in the case of a control from an external device to a remote
programmable controller, immediate action cannot be taken for a problem on the programmable
controller due to a communication failure. To prevent this, configure an interlock circuit in the
program, and determine corrective actions to be taken between the external device and CPU
module in case of a communication failure.
An absolute position restoration by the positioning function may turn off the servo-on signal (servo
off) for approximately 20ms, and the motor may run unexpectedly. If this causes a problem, provide
an electromagnetic brake to lock the motor during absolute position restoration.
[Design Precautions]
CAUTION
● Do not install the control lines or communication cables together with the main circuit lines or power
cables. Keep a distance of 100mm or more between them. Failure to do so may result in malfunction
due to noise.
● During control of an inductive load such as a lamp, heater, or solenoid valve, a large current
(approximately ten times greater than normal) may flow when the output is turned from off to on.
Therefore, use a module that has a sufficient current rating.
● After the CPU module is powered on or is reset, the time taken to enter the RUN status varies
depending on the system configuration, parameter settings, and/or program size.
Design circuits so that the entire system will always operate safely, regardless of the time.
[Installation Precautions]
WARNING
● Shut off the external power supply for the system in all phases before mounting or removing a
module. Failure to do so may result in electric shock or cause the module to fail or malfunction.
[Installation Precautions]
CAUTION
● Use the programmable controller in an environment that meets the general specifications in the
MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection). Failure to
do so may result in electric shock, fire, malfunction, or damage to or deterioration of the product.
● To interconnect modules, engage the respective connectors and securely lock the module joint
levers. Incorrect interconnection may cause malfunction, failure, or drop of the module.
● Do not directly touch any conductive parts and electronic components of the module. Doing so can
cause malfunction or failure of the module.
● Securely connect an extension cable to the connectors of a branch module and an extension
module. After connections, check that the cable is inserted completely. Poor contact may cause
malfunction.
[Wiring Precautions]
WARNING
● Shut off the external power supply for the system in all phases before wiring. Failure to do so may
result in electric shock or cause the module to fail or malfunction.
● After installation and wiring, attach the included terminal cover to the module before turning it on for
operation. Failure to do so may result in electric shock.
3
[Wiring Precautions]
CAUTION
● Ground the FG and LG terminals to the protective ground conductor dedicated to the programmable
controller. Failure to do so may result in electric shock or malfunction.
● Use applicable solderless terminals and tighten them within the specified torque range. If any spade
solderless terminal is used, it may be disconnected when a terminal block screw comes loose,
resulting in failure.
● Check the rated voltage and terminal layout before wiring to the module, and connect the cables
correctly. Connecting a power supply with a different voltage rating or incorrect wiring may cause a
fire or failure.
● Connectors for external devices must be crimped or pressed with the tool specified by the
manufacturer, or must be correctly soldered. Incomplete connections may cause short circuit, fire, or
malfunction.
● Securely connect the connector to the module.
● Do not install the control lines or communication cables together with the main circuit lines or power
cables. Failure to do so may result in malfunction due to noise.
● Place the cables in a duct or clamp them. If not, dangling cable may swing or inadvertently be pulled,
resulting in damage to the module or cables or malfunction due to poor contact.
● Check the interface type and correctly connect the cable.
Incorrect wiring (connecting the cable to an incorrect interface) may cause failure of the module and
external device.
● Tighten the terminal block screw within the specified torque range. Undertightening can cause short
circuit, fire, or malfunction. Overtightening can damage the screw and/or module, resulting in drop,
short circuit, fire, or malfunction.
● When disconnecting the cable from the module, do not pull the cable by the cable part. For the cable
with connector, hold the connector part of the cable. For the cable connected to the terminal block,
loosen the terminal screw. Pulling the cable connected to the module may result in malfunction or
damage to the module or cable.
● Prevent foreign matter such as dust or wire chips from entering the module. Such foreign matter can
cause a fire, failure, or malfunction.
● A protective film is attached to the top of the module to prevent foreign matter, such as wire chips,
from entering the module during wiring. Do not remove the film during wiring. Remove it for heat
dissipation before system operation.
● To use the high-speed counter function, ground the shield cable on the encoder side (relay box).
Always ground the FG and LG terminals to the protective ground conductor. Failure to do so may
cause malfunction.
● Mitsubishi programmable controllers must be installed in control panels. Connect the main power
supply to the power supply module in the control panel through a relay terminal block.
Wiring and replacement of a power supply module must be performed by qualified maintenance
personnel with knowledge of protection against electric shock. For wiring methods, refer to the
MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection).
4
[Startup and Maintenance Precautions]
WARNING
● Do not touch any terminal while power is on. Doing so will cause electric shock or malfunction.
● Correctly connect the battery connector. Do not charge, disassemble, heat, short-circuit, solder, or
throw the battery into the fire. Also, do not expose it to liquid or strong shock.
Doing so will cause the battery to produce heat, explode, ignite, or leak, resulting in injury and fire.
● Shut off the external power supply for the system in all phases before cleaning the module or
retightening the terminal block screw. Failure to do so may result in electric shock.
[Startup and Maintenance Precautions]
CAUTION
● Before performing online operations (especially, program modification, forced output, and operating
status change) for the running CPU module from the peripheral device connected, read relevant
manuals carefully and ensure the safety. Improper operation may damage machines or cause
accidents.
● Do not disassemble or modify the modules. Doing so may cause failure, malfunction, injury, or a fire.
● Use any radio communication device such as a cellular phone or PHS (Personal Handy-phone
System) more than 25cm away in all directions from the programmable controller. Failure to do so
may cause malfunction.
● Shut off the external power supply for the system in all phases before mounting or removing a
module. Failure to do so may cause the module to fail or malfunction.
● Tighten the terminal block screw within the specified torque range. Undertightening can cause drop
of the component or wire, short circuit, or malfunction. Overtightening can damage the screw and/or
module, resulting in drop, short circuit, or malfunction.
● After the first use of the product (module, display unit, and terminal block), the number of
connections/disconnections is limited to 50 times (in accordance with IEC 61131-2). Exceeding the
limit may cause malfunction.
● After the first use of the SD memory card, the number of insertions/removals is limited to 500 times.
Exceeding the limit may cause malfunction.
● Do not drop or apply shock to the battery to be installed in the module. Doing so may damage the
battery, causing the battery fluid to leak inside the battery. If the battery is dropped or any shock is
applied to it, dispose of it without using.
● Before handling the module, touch a conducting object such as a grounded metal to discharge the
static electricity from the human body. Failure to do so may cause the module to fail or malfunction.
● Before testing the operation by the positioning function, set a low speed value for the speed limit
parameter so that the operation can be stopped immediately upon occurrence of a hazardous
condition.
5
[Disposal Precautions]
CAUTION
● When disposing of this product, treat it as industrial waste. When disposing of batteries, separate
them from other wastes according to the local regulations. (For details on battery regulations in EU
member states, refer to the MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance
and Inspection).)
[Transportation Precautions]
CAUTION
● When transporting lithium batteries, follow the transportation regulations. (For details on the
regulated models, refer to the MELSEC-L CPU Module User's Manual (Hardware Design,
Maintenance and Inspection).)
6
CONDITIONS OF USE FOR THE PRODUCT
(1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions;
i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major
or serious accident; and
ii) where the backup and fail-safe function are systematically or automatically provided outside of
the PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT.
(2) The PRODUCT has been designed and manufactured for the purpose of being used in general
industries.
MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY (INCLUDING, BUT NOT
LIMITED TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT,
WARRANTY, TORT, PRODUCT LIABILITY) FOR ANY INJURY OR DEATH TO PERSONS OR
LOSS OR DAMAGE TO PROPERTY CAUSED BY the PRODUCT THAT ARE OPERATED OR
USED IN APPLICATION NOT INTENDED OR EXCLUDED BY INSTRUCTIONS, PRECAUTIONS,
OR WARNING CONTAINED IN MITSUBISHI'S USER, INSTRUCTION AND/OR SAFETY
MANUALS, TECHNICAL BULLETINS AND GUIDELINES FOR the PRODUCT.
("Prohibited Application")
Prohibited Applications include, but not limited to, the use of the PRODUCT in;
• Nuclear Power Plants and any other power plants operated by Power companies, and/or any
other cases in which the public could be affected if any problem or fault occurs in the PRODUCT.
• Railway companies or Public service purposes, and/or any other cases in which establishment of
a special quality assurance system is required by the Purchaser or End User.
• Aircraft or Aerospace, Medical applications, Train equipment, transport equipment such as
Elevator and Escalator, Incineration and Fuel devices, Vehicles, Manned transportation,
Equipment for Recreation and Amusement, and Safety devices, handling of Nuclear or
Hazardous Materials or Chemicals, Mining and Drilling, and/or other applications where there is a
significant risk of injury to the public or property.
Notwithstanding the above, restrictions Mitsubishi may in its sole discretion, authorize use of the
PRODUCT in one or more of the Prohibited Applications, provided that the usage of the PRODUCT
is limited only for the specific applications agreed to by Mitsubishi and provided further that no
special quality assurance or fail-safe, redundant or other safety features which exceed the general
specifications of the PRODUCTs are required. For details, please contact the Mitsubishi
representative in your region.
7
INTRODUCTION
Thank you for purchasing the Mitsubishi MELSEC-L series programmable controllers.
This manual describes the functions of the CPU module and programming necessary for Ethernet communication.
Before using the product, please read this manual and the relevant manuals carefully and develop familiarity with the
functions and performance of the MELSEC-L series programmable controller to handle the product correctly.
When applying the program examples introduced in this manual to the actual system, ensure the applicability and
confirm that it will not cause system control problems.
Please make sure that the end users read this manual.
„Relevant CPU modules: L02CPU, L26CPU-BT, L02CPU-P, and L26CPU-PBT
Remark
This manual does not describe the CPU module functions other than those for Ethernet communication.
For other CPU module functions, refer to the following.
MELSEC-L CPU Module User's Manual (Function Explanation, Program Fundamentals)
MELSEC-L CPU Module User's Manual (Built-In I/O Function)
MELSEC-L CPU Module User's Manual (Data Logging Function)
8
RELEVANT MANUALS
(1) CPU module user's manual
Manual name
Description
<manual number (model code)>
MELSEC-L CPU Module User's Manual
(Hardware Design, Maintenance and Inspection)
<SH-080890ENG, 13JZ36>
MELSEC-L CPU Module User's Manual
(Function Explanation, Program Fundamentals)
Specifications of the CPU modules, power supply modules, display unit,
branch module, extension module, SD memory cards, and batteries,
information on how to establish a system, maintenance and inspection,
and troubleshooting
Functions and devices of the CPU module, and programming
<SH-080889ENG, 13JZ35>
MELSEC-L CPU Module User's Manual (Built-In I/O Function)
<SH-080892ENG, 13JZ38>
MELSEC-L CPU Module User's Manual (Data Logging Function)
<SH-080893ENG, 13JZ39>
The general-purpose I/O function, interrupt input function, pulse catch
function, positioning function, and high-speed counter function of the
CPU module
The data logging function of the CPU module
(2) Programming manual
Manual name
Description
<manual number (model code)>
MELSEC-Q/L Programming Manual (Common Instruction)
<SH-080809ENG, 13JW10>
Detailed description and usage of instructions used in programs
(3) Operating manual
Manual name
Description
<manual number (model code)>
GX Works2 Version1 Operating Manual (Common)
<SH-080779ENG, 13JU63>
GX Developer Version 8 Operating Manual
<SH-080373E, 13JU41>
System configuration, parameter settings, and online operations
(common to Simple project and Structured project) of GX Works2
Operating methods of GX Developer, such as programming, printing,
monitoring, and debugging
(4) I/O module and intelligent function module manua
Manual name
<manual number (model code)>
MELSEC-Q/L MELSEC Communication Protocol Reference Manual
<SH-080008, 13JF89>
Description
Details of MELSEC communication protocol (MC protocol) that is used
for data communication between a target device and a CPU module
9
CONTENTS
CONTENTS
SAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
CONDITIONS OF USE FOR THE PRODUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
RELEVANT MANUALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
MANUAL PAGE ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
TERMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
CHAPTER 1 OVERVIEW
16
CHAPTER 2 COMMUNICATION SPECIFICATIONS
18
CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT
20
3.1
Setting for the CPU Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2
Setting for the Programming Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3
Searching CPU Modules on the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4
Communication via Routers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5
Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
CHAPTER 4 DIRECT CONNECTION TO PROGRAMMING TOOL
(SIMPLE CONNECTION)
4.1
Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2
Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
CHAPTER 5 MC PROTOCOL COMMUNICATION
31
5.1
Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2
MC Protocol Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.2.1
Command list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.2.2
Available devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.3
Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.4
Error Codes for MC Protocol Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
39
6.1
Communication Using TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.2
Communication Using UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.3
Precautions for the Socket Communication Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.4
10
28
Socket Communication Function Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.4.1
Establishing a connection (SP.SOCOPEN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.4.2
Disconnecting a connection (SP.SOCCLOSE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.4.3
Reading out received data in the END processing (SP.SOCRCV) . . . . . . . . . . . . . . . . . . . . 67
6.4.4
Reading out received data during instruction execution (S.SOCRCVS) . . . . . . . . . . . . . . . . 70
6.4.5
Sending data (SP.SOCSND) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.4.6
Reading out connection information (SP.SOCCINF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.4.7
Changing the target of a connection (UDP/IP) (SP.SOCCSET). . . . . . . . . . . . . . . . . . . . . . . 80
6.4.8
Changing the receive mode of a connection (SP.SOCRMODE) . . . . . . . . . . . . . . . . . . . . . . 82
6.4.9
Socket communication receive data read (S(P).SOCRDATA) . . . . . . . . . . . . . . . . . . . . . . . . 85
CHAPTER 7 TIME SETTING FUNCTION ( SNTP CLIENT)
87
7.1
Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.2
Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
90
8.1
Setting for FTP Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.2
Files Transferable Using FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
8.3
Files That Can Be Deleted Using FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.4
FTP Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
8.4.1
8.5
List of FTP commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
8.4.2
How to specify an FTP command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.4.3
Details of FTP commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
CHAPTER 9 REMOTE PASSWORD
109
9.1
Communication Using Remote Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
9.2
Remote Password Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
9.3
Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.4
Detection of Unauthorized Access and Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
115
10.1
Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
10.2
Program to check communications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
10.3
Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
10.4
Errors related to the simple PLC communication function . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
10.5
Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
APPENDICES
133
Appendix 1 Operation Processing Time for Each Instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Appendix 2 Port Numbers Used by System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Appendix 3 Added and Changed Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Appendix 4 Performance List of Simple PLC Communication Function . . . . . . . . . . . . . . . . . . . . . 135
INDEX
137
INSTRUCTION INDEX
139
REVISIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
WARRANTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
11
MANUAL PAGE ORGANIZATION
In this manual, pages are organized and the symbols are used as shown below.
The following page illustration is for explanation purpose only, and is different from the actual pages.
"" is used for
screen names and items.
The chapter of
the current page is shown.
shows operating
procedures.
shows mouse
operations.*1
[ ] is used for items
in the menu bar and
the project window.
The section of
the current page is shown.
Ex. shows setting or
operating examples.
shows reference
manuals.
shows notes that
requires attention.
shows
reference pages.
shows useful
information.
*1 The mouse operation example is provided below. (For GX Works2)
Menu bar
Ex.
[Online]
[Write to PLC...]
Select [Online] on the menu bar,
and then select [Write to PLC...].
A window selected in the view selection area is displayed.
Ex.
[Parameter]
Project window
[PLC Parameter]
Select [Project] from the view selection
area to open the Project window.
In the Project window, expand [Parameter] and
select [PLC Parameter].
View selection area
12
Pages describing instructions are organized as shown below.
The following page illustrations are for explanation purpose only, and are different from the actual pages.
Instruction name
Execution condition of the instruction
Structure of the instruction
in the ladder mode
shows the devices
applicable to the instruction
Descriptions of
setting data and data type
Setting side
User : Device value is set by the user.
System: Device value is set by
the CPU module.
Descriptions of
control data (if any)
Detailed descriptions
of the instruction
Conditions for the error and
error codes
For the errors not described in
this manual, refer to the following.
MELSEC-Q/L Programming
Manual (Common Instruction)
Simple program example(s)
and descriptions of the devices used
13
• Instructions can be executed under the following conditions.
Execution condition
Any time
Symbol
No symbol
On the falling
During on
edge
During off
On the falling
edge
• The following devices can be used.
Internal device
Setting
(system, user)
data
Applicable
device*1
Bit
Word
X,Y,M,L,S
M,F,B,SB,F
T,ST,C,D,W,
SD,SW,FD,
X,FY*2
@†
Link direct device
Intelligent
J†\†
function
File
register
Bit
R,ZR
Word
module
U†\G†
U†\G†
-
Con
stant
Zn
*3
Z
K, H,
E, $
*1
For details on each device, refer to the following
*2
*3
MELSEC-L CPU Module User's Manual (Function Explanation, Program Fundamentals)
FX and FY can be used for bit data only, and FD for word data only.
In the "Constant" and "Others" columns, a device(s) that can be set for each instruction is shown.
• The following data types can be used.
Data type
Bit
14
Index
register
Description
Bit data or the start number of bit data
BIN 16-bit
16-bit binary data or the start number of word device
BIN 32-bit
32-bit binary data or the start number of double-word device
BCD 4-digit
Four-digit binary-coded decimal data
BCD 8-digit
Eight-digit binary-coded decimal data
Real number
Floating-point data
Character string
Character string data
Device name
Device name data
Other*3
P,I,J,U,D
X,DY,N,B
L,TR,BL\
S,V
TERMS
Unless otherwise specified, this manual uses the following terms.
Term
CPU module
Description
The abbreviation for the MELSEC-L series CPU module
Power supply module
The abbreviation for the MELSEC-L series power supply module
Branch module
The abbreviation for the MELSEC-L series branch module
Extension module
The abbreviation for the MELSEC-L series extension module
END cover
A cover to be attached to the right side of the rightmost MELSEC-L series module
Display unit
A liquid crystal display to be attached to the CPU module
SD memory card
Secure Digital Memory Card, which is a flash memory device. The L1MEM-2GBSD and L1MEM-4GBSD are
available.
Extension cable
The abbreviation for the MELSEC-L series extension cable
LCPU
Another term for the MELSEC-L series CPU module
Programming tool
A generic term for GX Works2 and GX Developer
GX Works2
GX Developer
The product name of the software package for the MELSEC programmable controllers
CC-Link
The abbreviation for Control & Communication Link. A field network system where data processing for
control and information can be simultaneously performed at high speed.
MC protocol
The abbreviation for the MELSEC communication protocol, a protocol to access a CPU module from a target
device in the Ethernet or serial communication
FTP
The abbreviation for File Transfer Protocol, which is a standard network protocol used to exchange files
SNTP
The abbreviation for Simple Network Time Protocol, which is a protocol for synchronizing the clocks of
computer systems over a TCP/IP based network
15
CHAPTER 1
OVERVIEW
The following describes the built-in Ethernet function of the CPU module.
(1) Connection of programming tools and GOTs (
Page 20, CHAPTER 3)
• By using a hub, the CPU module can be connected to multiple programming tools and GOTs.
Up to 16 external devices can be connected to a single CPU module at the same time.
• When CPU modules and a programming tool are connected to the same hub, these CPU modules can be
searched from the programming tool. Displayed search results include IP addresses so that any of them can
be specified.
• MELSOFT connection allows access through routers in an environment such as a corporate LAN.
(2) Direct connection to a programming tool (simple connection)
(
Page 28, CHAPTER 4)
The CPU module can be directly connected to a programming tool with a single Ethernet cable only, without using
a hub (simple connection).
For direct connection, the IP address and host name need not be specified in the transfer setup.
(3) MC protocol communication (
Page 31, CHAPTER 5)
From an external device such as a personal computer or HMI, device data of the CPU module can be read or
written, and this allows CPU module operation monitoring, data analysis, and production control.
(4) Socket communication function (
Page 39, CHAPTER 6)
By using instructions dedicated to socket communication, any data can be transferred from and to the external
devices connected through Ethernet using TCP or UDP.
(5) Time setting function (SNTP client) (
Page 87, CHAPTER 7)
• Automatic time setting of the CPU module can reduce the maintenance cost for time setting.
• Because the same time information is shared among the CPU modules on Ethernet, in which order the
problems have occurred will be clear, resulting in fast and easy problem resolution.
• Since the automatic time setting is enabled upon power-on of the CPU module, operations can be started
based on accurate clock data.
(6) File transfer function (FTP) (
Page 90, CHAPTER 8)
Each of the files stored in the CPU module can be read or written from the interfacing device with the FTP client
function, and a large amount of data can be easily transferred.
(7) Remote password (
Page 109, CHAPTER 9)
Remote password setting can prevent unauthorized access from the outside and enhance the security of the
system.
(8) Simple PLC communication function (
Page 115, CHAPTER 10)
Device data can be communicated between the CPU modules connected with Ethernet cable without
programming.
16
CHAPTER 1 OVERVIEW
Memo
1
17
CHAPTER 2
COMMUNICATION SPECIFICATIONS
The following are the communication specifications of the built-in Ethernet port of the CPU module.
Item
Specification
Data transfer speed
100 or 10 Mbps
Communication mode
Full-duplex or half-duplex
Transmission method
Base band
Maximum distance between hub
Transmission
100 m
and node
specifications
Maximum
10BASE-T
Cascade connection: Up to four*2
100BASE-TX
Cascade connection: Up to two*2
number of
nodes/
connection
TCP/IP
Number of
connections
Total of 16 for socket communications, MELSOFT connections, and MC
protocol.
UDP/IP
Connection cable *1
*1
*2
*3
10BASE-T
One for FTP
Ethernet cable of category 3 or higher (STP/UTP cable)*3
100BASE-TX
Ethernet cable of category 5 or higher (STP cable)
Straight cables can be used.
When the CPU module is directly connected to GOT with Ethernet cable, a cross cable of Category 5e or lower can also
be used.
This number applies when a repeater hub is used.
When using a switching hub, check the number of cascaded stages with the manufacturer of the hub to be used.
Use of STP cables is recommended in an environment with noise.
Hubs with 10BASE-T or 100BASE-TX ports*4 can be used.
Up to 16 external devices can access one CPU module at the same time.
*4
The ports must comply with the IEEE802.3 10BASE-T or IEEE802.3 100BASE-TX standards.
● When connected to a hub, the CPU module determines the cable used (10BASE-T or 100BASE-TX) and the
communication mode (full-duplex or half-duplex) according to the hub.
Set the hub into the half-duplex mode if the hub that does not have the auto-negotiation function.
● The operation of commercial devices used for the following applications is not guaranteed. Check the operation before
using the module.
• Internet (general public line)
(Internet-access service offerred by an Internet service provider or a telecommunications carrier)
• Firewall device(s)
• Broadband router(s)
• Wireless LAN
● If Ethernet communication is performed with "Specify service process execution counts" selected for "Service processing
setting" in the PLC system tab of PLC parameter, a scan time increases by time for service processing. (approximately
500ms)
To reduce it to 500ms or less, select an item other than "Specify service process execution counts".
(Example: Select "Specify service process time" and then enter a time value.)
● If broadcast storm occurs in the network, scan time may be increased.
18
CHAPTER 2 COMMUNICATION SPECIFICATIONS
Remark
TCP and UDP are defined as follows:
• TCP (Transmission Control Protocol)
In communications among programmable controllers and networked devices, this protocol establishes a
connection between port numbers of the two devices to perform reliable data communications.
• UDP (User Datagram Protocol)
This is a connectionless protocol and thereby its speed is faster than that of TCP. However, the reliability in data
communications is low. (Data may be lost or not be received in correct order.) Note that symultaneous broadcast
is available.
Select an appropriate protocol, considering the specifications of the external device and the characteristics of the above
protocols.
19
2
CHAPTER 3
CONNECTION OF PROGRAMMING
TOOLS AND GOT
This chapter explains how to connect the CPU module to a programming tool or GOT.
Ethernet
Hub
Programming
tool
Programming
tool
GOT
To start Ethernet communication, perform the following steps.
Start
Setting parameters
Writing to the CPU module
Configure PLC parameters by the programming tool.
Page 21, Section 3.1
(
)
Write the configured parameters to the CPU module.
Power it on again or reset it for the parameters to
take effect.
Page 21, Section 3.1
(
)
Connecting cables and external devices
Connect cables and devices required for Ethernet
communication.
Setting the connection target
Set a connection target by the programming tool.
Page 23, Section 3.2
(
)
End
For the GOT setting, refer to the following manual.
GOT1000 Series Connection Manual (Mitsubishi Products)
20
CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT
3.1
Setting for the CPU Module
(1) PLC parameter setting
Select the "Built-in Ethernet Port Setting" tab and set the parameters.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
2.
1.
1.
2.
3
Set the IP address of the CPU module.
Set MELSOFT connection.
[Parameter]
[PLC Parameter]
3.1 Setting for the CPU Module
Project window
[Built-in Ethernet Port Setting]
[Open Setting]
Item
Setting
Protocol
Select "TCP" or "UDP" depending on the connected device.
Open System
Select "MELSOFT Connection".
21
(2) Writing to the CPU module
From the "Write to PLC" screen, write the parameter settings to the CPU module.
[Online]
[Write to PLC]
After writing the parameters to the CPU module, power off and on or reset the CPU module to enable the
parameters.
22
CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT
3.2
Setting for the Programming Tool
Configure the settings in the "Transfer Setup" dialog box.
Connection Destination window
[Connection1]
3
2.
1.
3.
1.
Select "Ethernet Board" for "PC side I/F".
In the "PC side IF Ethernet Board Setting" dialog box, select a "TCP" or "UDP" protocol. (
Section 3.1 Select the same protocol as the one set in the Open Setting dialog box.)
3.2 Setting for the Programming Tool
2.
Page 21,
Select "PLC Module" for "PLC side I/F".
Enter the IP address or host name of the CPU module in the "PLC side I/F Detailed Setting of PLC
Module" dialog box, as shown below.
(For the host name, enter the name set in the Microsoft® Windows® hosts file.)
3.
Set "Other Station Setting".
Select an item appropriate to the operating environment.
23
3.3
Searching CPU Modules on the Network
In a configuration using a hub, clicking
in the "PLC side I/F Detailed Setting of PLC Module"
dialog box will start searching for CPU modules connected to the hub where the programming tool is also connected,
and display a list of them.
Clicking the
button
will automatically enter
the IP address of the CPU.
• CPU modules connected to cascaded hubs are also searched and a list of them is displayed.
• CPU modules connected via a router cannot be searched.
• Some CPU modules connected via wireless LAN may not be found since Ethernet communication may not
be stable due to packet loss.
• If multiple CPU modules with the same IP address are found in the list, check the IP address parameters for
the CPU modules. Starting communication with the IP address duplicated will cause a communication error.
• Appropriate CPU modules may not be found if a heavy load for service processing is applied.
Increase the response waiting time value in the "Find CPU (Built-in Ethernet port)" dialog box, or the service
processing time value in the Service processing setting tab of PLC parameter.
• By selecting the option shown below in the Built-in Ethernet port tab of PLC parameter, the Find CPU
function can be disabled and the system does not respond to a search request on the network.
24
CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT
3.4
Communication via Routers
From the built-in Ethernet port, access is available via routers on a network such as a corporate LAN.*1
3
Router
Personal
computer
Corporate LAN
Factory
*1
Control room
The following functions do not support the communication via routers.
• Searching CPU modules on the network
• Simultaneous broadcast in socket communication
For access via routers, set the parameters as shown below.
Page 21, Section 3.1 (for other settigs)
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
3.4 Communication via Routers
Set the subnet mask pattern
and the default router
IP address.
25
3.5
Precautions
(1) IP address duplication
Check that the IP address is not duplicated when configuring a network or connecting a new device to a network.
If the IP address is duplicated, a device may communicate with the wrong device.
Check for the IP address duplication in the following ways.
• Check for the IP address duplication with the find CPU function.
• Disconnect the device from the line and send ping to the IP address of the disconnected device.
Having a response means the IP address duplication.
(2) KeepAlive check
When the protocol is set to TCP, KeepAlive check is performed. (Checking for a response to a KeepAlive ACK
message)
An alive check message is sent five seconds after reception of the last message from the connected device to
check if the device returns a response or not. If no response is received, the alive check message will be resent at
intervals of five seconds. When no response is received for 45 seconds, the connected device is regarded as
non-existent and the connection is disconnected. If the connected device does not support the TCP KeepAlive
function, the connection may be disconnected.
(3) Connections exceeding the setting
Do not exceed the number of connections set for the open settings parameters. Establishing too many TCP
connections from a personal computer may cause the following states, depending on the application.
• Time before timeout error detection is increased.
• An unexpected timeout error occurs in any of the communicating devices.
(4) Retransmission on TCP connection
If no ACK response is returned from the other end of a TCP connection, the ACK will be resent six times, starting
in 0.3 seconds after the first transmission, and then 0.6, 1.2, 2.4, 4.8, and 9.6 seconds. When no TCP ACK
response is returned within 19.2 seconds after the last retransmission, the device is regarded as faulty and the
connection is disconnected. (As a result, the connection is disconnected in total of 38.1 seconds.)
26
CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT
(5) MELSOFT connection over UDP
For UDP communications with multiple MELSOFT devices, set the same number of connections as that of the
connected MELSOFT devices on the screen displayed from PLC parameter.
3
Ethernet
Hub
MELSOFT devices
MELSOFT devices
MELSOFT devices
Set the same number
of protocols as that of
MELSOFT devices.
(6) Sampling trace
When the sampling trace function has been executed by the programming tool from the built-in Ethernet port, stop
the function before powering off or resetting the CPU module.
(7) Remote STOP or remote PAUSE
When remote STOP or remote PAUSE has been implemented by the programming tool from the built-in Ethernet
port, perform the following before powering off or resetting the CPU module.
• Remote RUN
• Remote RESET
27
3.5 Precautions
When all MELSOFT devices start to communicate simultaneously, the communication may be difficult to succeed due to the
concentration of communication. In this case, start each MELSOFT device at different timings not to concentrate the starts.
For example, when using GOTs, set the rising time and the communication timeout time in each GOT.
CHAPTER 4
DIRECT CONNECTION TO
PROGRAMMING TOOL (SIMPLE
CONNECTION)
The CPU module can be directly connected to the programming tool with an Ethernet cable, without using a hub
(simple connection).
For direct connection, the IP address and host name need not be specified in the connection target setting.
(Simultaneous broadcast is used.)
Programming tool
Ethernet cable
An Ethernet cable used for direct connection will be longer compared with the case of using a USB cable. This can cause an
unauthorized connection from a remote location.
Unauthorized connections can be prevented by selecting the following option in the Built-in Ethernet port tab of the PLC
parameter dialog box.
28
CHAPTER 4 DIRECT CONNECTION TO PROGRAMMING TOOL (SIMPLE CONNECTION)
4.1
Setting Method
Set the items on the Transfer Setup screen.
Connection Destination window
[Connection1]
4
2.
1.
3.
Select "Ethernet Board" for "PC side I/F".
Select "PLC Module" for "PLC side I/F".
4.1 Setting Method
1.
2.
In the "PLC side IF Detailed Setting of PLC Module" dialog box, select the Ethernet Port Direct
Connection checkbox as shown below.
3.
Complete setting of "Other Station Setting".
Select an item appropriate to the operating environment.
29
4.2
Precautions
(1) Connection to LAN line
When connecting the CPU module to a LAN line, do not set direct connection. Doing so will apply a load to the
LAN line and adversely affect communications with other external devices.
(2) Indirect connection
• Do not set up direct connection when a CPU module is connected to an external device in an one-to-one
basis using a hub as shown below
Hub
• When two or more Ethernet ports are enabled in the network connections setting on the personal computer,
communication by direct connection is not possible. In the setting, leave only one Ethernet port enabled for
direct connection and disable other Ethernet ports.
(3) Conditions that disallow direct connection
When any of the following conditions is met, communication by direct connection may not be available. In that
case, check the setting of the CPU module and/or personal computer.
• In the CPU module IP address bits, the bits corresponding to "0" in the personal computer subnet mask are
all ON or all OFF.
Ex.
CPU module IP address
:
64.
64.
255.
255
Personal computer IP address
:
64.
64.
1.
1
Personal computer subnet mask
:
255.
255.
0.
0
• In the CPU module IP address bits, the bits corresponding to the host address of the class in the personal
computer IP address are all ON or all OFF.
Ex.
CPU module IP address
:
64.
64.
255.
255
Personal computer IP address
:
192.
168.
0.
1
Personal computer subnet mask
:
255.
0.
0.
0
Remark
● The IP address pattern for each class is as follows.
Class A: 0.x.x.x to 127.x.x.x
Class B:128.x.x.x to 191.x.x.x
● The host address for each class is the part shown with "0".
Class A: 255. 0. 0. 0
Class B: 255.255. 0. 0
30
Class C:192.x.x.x to 223.x.x.x
Class C: 255.255.255. 0
CHAPTER 5 MC PROTOCOL COMMUNICATION
CHAPTER 5
MC PROTOCOL COMMUNICATION
The built-in Ethernet port allows MC protocol communication. From an peripheral device such as a personal computer
or HMI, device data of the CPU module can be read or written using MC protocol. Monitoring of CPU module
operation, data analysis, and production control are available on a personal computer or HMI by these device data
reading and writing.
Besides, the remote password function can prevent unauthorized access from outside of the system. (
Page
109, CHAPTER 9)
Personal computer, HMI, etc.
5
Hub
Communication using MC protocol
From the peripheral device such as a personal computer or HMI, only the CPU module connected can communicate using
MC protocol.
An access to a CPU on another station via CC-Link network is not allowed.
To start MC protocol communication, perform the following steps.
Start
Connecting cables and external devices
Setting parameters
Writing to the CPU module
End
Connect cables and devices required for MC protocol
communication.
Configure PLC parameters by the programming tool.
(
)
Page 32, Section 5.1
Write the configured parameters to the CPU module.
Power it on again or reset it for the parameters
to take effect.
MC protocol communication is available.
For the MC protocol communication, refer to the following manual.
MELSEC-Q/L MELSEC Communication Protocol Reference Manual
Remark
Access through routers is also available. When configuring the settings for it, set the subnet mask pattern and default router
IP address. (
Page 25, Section 3.4)
31
5.1
Setting Method
Setting for communication using the MC protocol is described below.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
3.
1.
2.
1.
2.
Select Binary or ASCII code as the communication data code used for MC protocol.
Select the "Enable online change (FTP, MC Protocol)" checkbox to enable data to be written to the
CPU module even in the RUN state.
32
CHAPTER 5 MC PROTOCOL COMMUNICATION
3.
Set connections used for MC protocol communication.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Open Setting]
5
Item
Description
Protocol
Select TCP or UDP depending on the target device.
Open System
Select "MC Protocol".
Host Station Port
No.
Since used by the system, 1388H to 1391H cannot be set. ( Page 134, Appendix 2)
When the "Enable online change (FTP, MC protocol)" setting is disabled, if the CPU module in the RUN state receives a data
write request from the target device, data will not be written and an NAK message will be returned.
33
5.1 Setting Method
*1
Set the port number of the host station. (Setting range: 0401H to 1387H, 1392H to FFFEH)*1
5.2
MC Protocol Commands
5.2.1
Command list
The following commands are executable for MC protocol communication of the CPU module.
: Available, ×: N/A
CPU module state
Command
(Subcomm
and)*1
Function
Batch read
Batch write
Device
memory
Random
read *2
In units
of words
0401
(0000)
In units
of bits
1401
(0001)
In units
of words
1401
(0000)
Reads bit devices in units of one point.
ASCII: 3584 points
BIN: 7168 points
Reads bit devices in units of 16 points.
960 words
(15360 points)
Reads word devices in units of one point.
960 points
Writes bit devices in units of one point.
ASCII: 3584 points
BIN: 7168 points
Writes bit devices in units of 16 points.
960 words
(15360 points)
Writes word devices in units of one point.
960 points
Reads bit devices in units of 16 or 32 points by
randomly specifying the target.
0403
(0000)
In units
of bits
1402
(0001)
In units
of words
*2
1402
(0000)
Monitor
registration
*2*3*4
In units
of words
0801
(0000)
Monitor
In units
of words
0802
(0000)
Monitors the devices registered.
Unlock
1630
(0000)
Specifies a remote password to unlock the locked
state.
-
Lock
1631
(0000)
Specifies a remote password to lock the unlocked
state.
-
*1
*2
*3
*4
*5
34
0401
(0001)
Number of
processed points
In units
of words
Test
(Random
write)
Remote
password
In units
of bits
Description
Reads word devices in units of one or two points by
randomly specifying the target.
Sets or resets bit devices in units of one point by
randomly specifying the target.
Sets or resets bit devices in units of 16 or 32 points
by randomly specifying the target.
Writes word devices in units of one or two points by
randomly specifying the target.
Registers bit devices to be monitored in units of 16
or 32 points.
Registers word devices to be monitored in units of
one or two points.
RUN
STOP
Write
enabled
Write
disabled
×
192 points
188 points
×
*5
192 points
Number of
registered points
These commands are for QnA-compatible 3E frames.
Devices, TS, TC, SS, SC, CS, and CC cannot be specified in units of words.
Specifying any of these for monitor registration will cause an error (4032H) at the time of monitoring execution.
For monitor registration, monitoring conditions cannot be set.
Do not execute monitor registration from multiple devices. If executed, the last monitor registration takes effect.
Set the number of processed points so that the following condition is satisfied.
(Number of word access points) × 12 + (Number of double-word access points) × 14 ≤ 1920
For bit devices, one point is regarded as 16 bits in word access and 32 bits in double-word access.
For word devices, one point is regarded as one word in word access, and two words in double-word access.
CHAPTER 5 MC PROTOCOL COMMUNICATION
5.2.2
Available devices
The following table lists the devices available in the commands used for MC protocol communication.
Classification
Device code*1
Device
Input
X*
9CH
Device number range
The number range of a device in a CPU module,
which is accessed to, can be specified.
Hexadecimal
Output
Y*
Internal relay
M*
90H
Decimal
Latch relay
L*
92H
Decimal
Annunciator
F*
93H
Decimal
Edge relay
V*
94H
Decimal
Link relay
B*
A0H
Hexadecimal
Data register
D*
A8H
Decimal
Hexadecimal
Timer
Internal user device
Retentive
timer
Counter
W*
B4H
Contact
TS
C1H
Coil
TC
C0H
Current value
TN
C2H
Contact
SS
C7H
Coil
SC
C6H
Current value
SN
C8H
Contact
CS
C4H
Coil
CC
C3H
The number range of a device in a CPU module,
which is accessed to, can be specified.
Hexadecimal
Note that the access to a local device is not possible.
Decimal
Decimal
C5H
A1H
Hexadecimal
Link special register
SW
B5H
Hexadecimal
Step relay
S*
98H
Decimal
DX
A2H
Hexadecimal
DY
A3H
Hexadecimal
Special relay
SM
91H
Decimal
Special register
SD
A9H
Z*
CCH
R*
AFH
Decimal
ZR
B0H
Hexadecimal
Direct
Direct output
*2
Index register
Decimal
The number range of a device in a CPU module,
which is accessed to, can be specified.
Decimal
File register
File register
Extended data register
Extended data register
D*
A8H
Decimal
Extended link register
Extended link register
W*
B4H
Hexadecimal
*1
Device code is the code that is specified in the MC protocol message.
When data are communicated using ASCII code, use the device code of two characters. For the device code of one
character, add "*" (ASCII code: 2AH) or add space (ASCII code: 20H) after the character.
*2
For the L02CPU and L02CPU-P, devices of DX/DY400 or later number cannot be used. To access the devices of X/Y400
or later number, use X or Y device.
For the L26CPU-BT and L26CPU-PBT, devices of DX/DY1000 or later number cannot be used. To access the devices of
X/Y1000 or later number, use X or Y device.
35
5.2 MC Protocol Commands
5.2.2 Available devices
CN
SB
input*2
5
Decimal
Link special relay
Current value
Index register
Binary
9DH
Link register
Internal system device
ASCII
5.3
Precautions
(1) Number of devices
Only the external devices whose open system is set to "MC Protocol" can be connected concurrently using MC
protocol.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Open Setting]
(2) Data communication frame
The QnA-compatible 3E frames only are applicable to CPU modules.
(3) Access range
• Only the connected CPU module can be accessed. Accessing another module will cause an error.
• Accessing another station on a network such as CC-Link is not allowed via the connected CPU module.
(4) When UDP is selected for Protocol
• If a new request message is sent to a UDP port after the previous request message is sent to the same port
and before no response is returned, the new request message will be discarded.
• Setting the same host station port number for multiple UDP connections is regarded as one setting. For
communication with multiple devices using the same host station port number, select TCP.
(5) File access during MC communication
The CPU module will perform file access processing prior to Ethernet communication processing. Because of
this, processing of the MC protocol function may be delayed if a file is accessed by FTP or a programming tool
during use of the MC protocol function.
When accessing a file while response time monitoring is performed on the connected device with the MC protocol
function, add the time required for file access to the monitoring time.
36
CHAPTER 5 MC PROTOCOL COMMUNICATION
(6) Receiving a response message
The following shows an example of receive processing on the other device side.
Communication processing on the other device side
Request message, send processing
Response message, receive processing
NO
Is TCP connection open?
YES
Received data
within the time specified by
the monitoring timer
value?
5
NO
YES
Check the received data size.
NO
Sufficient receive
data size?
YES
Processing for the response message
Was the entire
received message
processed?
NO
5.3 Precautions
YES
End
Error handling
For Ethernet communication, TCP socket functions are used inside personal computers.
The functions do not have boundary concept. Therefore, if the sender sent data by calling the "send" function once, the
receiver needs to call the "recv" function once or more times to read out the data. ("send" does not correspond to "recv" on
the one-to-one basis.)
For this reason, the processing shown above is always required on the program of the receiving device.
Note that, if the "recv" function is used in blocking mode, data may be read by calling the function once.
37
5.4
Error Codes for MC Protocol Communication
When an error occurs during MC protocol communication, an errror code is sent from the CPU module to the external
device. The following table lists error codes, error descriptions, and corrective actions.
Error code
Description
(Hexadecimal)
4000H to 4FFFH
Refer to the following manual.
MELSEC-L CPU Module User's Manual (Hardware Design,
Maintenance and Inspection)
0055H
Although online change is disabled, the connected device
requested the RUN-state CPU module for data writing.
• Before enabling online change, write the data.
• Change the CPU module state to STOP and write the data.
C050H
When "Communication Data Code" is set to ASCII Code, ASCII
code data that cannot be converted to binary were received.
• Select Binary Code for "Communication Data Code", and restart
the CPU module.
• Correct the send data of the connected device and resend the
data.
The number of read or write points is outside the allowable range.
Correct the number of read or write points, and resend the data to
the CPU module.
C056H
The read or write request exceeds the maximum address.
Correct the start address or the number of read or write points, and
resend the data to the CPU module.
(The maximum address must not be exceeded.)
C058H
The request data length after ASCII-to-binary conversion does not
match the data size of the character area (a part of text data).
Check and correct the text data or the request data length of the
header, and resend the data to the CPU module.
C051H to C054H
C059H
38
Errors detected by the CPU module
(Errors occurred in other than MC protocol communication)
Corrective action
• The command and/or subcommand are specified incorrectly.
• The CPU module does not support the command and/or
subcommand.
• Check the request.
• Use commands and/or subcommands supported by the CPU
module.
C05BH
The CPU module cannot read data from or write data to the
specified device.
Check the device to be read or written.
C05CH
The request data is incorrect. (e.g. reading or writing data in units of
bits from or to a word device)
Correct the request data and resend it to the CPU module.
(e.g. subcommand correction)
C05DH
No monitor registration
Perform monitor registration before monitoring.
• Correct the network number, PC number, request destination
module I/O number, or request destination module station
number.
• Correct the read/write request data.
C05FH
The request cannot be executed to the CPU module.
C060H
The request data is incorrect. (ex. incorrect specification of data for
bit devices)
Correct the request data and resend it to the CPU module.
C061H
The request data length does not match the number of data in the
character area (a part of text data).
Check and correct the text data or the request data length of the
header, and resend the data to the CPU module.
C06FH
The CPU module received a request message in ASCII format
when "Communication Data Code" is set to Binary Code, or
received it in binary format when the setting is set to ASCII Code.
(This error code is only registered to the error history, and no
abnormal response is returned.)
C070H
The device memory extension cannot be specified for the target
station.
C0B5H
The CPU module cannot handle the data specified.
C200H
The remote password is incorrect.
Correct the remote password, and unlock and lock the remote
password function again.
C201H
The port used for communication is locked with the remote
password.
Or, because of the remote password lock status with
"Communication Data Code" set to ASCII Code, the subcommand
and later part cannot be converted to a binary code.
Unlock the remote password before communication.
C204H
The connected device is different from the one that requested for
unlock processing of the remote password.
From the device that requested the unlock processing, request for
lock processing of the remote password.
• Send a request message that matches the "Communication Data
Code" setting.
• Change the "Communication Data Code" setting so that it will
match the request message.
Read data from or write data to the device memory without
specifying the extension.
• Correct the request data.
• Stop the current request.
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
CHAPTER 6
SOCKET COMMUNICATION
FUNCTION
The socket communication function allows data communications with the devices on Ethernet by TCP or UDP using
various dedicated instructions.
Sending data
SP.SOCSND instruction
Socket communication
receive area *1
Connection No.1
Program
SP.SOCRCV instruction
S.SOCRCVS instruction
Reading receive data
Connection No.2
Connection No.3
to
Receiving data
6
External device
Connection No.16
*1
The area is used for storing data received from the connected open devices.
Remark
• For dedicated instructions used for the socket communication function, refer to:
Page 58, Section 6.4
• Access through routers is also available (except for simultaneous broadcast). When configuring the settings
for it, set the subnet mask pattern and default router IP address. (
Page 25, Section 3.4)
39
(1) Port numbers
In socket communication, port numbers are used to identify respective communications and thereby multiple
communications are available both on TCP and UDP.
• For sending
Specify the port number of the CPU module from which data are sent, and the port number of the destination
device.
• For receiving
Specify the port number of the CPU module, and read out the data sent to the port.
CPU module
(IP address: xx.xx.xx.xx)
Ethernet
Sending UDP data from port No.A of the CPU
module to port No.L of external device 1
External device 1
(IP address: yy.yy.yy.yy)
Port No.A
Sending UDP data from port No.L of
external device 1 to port No.A of the CPU
module
Port No.L
Sending data via TCP connection
External device 2
(IP address: zz.zz.zz.zz)
Port No.B
Sending data via TCP connection
Port No.M
Sending UDP data from port No.C of the CPU
module to port No.N of external device 3
External device 3
(IP address: ww.ww.ww.ww)
Port No.C
40
Sending UDP data from port No.N of
external device 3 to port No.C of the CPU
module
Port No.N
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
6.1
Communication Using TCP
TCP (Transmission Control Protocol) establishes a connection to a device with a port number, and preforms reliable
data communications.
To perform socket communication using TCP, confirm the following in advance.
• IP address and port number of the target device
• IP address and port number of the CPU module
• Which side will open a connection, the target device or CPU module?
(Active open or Passive open)
(1) TCP connection
There are two types of open operation for TCP connection: Active open and Passive open.
Firstly, the device waiting for a TCP connection performs a Passive open at the specified port.
The other device performs an Active open by specifying the port number of the device which is waiting in Passive
open state.
6
Through the above process, a TCP connection is established and communication is available.
(a) Active open
Active open is a TCP connection method, which actively opens a connection to the device that is passively
waiting for a TCP connection.
(b) Passive open
The following two types of Passive open methods are available for TCP connection.
• Unpassive :
Allows a connection regardless of the IP address and port number of the connected device.
instruction.)
• Fullpassive :
Allows a connection to the device only when the specified IP address and port number are met.
A connection made by another device that does not have the specified IP address and port number is
automatically disconnected before communication.
Remark
The expressions of Active and Passive opens may vary according to the device.
• Active open: TCP connection initiating device, client, connecting side, etc.
• Passive open: TCP connection waiting device, server, listening side, etc.
41
6.1 Communication Using TCP
(The IP address and port number of the device connected can be acquired using the SP.SOCCINF
(2) Program example for Active open
The following shows a communication flow of an Active open.
Specify the port number of the external device waiting for
TCP connection and open a connection by Active open.
Start
Open processing:
SP.SOCOPEN instruction
Was data transfer
completed?
YES (Completed, or disconnected by the external device.)
NO
Send by the SP.SOCSND
instruction, or receive by the
SP.SOCRCV or
S.SOCRCVS instruction.
Close processing:
SP.SOCCLOSE instruction
End
(a) Parameter setting
The following parameters are set for the sample program.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Open Setting]
Item
Protocol
TCP
Open System
Socket Communication
TCP Connection
Active
Host Station Port No.
1000H (Setting range: 0001H to 1387H, 1392H to FFFEH)*1
Destination IP Address
192.168.3.40 (Setting range: 0.0.0.1 to 223.255.255.254)
Destination Port No.
1000H (Setting range: 0001H to FFFEH)
*1
42
Setting
Since used by the system, 1388H to 1391H cannot be set. (
Page 134, Appendix 2)
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(b) Devices used in the program
The following table lists the device numbers and applications used in the sample program.
Device number
M1000
Application
Open direction
D100 to D109
SP.SOCOPEN instruction control data
M100 and M101
SP.SOCOPEN instruction completion device
M1002
Normal open indication
M1003
Open error indication
M3000
Send direction
D3000 and D3001
SP.SOCSND instruction control data
M300 and M301
SP.SOCSND instruction completion device
D300 to D303
Send data length and send data (6 bytes of 12H, 34H, 56H, 78H, 9AH, and BCH)
M3002
Normal send indication
M3003
Send error indication
M4000
Close direction
M4001
Disconnection by the other device
SD1282
Open completion signal
SD1284
Open request signal
SD1286
Receive state signal
SD1288
Connection state signal
D200 and D201
SP.SOCCLOSE instruction control data
M200 and M201
SP.SOCCLOSE instruction completion device
Normal close indication
M4003
Close error indication
M4004
Closing flag
D400 to D403
SP.SOCRMODE instruction control data
D5000 and D5001
SP.SOCRCV instruction control data
M500 and M501
SP.SOCRCV instruction completion device
D500 and higher
Receive data length and receive data
M5002
Normal receive indication
M5003
Receive error indication
6.1 Communication Using TCP
M4002
6
43
(c) Sample program
<<Fixed length mode setting>>
*1
Setting TCP receive mode to 1
Setting receive data size to 6
<<Connection No.1 open processing (Active)>>
Changing TCP receive mode of
Connection No.1
Setting Execution/completion
type to 0
Connection No.1 open
Normal completion
Error completion
<<Data sending>>
Setting send data length
Setting send data
Sending data to Connection No.1
Normal completion
Error completion
<<Data receiving>>
Receiving data
Normal completion
Error completion
<<Connection No.1 close processing>>
Processing for disconnection
by the target
Connection No.1 close
Setting closing flag
Normal completion
Error completion
Resetting closing flag
*1
There are two kinds of TCP receive modes: TCP standard receive mode and TCP fixed-length receive mode.
For fixing the data size, run the program enclosed by a dotted line.
(It can be omitted when the data size is not fixed.)
For the TCP receive mode, refer to the section for the SP.SOCRMODE instruction. (
44
Page 82, Section 6.4.8)
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(d) Precaution for Active open communication
Configure an interlock circuit using the Open completion signal (SD1282) and Open request signal (SD1284) in
the program.
The following chart shows on/off timings of the Open completion signal and Open request signal.
<When disconnected by the CPU module>
Open completion signal ON
(SD1282)
OFF
Open request signal
(SD1284)
TCP disconnection completed upon
response from the external device
ON
TCP disconnection request from the CPU module
OFF
SOCOPEN instruction
SOCCLOSE instruction
<When disconnected by the external device>
TCP disconnection request from the external device
TCP disconnection completed upon
response from the CPU module
6
SOCCLOSE instruction
6.1 Communication Using TCP
45
(3) Program example for Passive open
The following shows a communication flow of a Passive open.
Start
Waiting for TCP connection in
Passive open state.
NO
Send or receive?
YES
Send by the SP.SOCSND
instruction, or receive by
the SP.SOCRCV or
S.SOCRCVS instruction.
(a) Parameter setting
The following parameters are set for the sample program.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Open Setting]
Item
46
Setting
Protocol
TCP
Open System
Socket Communication
TCP Connection
Unpassive
Host Station Port No.
1000H (Setting range: 0001H to 1387H, 1392H to FFFEH)*2
Destination IP Address
Blank *1 (Setting range: 0.0.0.1 to 223.255.255.254)
Destination Port No.
Blank *1 (Setting range: 0001H to FFFEH)
*1
When "Fullpassive" is selected for "TCP Connection", a value must be set.
*2
Since used by the system, 1388H to 1391H cannot be set. (
Page 134, Appendix 2)
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(b) Devices used in the program
The following table lists the device numbers and applications used in the sample program.
Device number
Application
M3000
Send direction
D3000 and D3001
SP.SOCSND instruction control data
M300 and M301
SP.SOCSND instruction completion device
D300 to D303
Send data length and send data (6 bytes of 12H, 34H, 56H, 78H, 9AH, and BCH)
M3002
Normal send indication
M3003
Send error indication
D400 to D403
SP.SOCRMODE instruction control data
SD1282
Open completion signal
SD1286
Receive state signal
D5000 and D5001
SP.SOCRCV instruction control data
M500 and M501
SP.SOCRCV instruction completion device
D500 and higher
Receive data length and receive data
M5002
Normal receive indication
M5003
Receive error indication
D6000 and D6001
SP.SOCCINF instruction control data
D6010 to D6014
SP.SOCCINF instruction completion device
6
6.1 Communication Using TCP
47
(c) Sample program
<<Fixed length mode setting>>
*1
Setting TCP receive mode to 1
Setting receive data size to 6
<<Target checking>>
<<Data sending>>
Changing TCP receive mode of
Connection 1
*2
Obtaining information of connected
device
Setting send data length
Setting send data
Sending data to Connection No.1
Normal completion
Error completion
<<Data receiving>>
Receiving data
Normal completion
Error completion
*1
*2
48
There are two kinds of TCP receive modes: TCP standard receive mode and TCP fixed-length receive mode.For fixing
the data size, run the program enclosed by a dotted line.
(It can be omitted when the data size is not fixed.)
For the TCP receive mode, refer to the section for the SP.SOCRMODE instruction. (
Page 82, Section 6.4.8)
For acquiring information of the device connected on TCP, run the program enclosed by a dotted line.
(It can be omitted when the information acquisition is not needed.)
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(d) Precaution for Passive open communication
• Configure an interlock circuit using the Open completion signal (SD1282) and Open request signal
(SD1284) in the program.
The following chart shows on/off timings of the Open completion signal and Open request signal.
TCP disconnection completed
by the external device
Open completion signal ON
(SD1282)
OFF
Open request signal
(SD1284)
ON
OFF
Always on
TCP connection completed
by the external device
• When a device establishes a connection by Passive open, the IP address and port number of the
connected device can be acquired using the SP.SOCCINF instruction.
For the SP.SOCCINF instruction, refer to:
6
Page 77, Section 6.4.6
• On TCP, one connection is established with one target device.
To communicate with multiple devices from one port number, prepare the same number of connections as
that of the target devices.
A connection that exceeds the preset number of connections will be disconnected immediately.
• Do not accept a connection from a device until the CPU module is placed in the wait-for-open state.
If a TCP connection request is received before entering the wait-for-open state after completion of CPU
startup, the request will be recognized as an error, and a forced close message for the connection will be
returned to the interfacing device.
In this case, wait until the CPU state is changed to the wait-for-open state and then retry the connection
6.1 Communication Using TCP
from the device.
• Do not execute the SP.SOCCLOSE instruction in a program.
Doing so will disable data transfer since the Open completion signal and Open request signal of the
corresponding connection turn off for close processing.
To reopen a closed connection, execute the SP.SOCOPEN instruction.
For the SP.SOCOPEN instruction, refer to:
Page 59, Section 6.4.1
49
6.2
Communication Using UDP
UDP (User Datagram Protocol) is a simple protocol that does not perform data sequencing and retransmission.
To perform socket communication using UDP, confirm the following in advance.
• IP address and port number of the target device
• IP address and port number of the CPU module
(1) Program example
This section provides a program example for communication using UDP.
(a) Parameter setting
The following parameters are set for the sample program.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Open Setting]
Item
Protocol
UDP
Open System
Socket Communication
TCP Connection
Blank
Host Station Port No.
1000H (Setting range: 0001H to 1387H and 1392H to FFFEH)*1
Destination IP Address
192.168.3.40 (Setting range: 0.0.0.1 to 223.255.255.254/255.255.255.255)
Destination Port No.
1000H (Setting range: 0001H to FFFEH/FFFFH)
*1
50
Setting
Since used by the system, 1388H to 1391H cannot be set. (
Page 134, Appendix 2)
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(b) Devices used in the program
The following table lists the device numbers and applications used in the sample program.
Device number
Application
M3000
Send direction
D3000 and D3001
SP.SOCSND instruction control data
M300 and M301
SP.SOCSND instruction completion device
D300 and D303
Send data length and send data (6 bytes of 12H, 34H, 56H, 78H, 9AH, and BCH)
M3002
Normal send indication
M3003
Send error indication
D5000 to D5001
SP.SOCRCV instruction control data
M500 to M501
SP.SOCRCV instruction completion device
SD1282
Open completion signal
SD1286
Receive state signal
SD1288
Connection state signal
M3001
Target change direction
D500 and higher
Receive data length and receive data
M5002
Normal receive indication
M5003
Receive error indication
D400 to D404
SP.SOCCSET instruction control data
D450 to D451
SP.SOCCINF instruction control data
D460 to D464
SP.SOCCINF instruction connection information
6
6.2 Communication Using UDP
51
(c) Sample program
*1
<<Target changing>>
Setting target IP address
Setting target port No.
Changing setting of
Connection No.1
<<Data sending>>
Setting send data length
Setting send data
Sending data to Connection No.1
Normal completion
Error completion
<<Data receiving>>
*2
Obtaining information of
target device
Receiving data
Normal completion
Error completion
*1
For changing the target device, run the program enclosed by a dotted line.
(It can be omitted when the communication target is not changed.)
For details, refer to the section of the SP.SOCCSET instruction. (
*2
52
Page 80, Section 6.4.7)
For acquiring information of the target device connected on UDP, run the program enclosed by a dotted line.
(It can be omitted when the information acquisition is not meeded.)
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(2) Simultaneous broadcast
For simultaneous broadcast using UDP, set the parameters as follows.
• Destination IP Address: FF.FF.FF.FFH
• Destination Port No.: FFFFH
CPU module
(IP address: xx.xx.xx.xx, Subnet mask: 255.255.255.0)
Ethernet
Port No.A
Sending data from port No.A of the CPU
module to each port No.N of all external
devices.
Port No.L
External device 1
(IP address: xx.xx.xx.yy)
Port No.N
Port No.M
External device 2
(IP address: xx.xx.xx.zz)
6
Port No.N
External device 3
(IP address: xx.xx.xx.ww)
Port No.N
Destination IP Address
Destination Port No.
Receiving
Other than FFFFH
address and port No. among the entire data sent to
the host station port No.
station port No. to the
specified IP address and port
No..
Receives the data sent from all ports of the specified
Other than FF.FF.FF.FFH
FFFFH
IP address among the entire data sent to the host
N/A
station port No.
FF.FF.FF.FFH
FF.FF.FF.FFH
Other than FFFFH
FFFFH
Receives the data sent from the specified port No. of
Sends data to the port No.
all the IP addresses among the entire data sent to the
specified in the settings for
host station port No.
simultaneous broadcast.
Receives all data that have sent to the host station
port No.
N/A
53
6.2 Communication Using UDP
Receives only the data sent from the specified IP
Other than FF.FF.FF.FFH
Sending
Sends data from the host
(3) Precautions
(a) Use of UDP
Data may be lost, or may arrive out of order.
Consider the application of TCP if any problem is expected.
(b) Sending and receiving data
Data sending process may be terminated even if the communication line between the CPU module and target
device is not connected due to a reason such as cable disconnection.
To avoid this, it is recommended to provide communication procedures at the user’s discretion.
(c) Changing the target
Use the SP.SOCCSET instruction to change the target device.
For the SP.SOCCSET instruction, refer to:
Page 80, Section 6.4.7
(d) Open completion signal and Open request signal
Once UDP is selected for a connection, the Open completion signal and Open request signal of the connection
are always on.
(e) SP.SOCCLOSE instruction
Do not execute the SP.SOCCLOSE instruction in the program.
Doing so will disable data transfer since the Open completion signal and Open request signal of the
corresponding connection turn off for close processing.
To reopen the closed connection, execute the SP.SOCOPEN instruction.
For the SP.SOCOPEN instruction, refer to:
Page 59, Section 6.4.1
(f) Simultaneous broadcast targets
With simultaneous broadcast, data can be sent to the devices which are connected to the same hub of the
CPU module, and to those connected to the cascaded hub(s).
Data cannot be received from the devices connected through routers.
(g) Receiving data using simultaneous broadcast
When data are received through a connection of simultaneous broadcast, the IP address and port number of
the sender can be acquired by the SP.SOCCINF instruction.
For the SP.SOCCINF instruction, refer to:
Page 77, Section 6.4.6
(h) Connection of simultaneous broadcast
Data cannot be sent when FFFFH is specified for the port number of the transmission target.
To send data, specify a value other than FFFFH.
54
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(i) Destination IP address of the message transferred by simultaneous broadcast
Use a CPU module IP address of which all the bits corresponding to the host address are on.
When the subnet musk pattern is specified, apply the pattern before using the above mentioned IP address.
Ex.
Ex.
IP address of the CPU module side
:
64.
168.
3.
39
Subnet mask pattern
:
None
IP address of simultaneous broadcast
:
64.
255.
255.
255
IP address of the CPU module side
:
64.
168.
3.
39
Subnet mask pattern
:
255.
255.
255.
0
IP address of simultaneous broadcast
:
64.
168.
3.
255
6
6.2 Communication Using UDP
55
6.3
Precautions for the Socket Communication Function
This section provides other precautions for the socket communication function.
(1) Port number
Host station port number, 0001H to 03FFH, are assigned for reserved port numbers (WELL KNOWN PORT
NUMBERS) and F000H to FFFEH are for other communication functions. Therefore, using 0400H to 1387H and
1392H to EFFFH is recommended.
Since used by the system, 1388H to 1391H cannot be set. (
Page 134, Appendix 2)
Do not specify 0014H and 0015H for the socket communication function when using the FTP function.
Do not specify 007BH for the socket communication function when using the time setting function (SNTP).
(2) Reading out received data
Read out received data when the Receive state signal (SD1286) has turned on.
Communication via the built-in Ethernet port may be affected if a considerable amount of received data have not
been read out for a long time.
(3) Conditions for closing
In TCP communications, even if no close request is sent from the connected device, the Open completion signal
will turn off to close the connection in the following cases.
• Alive check is timed out.
• Forced close is received from the connected device.
(4) Elements for TCP connection
The following four elements control TCP connections, and only one connection can be established with a unique
setting for these elements. To use multiple TCP connections at the same time, at least one of the four elements
must be different.
• IP address of the CPU module
• Port number of the CPU module
• IP address of the target device
• Port number of the target device
(5) Reestablishment of the same connection
Allow eight seconds or more before reestablishing a connection of the same target IP address, the same host
station port number, and the same target port number after closing it.
If the reestablishment is time-critical, it is recommended to change the host station port number on the Active
open side.
(6) Precautions for file access during communication
The CPU module will perform file access processing prior to Ethernet communication processing. Because of
this, processing of the socket communication function may be delayed if a file is accessed by FTP or a
programming tool during the processing.
When accessing a file while response time monitoring is performed on the connected device with the socket
communication function, add the time required for file access to the monitoring time.
56
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(7) Checking receive data length
Since no delimiter is provided for TCP communication data, on the receiving end, separate data blocks that are
sent continuously may be combined, or data sent all at once may be segmented.
The receive data length must be confirmed on the receiving side as necessary.
When data are received on the CPU side and the data length is determined, the fixed-length mode is
recommended.
When receiving data on the target device side, confirm the receive data length as shown below.
Receive processing on the other device side
Received message, receive processing
NO
Is TCP connection open?
YES
Receive the rest of the message.
Received data within
the time specified by the monitoring
timer value?
6
TCP connection is closed.
NO
YES
Check the received data size.
NO
Sufficient receive data size?
YES
6.3 Precautions for the Socket Communication Function
Processing for the received message
Was the entire received
message processed?
NO
YES
End
Error handling
57
6.4
Socket Communication Function Instructions
The socket communication function instructions are provided for the CPU module to use the socket communication
function.
This section explains the socket communication function instructions.
The following is a list of the instructions.
Instruction
SP.SOCOPEN
Description
Establishes a connection.
Reference
Page 59, Section 6.4.1
SP.SOCCLOSE
Closes a connection.
Page 64, Section 6.4.2
SP.SOCRCV
Reads out received data (in END processing).
Page 67, Section 6.4.3
S.SOCRCVS
Reads out received data (upon instruction execution).
Page 70, Section 6.4.4
SP.SOCSND
Sends data.
Page 73, Section 6.4.5
SP.SOCCINF
Reads out connection information.
Page 77, Section 6.4.6
SP.SOCCSET
SP.SOCRMODE
S(P).SOCRDATA
Changes the target of the connection for UDP/IP
communication.
Changes receive mode of the connection.
Reads out data from the socket communication receive data
area.
● For configuration of data communication using the socket communication function, refer to:
Page 50, Section 6.2
Page 80, Section 6.4.7
Page 82, Section 6.4.8
Page 85, Section 6.4.9
Page 41, Section 6.1,
● If the instruction has a completion device, do not change any data, such as control data and request data, that are
specified for the instruction until the execution of the instruction is completed.
● Do not execute any socket communication function instruction in an interrupt program.
● For error codes, refer to the following.
MELSEC-Q/L Programming Manual (Common Instructions)
58
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
6.4.1
Establishing a connection (SP.SOCOPEN)
Command
SP.SOCOPEN
Internal device
Setting
data
Bit
S1
-
S2
-
Word
U0
S1
J†\†
R, ZR
Bit
U†\G†
Word
D
S2
Zn
Constant
K, H
Others
*1
*1
D
*1
SP.SOCOPEN
-
-
*1
-
-
-
*1
-
-
-
6
File registers set for each local device or program cannot be used.
(1) Setting data
Setting data
Description
U0
Dummy
S1
Connection number (Setting range: 1 to 16)
S2
Start number of the device from which control data are stored
Set by*2
Data type
-
Character string
User
BIN 16-bit
User, system
Device name
System
Bit
Start number of the device which turns on for one scan upon
completion of the instruction
D
*2
6.4 Socket Communication Function Instructions
6.4.1 Establishing a connection (SP.SOCOPEN)
D
+1 also turns on when failed.
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCOPEN instruction.
System: The CPU module stores the execution result of the SP.SOCOPEN instruction.
59
(2) Control data
Device
Item
Description
Setting range
Set by*3
Specify which settings are used to open a
connection, parameter settings configured by a
programming tool or control data settings
to
S2 +0
Execution/
completion type
S2
S2 +2
+9.
0000H
0000H:
Connection is opened according to the settings
8000H
User
set in "Open settings" of PLC parameter.
8000H:
Connection is opened according to the values
specified for control data
S2 +1
Completion
status
S2 +2
to
S2 +9.
Completion status is stored
-
0000H: Completed
System
Other than 0000H: Failed (Error code)
b15 b14 b13
S2 +2
to
b10 b9 b8 b7
0
[2] [1]
[3]
to
b0
0
[1] Communication method (protocol)
0: TCP/IP
S2 +2
Application
setting area
1: UDP/IP
[2] Socket communication procedure
-
1: Nonprocedural (fixed)
[3] Open system
00: Active open or UDP/IP
10: Unpassive open
11: Fullpassive open
S2 +3
Host station port
number
Specify the port number of the host station.
User
1H to 1387H
1392H to FFFEH
1H to FFFFFFFFH
S2 +4
S2 +5
Target device IP
*4
address
Specify the IP address of the target device.
(FFFFFFFFH:
Simultaneous
broadcast)
1H to FFFFH
S2 +6
Target device
port number*4
Specify the port number of the target device.
(FFFFH:
Simultaneous
broadcast)
S2 +7
to
-
Use prohibited
-
System
S2 +9
*3
*4
*5
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCOPEN instruction.
System: The CPU module stores the execution result of the SP.SOCOPEN instruction.
For the Unpassive open, the IP address and port number of the target device are ignored.
Host station port numbers, 0001H to 03FFH, are assigned for reserved port numbers (WELL KNOWN PORT NUMBERS)
and F000H to FFFEH are for other communication functions. Therefore, using 0400H to 1387H and 1392H to EFFFH is
recommended. (
60
Page 134, Appendix 2)
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(3) Function
This instruction opens a connection specified in
S1 .
The set values used for the open processing is selected in
S2 +0.
The result of the SP.SOCOPEN instruction can be checked with the completion device,
• Completion device
D
D
+0 and
D
+1.
+0
Turns on in the END processing of the scan after completion of the SP.SOCOPEN instruction, and turns
off in the next END processing.
• Completion device
D
+1
Turns on or off according to the result of the SP.SOCOPEN instruction.
State
Description
When completed
When failed
Remains off.
Turns on in the END processing of the scan after the SP.SOCOPEN instruction is completed and turns off
in the next END processing.
END processing
END processing
6
END processing
Program
SP.SOCOPEN instruction executed
SP.SOCOPEN instruction
ON
Completion device D +0
OFF
ON When failed
Completion device D +1
OFF
1 scan when
normally completed
• A connection with no parameters (no protocol is specified) can be opened. In this case, specify 8000H for
S2 +0
and configure open settings in
S2 +2
to
S2 +9.
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
• The connection number specified for
S1
is other than 1 to 16.
(Error code: 4101)
• The device numbers specified for
S2
and
D
exceed the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
61
6.4 Socket Communication Function Instructions
6.4.1 Establishing a connection (SP.SOCOPEN)
Connection
open
(5) Program examples
(a) Opening a connection using parameter settings
When M1000 is turned on, connection No.1 is opened using the parameters set in "Open settings" of PLC
parameter.
• Devices used
Device number
Application
SD1282
Open completion signal
SD1284
Open request signal
SD1288
Connection state signal
D100
SP.SOCOPEN instruction control data
M100
SP.SOCOPEN instruction completion device
• Program
Setting Execution/
completion type to 0H
Connection No.1 open
Normal completion
Error completion
62
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(b) Opening a connection using control data settings
When M1000 is turned on, connection No.1 is opened using control data.
• Devices used
Device number
Application
SD1282
Open completion signal
SD1284
Open request signal
SD1288
Connection state signal
D100
SP.SOCOPEN instruction control data
M100
SP.SOCOPEN instruction completion device
• Program
Setting Execution/
completion type to 8000H
Setting Application area
to 200H
(TCP/IP, Active open)
Setting port No. of host
station to 4096
6
Setting target IP address
to 10.97.79.14
Setting port No. of target
device to 4096
Connection No.1 open
Normal completion
Error completion
6.4 Socket Communication Function Instructions
6.4.1 Establishing a connection (SP.SOCOPEN)
63
6.4.2
Disconnecting a connection (SP.SOCCLOSE)
Command
SP.SOCCLOSE
Internal device
Setting
data
Bit
S1
-
S2
-
Word
U0
J†\†
R, ZR
Bit
S1
S2
U†\G†
Word
D
Zn
Constant
K, H
Others
*1
*1
D
*1
SP.SOCCLOSE
-
-
*1
-
-
-
*1
-
-
-
File registers set for each local device or program cannot be used.
(1) Setting data
Setting data
Description
U0
Dummy
S1
Connection number (Setting range: 1 to 16)
S2
Start number of the device from which control data are stored
Start number of the device which turns on for one scan upon
D
completion of the instruction
D
*2
Set by*2
Data type
-
Character string
User
BIN 16-bit
Device name
System
Bit
+1 also turns on when failed.
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCCLOSE instruction.
System: The CPU module stores the execution result of the SP.SOCCLOSE instruction.
(2) Control data
Device
Item
Description
Setting range
Set by*3
S2 +0
System area
-
-
-
-
System
S2 +1
*3
64
Completion
status
Completion status is stored
0000H: Completed
Other than 0000H: Failed (Error code)
The "Set by" column indicates the following.
System: The CPU module stores the execution result of the SP.SOCCLOSE instruction.
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(3) Function
This instruction closes a connection specified in
S1 .
(Disconnection of a connection)
The result of the SP.SOCCLOSE instruction can be checked with the completion device,
• Completion device
D
D
+0 and
D
+1.
+0
Turns on in the END processing of a scan after completion of the SP.SOCCLOSE instruction, and turns off in
the next END processing.
• Completion device
D
+1
Turns on or off according to the result of the SP.SOCCLOSE instruction.
State
When
Description
Remains off.
completed
When failed
Turns on in the END processing of a scan after completion of the SP.SOCCLOSE instruction, and turns off
in the next END processing.
END processing
END processing
6
END processing
Program
SP.SOCCLOSE instruction executed
SP.SOCCLOSE instruction
ON
Completion device D +0
OFF
ON When failed
Completion device D +1
OFF
1 scan when
normally completed
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
• The connection number specified for
S1
is other than 1 to 16.
(Error code: 4101)
• The device numbers specified for
S2
and
D
exceed the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
Remark
Do not use Passive open for execution of the SP.SOCCLOSE instruction. Doing so will turn off the Open completion signal
and Open request signal of the connection and cause close processing, which disables data transfer.
65
6.4 Socket Communication Function Instructions
6.4.2 Disconnecting a connection (SP.SOCCLOSE)
Connection
close
(5) Program example
When M2000 is turned on or when the connected device disconnects connection No.1, connection No.1 is
disconnected by the following program.
• Devices used
Device number
Application
SD1282
Open completion signal
SD1284
Open request signal
D200
SP.SOCCLOSE instruction control data
M200
SP.SOCCLOSE instruction completion device
• Program
Processing for disconnection of
Connection No.1by the target
Connection No.1 close
Setting SP.SOCCLOSE
executing flag
Normal completion
Error completion
Resetting SP.SOCCLOSE
executing flag
66
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
6.4.3
Reading out received data in the END processing (SP.SOCRCV)
Command
SP.SOCRCV
Internal device
Setting
data
Bit
Word
R, ZR
J†\†
Bit
S1
Zn
D1
S2
Constant
K, H
D2
Others
-
S2
-
*1
D1
-
*1
*1
D2
U0
U†\G†
Word
-
S1
*1
SP.SOCRCV
-
-
*1
-
-
-
*1
-
-
-
*1
-
-
-
6
File registers set for each local device or program cannot be used.
(1) Setting data
Setting data
Description
U0
Dummy
S1
Connection number (Setting range: 1 to 16)
Set by*2
Data type
-
Character string
User
BIN 16-bit
Start number of the device from which control data are
D1
specified
Device name
Start number of the device from which receive data are stored
Start number of the device which turns on for one scan upon
D2
completion of the instruction
D2 +1
*2
System
Bit
also turns on when failed.
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCRCV instruction.
System: The CPU module stores the execution result of the SP.SOCRCV instruction.
(2) Control data
Device
Item
Description
Setting range
Set by*3
S2 +0
System area
-
-
-
S2 +1
D1 +0
Completion
status
Receive data
length
D1 +1
to
D1 +n
*3
Completion status is stored.
0000H: Completed
-
Other than 0000H: Failed (Error code)
The length of the data which were read out from
the Socket communication receive data area is
0 to 2046
stored (in bytes).
System
The data which were read out from the Socket
Receive data
communication receive data area are stored in
-
order.
The "Set by" column indicates the following.
System: The CPU module stores the execution result of the SP.SOCRCV instruction.
67
6.4 Socket Communication Function Instructions
6.4.3 Reading out received data in the END processing (SP.SOCRCV)
S2
(3) Function
This instruction reads out received data of the connection specified in
S1
from the Socket communication receive
data area in the END processing after execution of the SP.SOCRCV instruction.
CPU module
D1 +0
Receive data
length
D1 +1
Receive data
Socket communication
receive data area
D1 +2
Receive data
Connection
No. specified by S1
SP.SOCRCV
(Reading receive data)
External device
Receiving
Receive data
D1 +n
The result of the SP.SOCRCV instruction can be checked with the completion device
• Completion device
D2 +0
and
D2 +1.
D2 +0
Turns on in the END processing of the scan after completion of the SP.SOCRCV instruction, and turns off in
the next END processing.
• Completion device
D2 +1
Turns on or off according to the result of the SP.SOCRCV instruction.
State
Description
When completed
When failed
Remains off
Turns on in the END processing of the scan after completion of the SP.SOCRCV instruction, and turns
off in the next END processing.
The following figure shows the timing of reception processing with the SP.SOCRCV instruction.
Data
Open
transmission
processing processing
Data read
processing
ON
Open completion OFF
signal (SD1282, n)
END
processing
END
processing
END
processing
Sequence program
ON
Reception status OFF
signal (SD1286, n)
SP.SOCRCV instruction execution
SP.SOCRCV
instruction
Completion
D2
device
Completion
D2 +1
device
1 scan
ON
OFF
Abnormal termination
ON
OFF
Data reception
68
Data
read
ACK
(TCP only)
processing
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
• The connection number specified for
S1
is other than 1 to 16.
(Error code: 4101)
• The received data size exceeds the size of the receive data storage device.
(Error code: 4101)
• The device numbers specified for
S2 , D1 ,
and
D2
exceed the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
(5) Program example
6
When M5000 is turned on, data received from the connected device are read out.
• Devices used
Device number
SD1282
Application
Open completion signal
SD1286
Receive state signal
D5000
SP.SOCRCV instruction control data
D500
Receive data length and receive data storage location
M500
SP.SOCRCV instruction completion device
• Program
Normal completion
Error completion
● To avoid receiving large amounts of data, the volume of received data can be limited by setting the receive data size
using the SP.SOCRMODE instruction.
● Consecutively sent data can be consecutively read out by connecting the completion device of the SP.SOCRCV
instruction to the execution command at the normally closed contact.
69
6.4 Socket Communication Function Instructions
6.4.3 Reading out received data in the END processing (SP.SOCRCV)
Reading receive
data of Connection
No.1
6.4.4
Reading out received data during instruction execution
(S.SOCRCVS)
Command
S.SOCRCVS
S.SOCRCVS
Internal device
J†\†
Setting
data
Bit
S
-
-
D
-
-
Word
R, ZR
Bit
U0
S
U†\G†
Word
D
Zn
Constant
K, H
Others
-
-
-
(1) Setting data
Setting data
U0
S
Description
*1
Data type
-
Character string
User
BIN 16-bit
System
Device name
Dummy
Connection number (Setting range: 1 to 16)
Start number of the device from which received data are
D
Set by*1
stored
The "Set by" column indicates the following.
User: The data must be set before executing the S.SOCRCVS instruction.
System: The CPU module stores the execution result of the S.SOCRCVS instruction.
(2) Control data
Device
D
D
+0
*2
70
Receive data
length
+1
to
D
Item
+n
Description
Setting range
The length of the data which were read out from
the Socket communication receive data area is
0 to 2046
stored (in bytes).
System
The data which were read out from the Socket
Receive data
Set by*2
communication receive data area are stored in
ascending order of addresses.
The "Set by" column indicates the following.
System: The CPU module stores the execution result of the S.SOCRCVS instruction.
-
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(3) Function
This instruction reads out received data of the connection specified in
S
from the Socket communication receive
data area.
CPU module
D +0
Receive data
length
D +1
Receive data
D +2
Receive data
Socket communication
receive data area
Connection
No. specified by S
External device
Receiving
S.SOCRCV
(Reading receive data)
D +n
Receive data
The following figure shows the timing of reception processing with the S.SOCRCVS instruction.
Open
processing
Open completion
signal (SD1282, n)
6
Data
reception Data read
processing processing
ON
OFF
END
processing
END
processing
Sequence program
Reception status
signal (SD1286, n)
ON
OFF
S.SOCRCVS
instruction
Data
read
processing
Data reception
ACK (TCP only)
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
• The connection number specified for
S
is other than 1 to 16.
(Error code: 4101)
• The received data size exceeds the size of the receive data storage device.
(Error code: 4101)
• The device number specified for
D
exceeds the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
(5) Precaution
Do not use both this and SP.SOCRCV instructions when reading out receive data of the same connection.
71
6.4 Socket Communication Function Instructions
6.4.4 Reading out received data during instruction execution (S.SOCRCVS)
S.SOCRCVS instruction
execution
(6) Program example
When M5000 is turned on, data received from the connected device are read out.
• Devices used
Device number
Application
SD1282
Open completion signal
SD1286
Receive state signal
D5000
Receive data length and receive data storage location
• Program
Reading receive
data of Connection
No.1
● To avoid receiving large amounts of data, the volume of received data can be limited by setting the receive data size
using the SP.SOCRMODE instruction.
● Data reception can be speeded up by placing a receive processing program at the beginning of multiple programs.
72
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
6.4.5
Sending data (SP.SOCSND)
Command
SP.SOCSND
Internal device
Setting
data
Bit
S1
-
S2
-
S3
-
Word
U0
S1
J†\†
R, ZR
Bit
S3
S2
U†\G†
Word
Zn
D
Constant
K, H
Others
*1
*1
D
*1
SP.SOCSND
-
*1
*1
-
-
-
-
-
-
-
-
-
-
6
File registers set for each local device or program cannot be used.
(1) Setting data
Setting data
Description
Set by*2
Data type
-
Character string
User
BIN 16-bit
Dummy
S1
Connection number (Setting range: 1 to 16)
S2
Start number of the device where control data are specified
System
S3
Start number of the device from which send data are stored
User
Device name
Start number of the device which turns on for one scan upon
D
completion of the instruction
D
*2
System
Bit
+1 also turns on when failed.
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCSND instruction.
System: The CPU module stores the execution result of the SP.SOCSND instruction.
73
6.4 Socket Communication Function Instructions
6.4.5 Sending data (SP.SOCSND)
U0
(2) Control data
Device
Item
Description
Setting range
Set by*3
S2 +0
System area
-
-
-
-
System
S3 +0
Completion status is stored.
Completion
S2 +1
0000H: Completed
status
Other than 0000H: Failed (Error code)
Send data length
The length of send data is specified (in bytes).
1 to 2046
S3 +1
to
User
Send data
Send data are specified.
-
S3 +n
*3
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCSND instruction.
System: The CPU module stores the execution result of the SP.SOCSND instruction.
(3) Function
This instruction sends data set in
S1
to the target device of the connection specified by
S3 .
CPU module
S3 +0
Send data
length
S3 +1
Send data
S3 +2
Send data
External device
SP.SOCSND
(Sending data)
S3 +n
Send data
The result of the SP.SOCSND instruction can be checked with the completion device,
• Completion device
D
D
+0 and
D
+1.
+0
Turns on in the END processing of the scan after completion of the SP.SOCSND instruction, and turns off in
the next END processing.
• Completion device
D
+1
Turns on or off according to the result of the SP.SOCSND instruction.
State
When completed
When failed
74
Description
Remains off.
Turns on in the END processing of the scan after completion of the SP.SOCSND instruction, and turns off
in the next END processing.
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
The following figure shows the timing of reception processing with the SP.SOCRCV instruction.
<Transmission control method>
Open completion
signal (SD1282, n)
Data
Open
transmission
processing
processing
ON
OFF
END
processing
END
processing
END
processing
Sequence program
SP.SOCSND instruction execution
SP.SOCSND
instruction
Completion D
device
Completion D +1
device
1 scan
ON
OFF
Abnormal termination
ON
OFF
Data
transmission
processing
Data
transmission
*1 Data transmission may continue
even though the completion
device turns on.
6
ACK (TCP only)
*1
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
S1
is other than 1 to 16.
(Error code: 4101)
• The device numbers specified for
S2 , S3 ,
and
D
exceed the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
(5) Program example
When M3000 is turned on, data (1234, 5678, and 8901) are sent to the target device using the socket
communication function.
• Devices used
Device number
Application
SD1282
Open completion signal
D3000
SP.SOCSND instruction control data
D300
Send data length and send data storage location
M300
SP.SOCSND instruction completion device
• Program
75
6.4 Socket Communication Function Instructions
6.4.5 Sending data (SP.SOCSND)
• The connection number specified for
Setting send data length
Setting send data
Sending data to
Connection No.1
Normal completion
Error completion
76
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
6.4.6
Reading out connection information (SP.SOCCINF)
Command
SP.SOCCINF
SP.SOCCINF
Internal device
U0
J†\†
S2
S1
D
Setting
data
Bit
S1
-
-
S2
-
-
-
-
D
-
-
-
-
Word
R, ZR
Bit
U†\G†
Word
Zn
Constant
K, H
Others
-
6
(1) Setting data
Setting data
Description
U0
Dummy
S1
Connection number (Setting range: 1 to 16)
S2
Start number of the device from which control data are stored
Start number of the device from which connection information
D
Data type
-
Character string
User
BIN 16-bit
System
Device name
is stored
6.4 Socket Communication Function Instructions
6.4.6 Reading out connection information (SP.SOCCINF)
*1
Set by*1
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCCINF instruction.
System: The CPU module stores the execution result of the SP.SOCCINF instruction.
77
(2) Control data
Device
Item
Description
Setting range
Set by*2
S2 +0
System area
-
-
-
S2 +1
Completion
status
Completion status is stored.
-
0000H: Completed
Other than 0000H: Failed (Error code)
1H to FFFFFFFFH
D
+0
Target device IP
D
+1
address
0H: No target
(FFFFFFFFH:
IP address of the target device is stored.
Simultaneous
broadcast)
1H to FFFFH
D
+2
Target device
port number
(FFFFH:
Port number of the target device is stored.
Simultaneous
broadcast)
D
+3
Host station port
number
1H to 1387H
Port number of the host station is stored.
1392H to FFFEH
System
*3
b15 b14 b13
D +4
to
b10 b9 b8 b7
0
[2] [1]
[3]
to
b0
0
[1] Communication method (protocol)
0: TCP/IP
D
+4
Application
setting area
1: UDP/IP
[2] Socket communication procedure
-
1: Nonprocedural (fixed)
[3] Open system
00: Active open or UDP/IP
10: Unpassive open
11: Fullpassive open
*2
The "Set by" column indicates the following.
System: The CPU module stores the execution result of the SP.SOCCINF instruction.
Host station port numbers, 0001H to 03FFH, are assigned for reserved port numbers (WELL KNOWN PORT NUMBERS)
and F000H to FFFEH are for other communication functions. Therefore, using 0400H to 1387H and 1392H to EFFFH is
*3
recommended. (
Page 134, Appendix 2)
(3) Function
This instruction reads out connection information specified in
S1 .
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
• The connection number specified for
S1
is other than 1 to 16.
(Error code: 4101)
• The device numbers specified for
S2
and
D
exceed the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
78
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(5) Program example
When M5000 is turned on, connection information of connection No.1 is read out.
• Devices used
Device number
Application
D500
SP.SOCSND instruction control data
D5000
Storage location of connection information
• Program
Reading connection
information of
Connection No.1
6
6.4 Socket Communication Function Instructions
6.4.6 Reading out connection information (SP.SOCCINF)
79
6.4.7
Changing the target of a connection (UDP/IP) (SP.SOCCSET)
Command
SP.SOCCSET
SP.SOCCSET
Internal device
J†\†
Setting
data
Bit
S1
-
-
S2
-
-
Word
R, ZR
Bit
U†\G†
Word
S2
S1
U0
Constant
K, H
Zn
Others
-
-
-
(1) Setting data
Setting data
*1
Set by*1
Data type
-
Character string
User
BIN 16-bit
User, System
Device name
Description
U0
Dummy
S1
Connection number (Setting range: 1 to 16)
S2
Start number of the device from which control data are stored
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCCSET instruction.
System: The CPU module stores the execution result of the SP.SOCCSET instruction.
(2) Control data
Device
Item
Description
Setting range
Set by*2
S2 +0
System area
-
-
-
-
System
S2 +1
Completion
status
Completion status is stored.
0000H: Completed
Other than 0000H: Failed (Error code)
1H to FFFFFFFFH
S2 +2
Target device IP
S2 +3
address
IP address of the target device is specified.
(FFFFFFFFH:
Simultaneous
broadcast)
1H to FFFFH
S2 +4
Target device
port number
Port number of the target device is specified.
(FFFFH:
Simultaneous
broadcast)
*2
80
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCCSET instruction.
System: The CPU module stores execution result of the SP.SOCCSET instruction.
User
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(3) Function
This instruction changes the IP address and port number of the target device of which connection is specified in
S1 .
(Note that this instruction is available only for UDP/IP communications.)
● The target device can be changed without closing the connection by using the SP.SOCCSET instruction.
● The set values take effect at the following SP.SOCCSET instruction execution timing:
• When data exist in the socket communication receive data area: After execution of the SP.SOCRCV or
S.SOCRCVS instruction, only once after execution of the SP.SOCCSET instruction
• When no data exists in the socket communication receive data area: After execution of the SP.SOCCSET
instruction
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
6
when:
• The connection number specified for
S1
is other than 1 to 16.
(Error code: 4101)
• The device number specified for
S2
exceeds the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
6.4 Socket Communication Function Instructions
6.4.7 Changing the target of a connection (UDP/IP) (SP.SOCCSET)
(5) Precaution
Do not change the target device using the SP.SOCCSET instruction during execution of the SP.SOCSND
instruction.
(6) Program example
When M4000 is turned on, the connection destination (IP address and port number of the target device) of
connection No.1, which is open, is changed.
• Devices used
Device number
Application
SD1282
Open completion signal
D400
SP.SOCCSET instruction control data
• Program
Setting target IP address to
10.97.85.222
Setting port No. of target
device to 8193
Changing setting of
Connection No.1
81
6.4.8
Changing the receive mode of a connection (SP.SOCRMODE)
Command
SP.SOCRMODE
SP.SOCRMODE
Internal device
J†\†
Setting
data
Bit
S1
-
-
S2
-
-
R, ZR
Word
Bit
U0
U†\G†
Word
S2
S1
Constant
K, H
Zn
Others
-
-
-
(1) Setting data
Setting data
*1
Description
U0
Dummy
S1
Connection number (Setting range: 1 to 16)
S2
Start number of the device from which control data are stored
Set by*1
Data type
-
Character string
User
BIN 16-bit
User, System
Device name
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCRMODE instruction.
System: The CPU module stores the execution result of the SP.SOCRMODE instruction.
(2) Control data
Device
Item
Description
Setting range
Set by*3
S2 +0
System area
-
-
-
-
System
S2 +1
S2 +2
S2 +3
*2
*3
Completion
status
TCP receive
mode*2
Receive data size
Completion status is stored.
0000H: Completed
Other than 0000H: Failed (Error code)
TCP receive mode is stored.
0: TCP standard receive mode
0 or 1
1: TCP fixed-length receive mode
Receive data size in the socket communication
is stored (in bytes).
User
1 to 2046
Invalid for connections in UDP communications.
The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCRMODE instruction.
System: The CPU module stores the execution result of the SP.SOCRMODE instruction.
(3) Function
This instruction changes the TCP receive mode and receive data size of the connection specified in
mode is changed as specified in
82
S2
+2. (This instruction is invalid for UDP connections.)
S1 .
The
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
(a) TCP standard receive mode
When data are received, they are stored in the Socket communication receive data area, and SD1286 turns on.
If data are received exceeding the specified receive data size, the excess data are read out the next time.
Ex. The receive data size is set to 300 bytes, and 500-byte data are received.
Ex
SP.SOCRCV or
S.SOCRCVS
instruction
SP.SOCRCV or
S.SOCRCVS
instruction
Reading receive data
Socket communication
receive data area
Data stored
(300 bytes)
Data reading
Data stored
(200 bytes)
Data reading
ON
OFF
SD1286
Data reception
(500 bytes)
6
(b) TCP fixed-length receive mode
When data are received, they are stored in the Socket communication receive data area, and SD1286
(Receive state signal) turns on. However, if the size of the data does not reach the specified receive data size,
SD1286 does not turn on.
Data reception is repeated and once the data size reaches to the specified size, SD1286 turns on.
If data are received exceeding the specified receive data size, the excess data are read out the next time.
Ex. The receive data size is set to 300 bytes, and 200-byte data are consecutively received.
Data cannot be read out because
the receive data size is not reached.
Socket communication
receive data area
SD1286
Data stored
(200 bytes)
Data stored
(300 bytes)
Data reading
The remaining 100
bytes will be stored
at the next data
reception (200 bytes).
ON
OFF
Data reception
(200 bytes)
Data reception
(200 bytes)
● Effective use of devices
Devices can be effectively used by setting the receive data size to less than 1024 words while the default size of the
receive data storing devices for the SP.SOCRCV and S.SOCRCVS instructions is 1024 words.
● Prevention of receive data fragmentation
Data from the connected device may be fragmented depending on the line type. To prevent this, the receive data size can
be specified in the TCP fixed-length receive mode.
● Prevention of receive data binding
Separately sent data may be combined depending on the interfacing device due to a delay in receive processing of the
program.
To prevent this, the receive data size can be specified in the TCP fixed-length receive mode.
83
6.4 Socket Communication Function Instructions
6.4.8 Changing the receive mode of a connection (SP.SOCRMODE)
SP.SOCRCV or
S.SOCRCVS
instruction
Reading receive data
Remark
The set values will take effect at the following timing of the SP.SOCRMODE instruction execution.
• Before opening: Values take effect after opening a connection.
• When there are data in the Socket communication receive data area:
Values take effect after execution of the SP.SOCRCV or S.SOCRCVS instruction once after the S.SOCRMODE
instruction.
• When there is no data in the Socket communication receive data area:
Values take effect after the SP.SOCRMODE instruction is executed.
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
• The connection number specified for
S1
is other than 1 to 16.
(Error code: 4101)
• The device number specified for
S2
exceeds the device point range.
(Error code: 4101)
• Invalid device is specified.
(Error code: 4004)
Remark
Even when the Receive state signal is not on in the TCP fixed-length receive mode, the data received at the point can be
read out with the SP.SOCRDATA instruction. This allows you to check whether the data sent from the connected device is
adequate in size.
(5) Program example
When M4000 is turned on, connection No.1 is set to theTCP fixed-length receive mode and the receive data size
is set to 256 bytes.
After execution of the instruction and when the receive data size of connection No.1 reaches 256 bytes, the
Receive state signal is turned on.
• Device used
Device number
D400
Application
SP.SOCRMODE instruction control data
• Program
Setting TCP receive mode to 1
Setting receive data size to 256
Changing receive mode of
Connection No.1
84
CHAPTER 6 SOCKET COMMUNICATION FUNCTION
6.4.9
Socket communication receive data read (S(P).SOCRDATA)
Command
S.SOCRDATA
S.SOCRDATA
U0
S1
S2
D
n
SP.SOCRDATA
U0
S1
S2
D
n
Command
SP.SOCRDATA
Internal device
J†\†
Setting
data
Bit
S1
-
-
S2
-
-
-
-
D
-
-
-
-
n
-
-
R, ZR
Word
Bit
U†\G†
Word
Zn
Constant
K, H
Others
-
6
-
(1) Setting data
Setting data
U0
Dummy
S1
Connection number (Setting range: 1 to 16)
S2
Start number of the device from which control data are stored
D
Start number of the device where read data are stored
n
Number of read data (1 to 1024 words)
Set by*1
Data type
-
Character string
BIN 16-bit
User
Device name
BIN 16-bit
The "Set by" column indicates the following.
User: The data must be set before executing the S(P).SOCRDATA instruction.
(2) Control data
Device
Item
Description
Setting range
Set by*2
S2 +0
System area
-
-
-
-
System
S2 +1
*2
Completion
status
Completion status is stored.
0000H: Completed
Other than 0000H: Failed (Error code)
The "Set by" column indicates the following.
System: The CPU module stores the execution result of the S(P).SOCRDATA instruction.
(3) Function
This instruction reads out the data of the amount specified for n from the Socket communication receive data area
of which connection is specified in
S1 ,
and stores them in the device specified in
D
or higher. No processing is
performed when the number of read data (n) is 0.
85
6.4 Socket Communication Function Instructions
6.4.9 Socket communication receive data read (S(P).SOCRDATA)
*1
Description
● Data of the receive data length can be read out by setting the number of read data to one word.
This allows change of the device storing receive data, upon execution of the SP.SOCRCV or S.SOCRCVS instruction.
● In the following order, based on the data currently received, the size of the data received the next time can be specified.
1. Check the data currently received using the S(P).SOCRDATA instruction.
2. Specify the size of the data to be received the next time using the SP.SOCRMODE instruction.
3. Read out the data currently received using the SP.SOCRCV or S.SOCRCVS instruction.
Remark
● Even if the S(P).SOCRDATA instruction is executed, the next receive data will not be stored in the Socket communication
receive data area because the area is not cleared and the Receive state signal does not change.
● To update the receive data, read out the data using the SP.SOCRCV or S.SOCRCVS instruction.
(4) Error
A detection of an operation error turns on the Error flag (SM0) and a corresponding error code is stored in SD0
when:
• The connection number specified for
S1
is other than 1 to 16.
(Error code: 4101)
• The device numbers specified for
S2 ÅC D
, and n1 exceed the device point range.
(Error code: 4101)
• An invalid device is specified.
(Error code: 4004)
(5) Program example
When M4000 is turned on, the receive data length of connection No.1 is read out.
• Devices used
Device number
SD1282
Application
Open completion signal
SD1286
Receive state signal
D400
S.SOCRDATA instruction control data
D4000
Storage location where data are read out
K1
Number of read data (one word)
• Program
Reading receive data
length of Connection
No.1
86
CHAPTER 7 TIME SETTING FUNCTION ( SNTP CLIENT)
CHAPTER 7
TIME SETTING FUNCTION ( SNTP
CLIENT)
The CPU module collects time information from a time information server on LAN, and automatically sets its own time.
With this time setting function, the CPU module queries the server for time information at the specified timing, and can
set the time information sent from the server as its own clock data.
The time setting can performed at the following timing.
• When the programmable controller is powered off and then on, or is reset
• At the specified time intervals (Execution interval)
• At the specified clock time (Execution time)
• According to the special relay state*1
*1
Time is set when SM1270 is turned on for one scan.
Time query
7
LAN
Setting server time in the CPU
Ethernet
Personal computer
● Confirm the connection of the hub or the interfacing device in advance when setting time at the timing of CPU module
power-on or reset.
● The time setting results can be checked with the special register (SD1270 to SD1275).
● During execution of the time setting function, other time setting operations are ignored.
Remark
Access through routers is also available. When configuring the settings for it, set the subnet mask pattern and default router
IP address. (
Page 25, Section 3.4)
87
7.1
Setting Method
Configure the time settings in the Built-in Ethernet port tab of the PLC parameter dialog box.
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Time Setting]
Item
Description
SNTP Function Setting
Select whether to use this function or not.
SNTP Server IP Address
Specify the IP address of the SNTP server.
Time Zone
(GMT-12:00 to
GMT+13:00)
reset
of the CPU module.
Execution Time *2
*2
88
223.255.255.254
Standard Time "GMT+9:00".is set by default.
Select whether to execute the time setting function upon power-on or reset
Execution Interval *2
0.0.0.1 to
Specify a time zone in which the time is to be synchronized. Japan
Execute time setting at turn ON/
At Error Occurrence
Setting range
Used or Not used
Select whether to stop or continue the time setting when an error is
detected upon power-on or reset of the CPU module.
Select this when executing the time setting function at fixed time intervals.
Select this when executing the time setting function at a specified time. (in
increments of 30 minutes)
Either of these two options must be selected.
Continue or Stop
1 to 1440 (min.)
00:00 to 23:30
CHAPTER 7 TIME SETTING FUNCTION ( SNTP CLIENT)
7.2
Precautions
(1) Communication timeout
A communication timeout occurs when 20 seconds have elapsed without receiving any response after sending a
time query.
At the time of a communication timeout, the value in SD1270 is FFFFH.
(2) Delay resulted from the time required for communication
A delay occurs and affects the set time as a result of the time spent for communication with the SNTP server
computer. For a high-accuracy time setting, specify an SNTP server computer that is networked as close to the
CPU module as possible.
7
7.2 Precautions
89
CHAPTER 8
FILE TRANSFER FUNCTION (FTP)
The CPU module supports the server function for FTP (File Transfer Protocol) which is a protocol designed for file
transfer to or from the connected device.
The device with the FTP client function can directly access any files located in the CPU module.
Target device (FTP client)
CPU module (FTP server)
Parameters
Programs
Data
Storage files
Read
Write
Ethernet
The following operations can be performed between the connected device with the FTP client function and the CPU
module.
(a) Reading files from the CPU module (download)
The files in the CPU module can be stored in the connected device.
(b) Writing files to the CPU module (upload)
The files stored in the connected device can be registered to the CPU module.
(c) Browsing the names of the files in the CPU module
The files registered to the CPU module can be checked from the connected device.
Remark
Access through routers is also available. When configuring the settings for it, set the subnet mask and default router IP
address. (
90
Page 25, Section 3.4 )
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
8.1
Setting for FTP Communication
(1) Operation on the CPU module side
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
3.
1.
2.
8
1.
2.
Set the IP address of the CPU module.
Select "Enable online change (FTP, MC Protocol)" when data need to be written even while the
3.
8.1 Setting for FTP Communication
CPU module is in RUN state.
Configure the FTP settings.
Item
Description
FTP
Select "Used".
Login Name
Set a login name for file transfer request (log in) from the connected device. (Default: MELSEC)
Password
Set an FTP password for file transfer request from the connected device. To change the password, enter both old and
new passwords for confirmation. (Default: MELSEC)
Command Input
Monitoring Timer
Set a time for monitoring command input performed by the CPU module. When no command is input within the set
period of time, the FTP connection is disconnected. (Setting range : 1 to 32767 ( × 500ms))
Set a time value larger than the time required for file transfer.
91
(2) Operation on the connected device (FTP client) side
The following describes the procedure and processing on the connected device side, which is required for using
the FTP server function of the CPU module.
Various FTP commands and how to enter each of them are also shown.
(<ret> indicates an input of the CR, Enter, or Return key.)
Start
Start the FTP client.
(ftp <ret>)
Login to the CPU module
Is remote
password enabled
for FTP?
(open "CPU module's IP address" <ret>)
NO
YES
Unlock the remote
password.
Is file transfer
completed?
(quote password-unlock
"remote password" <ret>)
YES
NO
Write files
to the FTP server?
NO
YES
NO
File reading
File writing
No file conversion is notified. (binary <ret>)
Check the file list.
Lock the remote password.
No file conversion is notified.
(dir <ret>
or ls <ret>)
Is remote
password enabled
for FTP?
YES
(binary <ret>)
(dir <ret> or
ls <ret>)
Check the file list.
Disconnect from
the CPU module.
End
NO
NO
Does the read
target file exist?
YES
YES
NO
Does the write
target file exist?
Is File
password 32 set for the
target file?
YES
Can it be overwritten?
NO
YES
Enter a file password.
(quote passwd-rd
"read password" <ret>)
Read the file.
(get "file name" <ret>)
Is File
NO
password 32 set for the
target file?
YES
Enter a file password.
Delete or rename the file.
Write the file.
92
(quote passwd-wr
"write password" <ret>)
(delete "file name" <ret> or
rename "current file name"
"new file name" <ret>)
(put "file name" <ret>)
(quote password-lock
<ret>)
(bye <ret>)
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
(a) Logging in to the CPU module
The following explains the operation flow from starting an FTP session until log-in to the CPU module.
Ex. Start up the FTP from the MS-DOS prompt of Microsoft® Windows®.
1.
2.
3.
4.
1.
2.
3.
4.
Start an FTP session. (FTP <ret>)
Open a connection to the FTP server (open "IP address of the CPU module" <ret>)
Specify the login name (Login name <ret>)
Specify the password (Password <ret>)
8
(b) Locking and unlocking a remote password
If the FTP communication port is specified as a remote password check target in the remote password settings,
unlock the remote password using the following command.
(quote password-unlock "Remote password" <ret>)
(quote password-lock <ret>)
If the FTP communication port is specified as a remote password check target, any other commands cannot be used until
the remote password is unlocked.
(c) Entering file password 32
When file password 32 (write or read password) is set for the target file, the password must be entered with the
following command before accessing the file.
• Write password (quote passwd-wr "write password" <ret>)
• Read password (quote passwd-rd "read password" <ret>)
93
8.1 Setting for FTP Communication
When terminating the operation, lock the unlocked remote password using the following command.
8.2
Files Transferable Using FTP
The following table lists the files that can be transferred using the file transfer function.
:Available, × :N/A
Program
Standard
Standard
SD memory
RAM
ROM *4
card *4
Drive 3
Drive 4
Drive 2
Parameter
×
×
×
PARAM.QPA
Intelligent function module
parameter
×
×
×
IPARAM.QPA
Program
×
×
×
.QPG
Device comment
×
×
×
.QCD
Device initial value
×
×
×
.QDI
×
×
.QDR
File type
memory
*2 *3
Drive 0
File register
×
Local device
×
×
×
×
.QDL
Sampling trace file
×
×
×
×
.QTD
×
×
Label programming invertible
conversion information
×
×
×
×
Drive heading
×
×
×
×
QN.DAT
Device data storage file
×
×
×
×
DEVSTORE.QST
Module error log file
×
×
×
×
IERRLOG.QIE
×
LOGCOM.QLG,
LOG01.QLG to LOG10.QLG
Programmable controller user data
*1
Arbitrary file name
.C32
Data logging setting file
×
×
×
Data logging file
×
×
×
Menu definition file
×
×
×
×
MENUDEF.QDF
User-set system area
×
×
×
×
-
*1
*2
*3
*4
94
File name or extension
.CSV
The SP.FWRITE or SP.FREAD instruction in the program will write or read the file respectively.
For details, refer to the following manual.
MELSEC-Q/L Programming Manual (Common Instructions)
Files can be written to the program memory only when the CPU module is in the STOP state.
Write destination is the program cache memory.
The user should back up files using the "pm-write" command as required. (
The following number of files can be stored using FTP.
[Maximum number of files storable on the drive - 1]
Page 96, Section 8.4.1)
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
8.3
Files That Can Be Deleted Using FTP
The following table lists the files that can be deleted using the file transfer function.
: Deletable,
Program
File type
memory
*2*3
Drive 0
: Not deletable only in RUN state, ×: Not deletable, -: Not writable
Standard
RAM
Drive 3
Standard
ROM
SD memory
*4
Drive 4
card*4
File name or extension
Drive 2
Parameter
-
PARAM.QPA
Intelligent function module
parameter
-
IPARAM.QPA
Program
-
.QPG
Device comment
-
.QCD
Device initial value
-
.QDI
File register
-
-
-
.QDR
Local device
-
-
-
.QDL
Sampling trace file
-
-
-
.QTD
Programmable controller user
-
Arbitrary file name
Label programming invertible
conversion information
-
.C32
Drive heading
-
QN.DAT
data*1
-
-
-
Module error log file
-
×
Data logging setting file
-
-
Data logging file
-
-
Menu definition file
-
-
User-set system area
-
-
*1
*2
*3
*4
-
DEVSTORE.QST
-
IERRLOG.QIE
LOGCOM.QLG,
LOG01.QLG to LOG10.QLG
-
.CSV
MENUDEF.QDF
-
-
-
The SP.FWRITE or SP.FREAD instruction in the program will write or read the file respectively.
For details, refer to the following manual.
MELSEC-Q/L Programming Manual (Common Instructions)
Files can be written to the program memory only when the CPU module is in the STOP state.
Write destination is the program cache memory.
The user should back up files using the "pm-write" command as required. (
The following number of files, which can be written using FTP, can be stored.
[Maximum number of files storable on the drive - 1]
Page 96, Section 8.4.1)
When the online change settings is disabled in the "Built-in Ethernet Port Setting" tab of PLC Parameter, deleting a file in
RUN state will cause an error.
95
8.3 Files That Can Be Deleted Using FTP
Device data storage file
8
8.4
FTP Commands
8.4.1
List of FTP commands
: Available, × : N/A
CPU module state
Remote password
RUN
Command
Function
STOP
binary *5
Notifies the FTP server of file transfer without conversion.
bye
Disconnects the line to the FTP server and terminates the
session.
close
Disconnects the line to the FTP server.
delete
Deletes a file in the CPU module.*4
dir
get
ls
mdelete
mdir
mget
Write
disabled
*1
*1
×
Displays file information of the CPU module.
*4
Displays file names of the files stored in the CPU module.
*4
*4
×
×
×
Deletes file(s) stored in the CPU module.
*4
×
×
Stores file information of the CPU module into a file.
*4
×
Reads file(s) from the CPU module.
*4
Stores CPU module’s file names into a file.
mput
Writes file(s) to the CPU module.
open
Connects to the FTP server.
put
Writes a file to the CPU module.
pwd
Displays the current directory of the CPU module.
quit
Disconnects the line to the FTP server and terimnates the
connection.
quote
Sends an FTP server subcommand.*3
rename
Changes a CPU module file name.*4
user
Inputs the user name and password of the CPU module.
*3
*4
*5
*2
×
Reads a file from the CPU module.
*2
Locked
*2
×
*4
*1
Unlocked
×
mls
96
Write
enabled
×
×
×
×
×
×
×
×
Whether the online change settings is enabled or not is indicated in the "Built-in Ethernet Port" tab in the PLC Parameter
dialog box.
These indicate whether the remote password can be used or not when the FTP communication port is specified as a
remote password check target in the remote password setting. For remote passwords, refer to:
Page 109,
CHAPTER 9
On the next page, subcommands available with the "quote" command are shown.
Each of these commands can include a folder name in the file specification.
This command is set automatically in the CPU module. Therefore, a file transfer is coded in binary regardless of the
"Communication Data Code" of the "Built-in Ethernet Port Setting" in PLC Parameter.
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
The following table lists the subcommands available with the command, "quote".
: Available, × : N/A
CPU module state
Subcommand
Function
Remote password
RUN
STOP
Write
enabled
Write
disabled
Unlocked
Locked
change
Displays or changes the CPU module file attribute. *2
password-lock
Locks an unlocked remote password.
password-unlock
Unlocks an locked remote password.
status
Displays the operation information of the CPU module.
×
run
Changes the CPU module state to RUN.
×
stop
Changes the CPU module state to STOP.
×
pm-write
Writes data to the program memory.
passwd-rd
Sets, displays, or clears file password 32 (read password).
×
passwd-wr
Sets, displays, or clears file password 32 (write password).
×
*1
*2
×
×
× *1
×
×
×
Even if the subcommand is executed, the remote password remains locked with no error occurred.
This command can include a folder name in the file specification.
8
8.4 FTP Commands
8.4.1 List of FTP commands
97
8.4.2
How to specify an FTP command
This section explains how to specify a file with an FTP command on the FTP client (connected device), which is
supported by the CPU module
(1) File specification
A file can be specified for an FTP command on the FTP client side as follows:
• For CPU modules, each file is specified using a drive name and a file name.*2
• When specifying a file in the CPU module using the FTP function, specify the target file in the following order.
[Specification format]
Drive name:\Folder name*1\File name.Extension
*1
*2
[Example]
3:\MAINSEQ1.QDR (other than drive 2)
[Specification details]
2:\LOGGING\LOG01\00000001\LOG01_00000001.CSV (drive 2)
Refer to (a) and (b) below.
Only for a file in drive 2, the folder name can be specified.
Use "\" as a delimiter.
(a) Drive name (drive No.)
Specify the drive name of the file transfer target memory.
For the CPU module’s memories and drive names, refer to:
Page 94, Section 8.2
(b) Folder name, file name, and extension
• Specify a folder name and a file name according to the rules described in the following manual.
MELSEC-L CPU Module User’s Manual (Function Explanation, Program Fundamentals)
• Set an extension predetermined by the CPU module.
Page 94, Section 8.2
• For details of the file names and extensions, refer to the following manual.
Operating manual of the programming tool used
• For an FTP command which can be used for multiple files, specify the file name and extension using a wild
card character (* or ?).
*:
Indicates all files having any characters (including no character) from the position where "*" is
?:
used.
Indicates all files having any characters (including no character) at the position where "?" is used.
(Multiple "?" can be used.)
Some FTP clients have other restrictions on the characters that can be used for file names.
t
The part enclosed with brackets in the specification format can be omitted.
98
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
8.4.3
Details of FTP commands
Details of the FTP commands on the FTP client side, which are supported by the CPU module, and how to use each of
them are described below.
Note that some FTP commands may not function as described in this manual, depending on the FTP application used on the
FTP client side.
Check the functions and operation methods, referring to the manual(s) for the FTP client.
(1) FTP server support commands
●binary
[Function]
Notifies the FTP server of file transfer without conversion.
Neither return codes nor kanji codes are converted.
This command is set automatically in the CPU module.
[Specification format]
binary (abbreviated to "bin")
●bye
[Function]
Disconnects the line to the FTP server, and terminates the FTP session.
[Specification format]
bye
[Identical command]
quit
8
[Function]
Disconnects the line to the FTP server.
[Specification format]
close
8.4 FTP Commands
8.4.3 Details of FTP commands
●close
●delete
[Function]
Deletes a file stored in the CPU module.
[Specification format]
delete "file path name"
[Example]
When deleting a file stored in an SD memory card:
delete 2:\MAINSEQ1.USR
[Similar command]
mdelete
●dir
[Function]
Displays the names, creation dates, and sizes of the files stored in the CPU module.
[Specification format]
dir [drive name:\]
[Example]
When displaying the detailed information of the files stored in an SD memory card:
dir 2:\
[Similar command]
ls
99
●get
[Function]
Reads a file from the CPU module.
[Specification format]
get "source file path name" [destination file path name]
[Example 1]
When reading a file stored in the standard RAM and saving it under the same file name:
get 3:\MAINSEQ1.QDR
[Example 2]
When reading a file stored in the standard RAM and saving it under a different file name:
get 3:\SEQ1BAK.QDR \SEQ\SEQ10LD.QDR
[Note]
• When no destination file path name (FTP client side) is specified, the file is saved in the
FTP client using the same source file name (CPU module side).
• The transfer destination is on the current directory where FTP is started up and
connected to the server.
●ls
[Function]
Displays the names of the files stored in the CPU module.
[Specification format]
Is [drive name:\]
[Example]
When displaying the names of the files stored in an SD memory card:
ls 2:\
[Similar command]
dir
●mdelete
[Function]
Deletes a file stored in the CPU module.
To delete multiple files, specify the file name and extension within the file path name using
a wild card character (* or ?).
[Specification format]
mdelete "file path name" (abbreviated to "mdel" )
[Example]
When deleting all the files whose extensions are "QPG" from the program memory:
[Similar command]
delete
mdelete 0:\*.QPG
●mdir
[Function]
Saves detailed information (file names, creation dates, and sizes) of the files stored in the
CPU module as log data into a file on the FTP client side.
[Specification format]
[Example]
mdir "source drive name" :\"destination file path name"
When saving detailed information of the files stored in an SD memory card into the
S990901.LOG file:
mdir 2:\ S990901.LOG
[Note]
• Type "\" immediately after the source drive name.
• Specify a source drive name when specifying a destination file path name (FTP client
side).
• Without a destination file path name, the file is saved using a file name determined by
the FTP application on the FTP client side.
• The transfer destination is on the current directory where FTP is started up and
connected to the server.
[Similar command]
100
mls
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
●mget
[Function]
Reads out a file from the CPU module.
To read out multiple files, specify the file name and extension within the file path name
using a wild card (* and/or ?).
When reading multiple files, reception is checked for each file transfer.
[Specification format]
mget "file path name"
[Example]
When reading all the files whose extensions are "USR" among the files stored in an SD
memory card:
mget 2:\*.USR
[Note]
The file read out is saved on the FTP client side under the same file name.
The storage destination is on the current directory where FTP is started up and connected
to the server.
●mls
[Function]
Stores the names of the files in the CPU module as log data into a file on the FTP client
side.
[Specification format]
mls "source drive name":\"destination file path name"
[Example]
When storing the names of the files in an SD memory card into the S990901F.LOG file:
mls 2:\ S990901F.LOG
[Note]
• Type "\" immediately after the source drive name.
• Specify a source drive name when specifying a destination file path name (FTP client
side).
• Without a destination file path name, the file is stored using a file name determined by
the FTP application on the FTP client side.
• The transfer destination is on the current directory where FTP is started up and
8
connected to the server.
[Similar command]
mdir
[Function]
Writes a file to the CPU module.
To write multiple files, specify the file name and extension within the file path name using a
wild card (* or ?).
When writing multiple files, transmission is checked for each file transfer.
[Specification format]
[Example]
mput "source file path name"
When writing all the files whose extensions are "USR":
mput *.USR
[Note]
The storage destination file name is the same as that on the FTP client side.
The transfer destination is the memory in which current parameter files are stored.
●open
[Function]
Connects to the FTP server by specifying the host name or IP address and port number of
the FTP server.
[Specification format]
open "host name" [port number]
open "IP address" [port number]
• Host name: Host name set in the Microsoft® Windows® hosts file
• IP address: CPU module IP address
• Port number: Port number to be used
[Example 1]
When connecting to the FTP server by specifying a host name:
open HOST
[Example 2]
When connecting to the FTP server by specifying an IP address:
open 192.0.1.254
[Note]
Connection is also possible by specifying an IP address at startup of FTP.
101
8.4 FTP Commands
8.4.3 Details of FTP commands
●mput
●put
[Function]
Writes a file to the CPU module.
[Specification format]
put "source file path name" [destination file path name]
[Example 1]
When writing the MAINSEQ1.QDR file to the standard RAM with the same file name:
put MAINSEQ1.QDR 3:\MAINSEQ1.QDR
[Example 2]
When writing the MAINSEQ.QDR file to the standard RAM with a different file name:
put MAINSEQ.QDR 3:\MAINSEQ1.QDR
[Note]
• If no directory is specified for the source file path name (FTP client side), the file on the
current directory where FTP is started up and connected to the server is written.
• When no destination file path name (FTP server side) is specified, the file is saved in the
memory in which current parameter files are stored.
●pwd
[Function]
Displays the current directory name of the CPU module.
[Specification format]
pwd
[Note]
"\" is displayed as the execution result of the "pwd" command.
●quit
[Function]
Disconnects the line from the FTP server and terminates the FTP session.
[Specification format]
quit
[Identical command]
bye
●quote
[Function]
Sends an FTP server subcommand (a subcommand dedicated to CPU modules).
[Specification format]
quote
[Example]
quote password-lock
[Note]
Only CPU module dedicated subcommands can be specified. Refer to (2).
●rename
[Function]
Renames a CPU module file.
[Specification format]
rename "old file path name" "new file path name" (abbreviated to "ren")
[Example]
When renaming a file stored in the standard RAM:
rename 3:\MAINSEQ1.QDR 3:\SEQ1OLD.QDR
[Note]
Either of the following response codes is displayed upon completion.
350 Need more info.
250 Rename successful.
●user
[Function]
Inputs the user name and password of the connected FTP server.
[Specification format]
user "user name" [FTP password]
• User name: Login name set with a CPU module parameter
• FTP password: FTP password set with a CPU module parameter
[Example 1]
When specifying a user name:
user CPU
[Example 2]
When specifying a user name and password:
user CPU CPU
102
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
(2) CPU-module-dedicated subcommands
The CPU-module-dedicated subcommands affixed to an FTP command, "quote," are described below.
●change
[Function]
Displays or changes the attribute of a file stored in the CPU module.
[Specification format 1]
When displaying the file attribute:
quote change "file path name"
Either of the following is displayed as an execution result upon completion.
• When the specified file is read-only:
----- R
• When the specified file is writable and readable: ----- W
[Specification format 2]
When changing the file attribute:
quote change "file path name" "attribute"
Use either of the following to specify the attribute.
• To change it to a read-only file: r
• To change it to a writable and readable file: w
[Example 1]
When displaying the attribute of the file stored in the standard RAM:
quote change 3:\MAINSEQ1.QDR
[Example 2]
When changing the attribute of the file stored in the standard RAM:
quote change 3:\MAINSEQ1.QDR r
●password-unlock
[Function]
Specify the remote password set in the CPU module to unlock the password.*2
[Specification format]
quote password-unlock [remote password]
8
• Remote password: Specify the remote password set with a parameter for the CPU
module.
The following is displayed as an execution result upon completion.
The following is displayed if the entered remote password does not match the setting.
556 Password Error
The following is displayed if another command is requested before unlock processing of
the remote password.
555 Password Locked
[Example]
When specifying a remote password (1234):
quote password-unlock 1234
[Note]
• The remote password is locked when you log in if the remote password check is enabled
for the FTP communication port.
• By executing this command before various FTP operations, the password is unlocked,
allowing file operations of the CPU module.
• Unlock processing will be completed if the remote password is unlocked when the
remote password check is disabled for the FTP communication port.
*2
Use this command only when the FTP communication port is specified as a remote password check target.
103
8.4 FTP Commands
8.4.3 Details of FTP commands
200 Command Okey
●password-lock
[Function]
Locks the remote password set in the CPU module.*3
[Specification format]
quote password-lock
The following is displayed as an execution result upon completion.
200 Command Okey
[Example]
When locking the remote password:
quote password-lock
*3
Use this command only when FTP communication port is specified as a remote password check target.
●run
[Function]
Changes the CPU module state to RUN. (Remote RUN.)
At this time, device memory clear can be specified.
[Specification format]
quote run [mode [clear mode]]
• Mode: Specify whether to force remote RUN or not.
0: Normal RUN (default)
1: Forced RUN
• Clear mode:
Specify the CPU module device memory clear (initialization) processing performed when
the operation starts by executing remote RUN.
0 : Do not clear device (default)
1 : Clear other than the latch range
2 : Clear all including the latch range
The following message is displayed as an execution result upon completion.
200 Command successful
[Example 1]
When executing remote RUN, with "Normal RUN" and "Do not clear device" specified:
quote run
[Example 2]
When executing remote RUN, with "Forced RUN" and "Do not clear device" specified:
quote run 1
[Example 3]
When executing remote RUN, with "Forced RUN" and "Clear other than the latch range":
specified
quote run 1 1
[Note]
• Forced RUN should be used only to force remote RUN to the CPU module from another
device when a device that executed remote STOP to the CPU module have a problem
and cannot perform remote RUN.
With Normal RUN, the CPU module state cannot be changed from STOP/PAUSE to RUN
if the previous state is set by a different device.
• Specify the clear mode at the start of an operation, according to the system arrangement.
After completing the specified clear processing, the CPU module runs in accordance with
the PLC parameter settings ("Initial Device value" setting on the PLC file tab).
●status
[Function]
Displays information of the CPU module operation.
This command is used to check the information on the CPU module operation before
transferring a file to the CPU module.
[Specification format]
quote status
One of the following is displayed as an execution result upon completion.
• When the CPU module is in RUN state: "RUN"
• When the CPU module is in STOP state: "STOP"
• When the CPU module is in PAUSE state: "PAUSE"
104
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
●stop
[Function]
Changes the CPU module state to STOP (remote STOP).
[Specification format]
quote stop
The following message is displayed as an execution result upon completion.
200 Command successful
[Note]
Before writing data to the program memory, set the CPU module into the STOP state using
this command.
●pm-write
[Function]
Transfers program cache memory to the program memory.
[Specification format]
quote pm-write
The following message is displayed as an execution result upon completion.
200 Command successful
[Note]
Before writing data, set the CPU module to STOP.
●passwd-rd
[Function]
Sets, displays, and clears the read password (file password 32) that is registered to the file
transfer target.
With this command, the CPU module checks the read password when access is made to
the transfer target file.
[Specification format]
quote passwd-rd [read password]
Any of the following is displayed as an execution result upon completion.
8
• When setting a read password: 200 Command successful
• When displaying a read password: 200 Read-password is [read password]
• When clearing a read password: 200 Command successful
• When attempting to display a read password with no read password set: 200 Read[Example 1]
When setting a read password (ABCD1234@efgh):
quote passwd-rd ABCD1234@efgh
[Example 2]
When displaying a read password that is currently set to FTP:
[Example 3]
When clearing a read password that is currently set to FTP:
quote passwd-rd
quote passwd-rd c, or quote passwd-rd C
[Note]
• One read password can be set to FTP of the CPU module.
When the transfer target file is changed, if a read password is preset for the new target
file, set the read password of the target file again.
• When the CPU module is logged in, the read password is cleared.
105
8.4 FTP Commands
8.4.3 Details of FTP commands
password is not set.
●passwd-wr
[Function]
Sets, displays, and clears the write password (file password 32) that is registered to the file
transfer target.
With this command, the CPU module checks the write password when access is made to
the transfer target file.
[Specification format]
quote passwd-wr [write password]
Any of the following is displayed as an execution result upon completion.
• When setting a write password: 200 Command successful
• When displaying a write password: 200 Write-password is [write password]
• When clearing a write password: 200 Command successful
• When attempting to display a write password with no write password set:
200 Write-password is not set.
[Example 1]
When setting a write password (1234@ABCDefgh):
quote passwd-wr 1234@ABCDefgh
[Example 2]
When displaying a write password that is currently set to FTP:
quote passwd-wr
[Example 3]
When clearing a write password that is currently set to FTP:
quote passwd-wr c, or quote passwd-wr C
[Note]
• One write password can be set to FTP of the CPU module.
When the transfer target file is changed, if a write password is preset for the new target
file, set the write password of the target file again.
• When the CPU module is logged in, the write password is cleared.
106
CHAPTER 8 FILE TRANSFER FUNCTION (FTP)
8.5
Precautions
(1) FTP clients
• Some FTP clients may have FTP command specifications different from those described in this manual. In
such a case, check the functions and operation methods, referring to the manuals for the FTP client.
• An FTP operation from Microsoft® Internet Explorer is not allowed. If it is attempted, an error will occur in
Internet Explorer.
(2) CPU module side processing
• Files only in the drives of the host station CPU module can be accessed.
• During file access, do not power off the CPU module, reset the CPU module, or remove an SD memory card.
Doing so may corrupt the file. Stop accessing to an SD memory card, and then power off the CPU module,
reset the CPU module, or remove an SD memory card. All of SD memory card operations can be disabled
by SM606 (SD memory card forced disable instruction). For the forced disablement of SD card, refer to the
following.
MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection)
• During file access, do not operate the file from a peripheral such as a programming tool. (Also do not
perform online operations such as online change, scam time measurement, registration of the step number
set for a monitoring condition). If the file is operated during operation of the FTP function, an error may occur
in the peripheral. Perform the processing suspended due to an error again after performing the FTP function.
• If an access is attempted from an FTP client during backup or restoration for the CPU module change
8
function using an SD memory card, an error will occur.
Reexecute it after completion of the backup or restoration.
An error will also occur if backup or restoration is performed during access from an FTP client.
(3) Communication processing
• If a timeout error occurs during file transfer, the TCP connection will be closed (disconnected). To restart the
file transfer, log in to the CPU module once again from the FTP client.
• For each FTP connection, the existence of the target device is checked. For details, refer to:
Page 26,
Section 3.5
• The processing time for file transfer depends on the factors such as the Ethernet line congestion, the
number of connections simultaneously used (communication processing of other connections), and the
system configuration.
• Only one FTP client can log in to a CPU module at the same time. If another FTP client attempts to connect
to a CPU module that is already in the logged-in state, the connection cannot be established, resulting in an
error.
• An attempt to execute another communication (MELSOFT connection or MC protocol) using UDP during file
transfer using FTP may cause an error such as a timeout error.
Execute it after completion of the file transfer, or use TCP.
107
8.5 Precautions
In that case, reexecute it after disconnecting the FTP client.
(4) File writing
• An existing file cannot be overwritten and saved.
Either delete a file with the file delete command (delete or mdelete) or rename the file with the file rename
command (rename), and then write the file.
• Writing is not allowed to read-only files and files locked by a function other than FTP. If attempted, a write
error occurs.
• File transfer (writing a file) cannot be executed when the SD memory card is write-protected. If attempted, a
write error occurs.
• When a file is written, a temporary file (FTP_I***.TMP) is created automatically. This file is renamed to the
desination file name upon completion. However, if power failure or reset of the CPU module occurs during
the file writing, this temporary file may remain. If this occurs, delete the temporary file.
• Before writing or deleting data to the file register in the standard RAM, set the CPU module to STOP.
• When the file register in the standard RAM is set as an auto refresh device, do not perform any writing or
deletion to the corresponding drive.
• When writing a large file to an SD memory card, set the CPU module to STOP. If writing is performed in the
RUN state, a communication error may occur.
(5) File deletion
• The timing for deleting files must be determined by the user, considering the overall system including the
CPU module and programming tool.
• A file cannot be deleted if the SD memory card is write-protected. If attempted, an error occurs.
(6) Password for FTP
When you forgot the FTP password, set the FTP parameters again by the following steps.
1.
2.
Read out the parameters from the CPU module to the programming tool.
In the FTP Parameter Setting dialog box, click the "Default" button to return all the FTP parameters
to default values.
Project window
3.
4.
108
[PLC Parameter]
[Built-in Ethernet Port Setting]
Configure the FTP parameter settings again.
Write the parameters to the CPU module from the "Write to PLC" screen.
[Online]
5.
[Parameter]
[Write to PLC]
Power off and then on or reset the CPU module to enable the parameters.
[FTP Setting]
CHAPTER 9 REMOTE PASSWORD
CHAPTER 9
REMOTE PASSWORD
9
A remote password is checked when a connection is requested for the following.
• Communication using a programming tool
• Communication using MC protocol
• File transfer (FTP)
The remote password function is one of the preventive methods against unauthorized access (e.g. destruction of data and
programs) from external devices.
However, this function cannot completely prevent unauthorized access.
Other preventive measures should be taken at users’ discretion if security of the programmable controller system needs to
be maintained against unauthorized access from external devices. We cannot be held responsibility for any problems
caused by unauthorized access.
[Examples of measures against unauthorized access]
• Install a firewall.
• Set up a personal computer as a relay station, and control the relay of communication data using an application
program.
• Set up an external device that can control access rights as a relay station.
For devices that can control access rights, please consult your network service provider or networking equipment
vendors.
109
9.1
Communication Using Remote Password
Communication is performed in the order described below when a remote password is set for the CPU module.
(1) Allowing access (unlock processing)
On a communication device such as a personal computer, unlock the remote password set for the CPU module.
If it is not unlocked, an error will occur on the connected device because the CPU module will prohibit any access.
(2) Access processing
Access the CPU module after completion of the remote password unlock processing.
(3) Prohibiting access (lock processing)
When terminating access from the personal computer, lock the remote password to prohibit an access from any
other personal computers.
[Accessing the host CPU]
(a) Unlocking
(c) locking
Ethernet
(b) Access
Enable/
Disable
Remote password
check
Remote password
parameter
[Accessing a CPU on another station]
(a) Unlocking
(c) locking
Ethernet
(b) Access
Enable/
Disable
CC-Link
Remote password
check
110
Remote password
parameter
CHAPTER 9 REMOTE PASSWORD
9.2
Remote Password Setting
9
(1) Setting a remote password
Set a remote password and a target connection in the programming tool, and write the data to the CPU module.
Project window
[Parameter]
Item
Enter a remote password to be set for the CPU module.*1
Model Name
Select a CPU model to enable the remote password for the built-in
Ethernet port of the CPU module.
Only one CPU model is selectable.
LCPU
Condition
Click this to display the "Remote Password Detail Setting" dialog
box.
Connection 1 to 16
Select one of them when the remote password is to be enabled for
the built-in Ethernet port.
(Setting of an unused connection or MELSOFT connection is
ignored.)
MELSOFT Transmission Port (TCP/IP) *2
System
Connection
Setting range
MELSOFT Transmission Port (UDP/IP) *2 *3
FTP Transmission Port (TCP/IP)
Select one of them when the remote password is to be enabled for
the built-in Ethernet port.
-
Select the
checkboxes
appropriate to the
target connection.
Direct Connection of MELSOFT
Regard as Error when Remote Password Mismatch Count
Reaches Upper Limit
Select this when enabling this operation.
(Useful for detecting unauthorized access)
(
Page 114, Section 9.4)
Upper Limit of Mismatch
Specify the maximum number of mismatches.
Clear Mismatch Count when Remote Password Matches
Select the checkbox when this operation is to be performed.
*1
*2
*3
*4
1 to 65535
-
One-byte alphanumeric and special characters can be used for remote password entry.
(Case-sensitive)
To enable the remote password for the port for which the open system is set to "MELSOFT Connection" in PLC
Parameter, select the following checkbox.
When Protocol is set to "TCP" → "MELSOFT Transmission Port (TCP/IP)".
When Protocol is set to "UDP" → "MELSOFT Transmission Port (UDP/IP)".
When connecting the CPU module and a GOT via Ethernet, do not select "MELSOFT Transmission Port (UDP/IP)".
Select this checkbox to enable the remote password for the CPU module that is directly connected to the programming
tool using the built-in Ethernet port. (
Page 28, CHAPTER 4)
111
9.2 Remote Password Setting
User
Connection
No.
Description
Up to four
characters
Password Setting
Password
Active
Module
Setting
[Remote Password]
(2) Writing to the CPU module
Write the remote password to the CPU module from the "Write to PLC" screen.
[Online]
[Write to PLC]
After writing the parameters to the CPU module, power off and then on or reset the CPU module to enable the
parameters.
(3) Unlocking or locking the remote password
The remote password is unlocked or locked from an external device such as a personal computer, as described
below.
(a) When using MELSOFT connection
Enter a remote password in the following dialog box that appears during communication.
When the remote password is entered, the programming tool performs unlock processing and then accesses
the CPU module
(b) When using MC protocol
Use commands dedicated to MC protocol. (
Page 34, Section 5.2.1)
(c) When using the FTP function
Use the "password-lock" and "password-unlock" commands. (
Page 96, Section 8.4.1)
(d) When using the simple PLC communication function
Unlock the remote password in the "Destination Setting List" dialog box of Simple PLC Communication Setting.
Project window
[Parameter]
PLC Communication Setting]
112
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Destination Setting List]
[Simple
CHAPTER 9 REMOTE PASSWORD
9.3
Precautions
9
(1) When a remote password is set for UDP connections
• Determine a target device before data communication. (The communication target needs to be determined
because, after unlocking of the remote password, communication is available with any other devices.)
• At the end of data communication, always lock the remote password.
(If the lock processing is not performed, the unlock state is held until a timeout occurs. No communication for
10 minutes causes a timeout, and the CPU module automatically performs lock processing.)
To prevent unauthorized access using the remote password setting, it is recommended to set all connection
protocols to TCP/IP and disable direct connection with the parameter.
(2) When a TCP/IP connection is closed before lock processing
The CPU module automatically performs lock processing.
9.3 Precautions
113
9.4
Detection of Unauthorized Access and Actions
When the remote password mismatch count reaches the upper limit in unlock processing, "REMOTE PASS FAIL"
(error code: 2700) is detected.
If this occurs, unauthorized access from the outside of the system can be considered as a cause of the error.
Take the following actions as needed.
1.
Monitor the Remote password count (SD979 to SD999) and identify the connection of which
remote mismatch count has reached the upper limit in unlock processing.
2.
Stop the communication by disabling the connection as shown below.
• Select the connection in the "Ethernet diagnostics" dialog box, and force it to be deactivated.
(
GX Works2 Version1 Operating Manual (Common))
[Diagnostics]
[Ethernet Diagnostics]
"Status of Each Connection"
• Turn on the force deactivation flag of the connection in the special register (SD1276, SD1277).
3.
Clear the "REMOTE PASS FAIL" error (error code: 2700).
The remote password count (SD979 to SD999) is also cleared.
4.
Inform your system administrator that the number of unlock processing failures exceeded the
limit, and take appropriate actions.
If the error is detected due to frequent incorrect typing by authorized users, prevent this by the following operations.
• Enable "Clear Mismatch Count when Remote Password Matches" in the "Remote Password Detail Setting" dialog
box.
• Clear the accumulated count of remote password mismatches using the special relay (SM1273).
114
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
CHAPTER 10 SIMPLE PLC COMMUNICATION
FUNCTION
Note10.1
10
The simple PLC communication function allows data communications between specified devices at the specified
timing just by doing simple settings from a programming tool. Specify one device (transmission source) to one device
(transmission destination). The communications are performed between the specified devices.
The communications using this function are not possible when a stop error occurs in the CPU module where the
parameters are set.Note10.1
Set the parameters.
Data communication is also possible between the CPU modules
in which the parameters are not set.
(In that case, the data communication is done through the
CPU module in which the parameters are set.)
Hub
Ethernet
LCPU
Built-in Ethernet port QCPU
Q series CPU module
+ Ethernet module
A series CPU module
+ Ethernet module
The communications using this function are possible only for the CPU modules connected with Ethernet cable. The following
communications are not possible.
• Communication with a CPU module on other stations via CC-Link network.
• Communication with a CPU module except the connected Built-in Ethernet port QCPU when multiple CPU system
is configured.
• Communication with a CPU module that does not control the connected Ethernet module when multiple CPU
system is configured.
Remark
● The communications can be performed only with a Mitsubishi programmable controller. The communications with the
programmable controllers manufactured by other companies are not possible. (
Page 119, Section 10.1 (3) (b))
● Access via routers is also possible. For the access, set the subnet mask pattern and the default router IP address. (
Page 25, Section 3.4)
LCPU
Note10.1
Check the versions of the CPU module and GX Works2 when using the simple PLC communication function.
(
Page 134, Appendix 3)
115
10.1
Setting Method
To use this function, configure the settings in "Simple PLC Communication Setting". Up to 64 devices can be set in
"Simple PLC Communication Setting".
Project window
[Parameter]
[PLC Parameter]
[Built-in Ethernet Port Setting]
[Base Setting]
[Extended Setting]
Simple PLC Communication Setting consists of Base Setting (essential) and Extended Setting (optional). To switch the
dialog boxes, use the
116
/
button on the top right of the dialog box.
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(1) Communication Pattern
Select it from the following items.
Setting item
Read the data of the specified destination device (transmission source) to the specified device of the host
Read
station (transmission destination).
Write the data of the specified device of the host station (transmission source) to the specified destination
Write
device (transmission destination).
Read the data of the specified destination device (transmission source) and write it to another specified
Transfer
*1
10
Description
destination device (transmission destination).*1
The device data is not reflected in the CPU module where the parameters are set (the CPU module that relays the data).
(2) Communication Setting: Execution Interval (ms)/Request Contact
Select the communication timing from the following items.
Setting item
Fixed Interval
Execu-tion
Interval
On Request
Request
Contact*1
*1
Description
Setting range
Data are communicated between the devices at a specified execution
-
interval.
Execution interval is set.
10ms to 65535ms (1ms unit)
Data are communicated between the devices only when requested.
-
Data are communicated at the rising (OFF to ON) of the device that is
specified as Request Contact. The ON/OFF status of Request Contact
X, M, B
is confirmed in the END processing.
10.1 Setting Method
Request Contact cannot be specified overlapped with the following devices.
• Request Contact Device to Stop Fixed Interval Communication
• Execution Status Flag Device
• Source device when the host station is a transmission destination device
• Request Contact Device to Stop Fixed Interval Communication that is used for other setting No.
• Execution Status Flag Device that is used for other setting No.
• Source device when the host station is a transmission destination device, which is used for other setting No.
● Actual time of execution interval may be longer than the value of the setting because the time is affected by the specified
devices or Ethernet line congestion. For the preventive measures, refer to the troubleshooting described in the following
manual.
MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection)
● If latency time is set, data communication is started after the latency time has passed. (
(12))
Page 127, Section 10.1
117
(3) Register Destination
(a) Setting of devices for communications
Set the devices for both transmission source and transmission destination. Up to 64 devices can be registered.
This setting also can be done in "Destination Setting List" dialog box that will open by clicking
button in "Simple PLC Communication Setting" dialog box. Use Destination Setting List dialog box as well to
change the setting information.
Setting item
IP Address/Port No. Input
Format
Description
Select the input format of IP address and port No.
Setting range
DEC/HEX
Module Type
Select the device for communications.
IP Address
Set the IP address of the device.
0.0.0.1 to 223.255.255.254
Port No.
Set the port No. of the device.
0401H to 1387H, 1392H to FFFEH
Network No.
Set the network No. of the device (host station).
1 to 239
Set the station No. of the device.
1 to 64
Station No.
If a remote password is set for the destination
Remote Password
device, the communication is possible by entering
the password.
Page 119, Section 10.1 (3) (b)
4 characters or less (one-byte
alphanumeric and special characters)
Host Station Port No.
Set the port No. of the host station.
0401H to 1387H, 1392H to EFFFH
Host Station No.
Set the station No. of the host station.*1
1 to 64
*1
Set the station number not to overlap the numbers set for other devices on the same Ethernet network (such as Ethernet
module, programming tool, and GOT).
If the L/Q/QnA series modules are used for the simple PLC communication, F000H to FFFEH is automatically selected for
the port No. of the host station. Therefore, when using the simple PLC communication function, do not set F000H to FFFEH
to Host Station Port No. for the establishing a connection instruction (SP.SOCOPEN) of the socket communication function.
If F000H to FFFEH is set, the instruction may not be completed properly.
118
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(b) Model Type List
The following table shows the communication devices and specifications applicable to each model.
Model Type
Communication
Device for communications
MELSEC-Q/L (Built-in Ethernet
QCPU (Built-in Ethernet port)
Function)
LCPU
specification
10
Basic model QCPU + Ethernet module
High Performance model QCPU + Ethernet module
MELSEC-Q (Ethernet Module)
MELSOFT connection
Process CPU + Ethernet module
Universal model QCPU + Ethernet module
MELSEC-QnA (Ethernet Module)
QnACPU + Ethernet module
ACPU + Ethernet module
MELSEC-A (Ethernet Module)
MC protocol Acompatible 1E frame
High Performance model QCPU (A mode) + Ethernet
(binary code
module
communication)
(c) Setting for each device for communications
The settings vary depending on the device for communications.
: Setting is required.
: Setting is required if the password is set for destination device for communications. ×: Setting is not required.
Setting item
Device for communications
IP Address
Station No.
Port No.
×
×
×
MELSEC-Q (Ethernet Module)
*1*2
*1*2
×
MELSEC-QnA (Ethernet Module)
*1*2
*1*2
×
MELSEC-A (Ethernet Module)
×
×
MELSEC-Q/L (Built-in Ethernet
Function)
*1
*2
*1
Remote
Password
×
×
Setting of the host station is required.
For "MELSEC-Q (Ethernet Module)" and "MELSEC-QnA (Ethernet Module)", settings of these items in "Simple PLC
Communication Setting" are required because these modules perform communication processing by using the network
No. and the station No.
Router
Data flow
Hub
Hub
Ethernet
Network No. 1
Station No. 1
Network No. 1
Station No. 2
The settings must be configured in
simple PLC communication setting.
Network No. 1
Station No. 1
Network No. 1
Station No. 2
The settings must be configured in
simple PLC communication setting.
119
10.1 Setting Method
Network No.
(4) Settings for destination devices for communications
If following devices are used as the destination devices for communications, the settings of these devices are also
required.
Necessary setting
Destination
device for
Parameters
communications
Programming tool
DIP switch on the front of the
module
Set the following items (for the
MELSEC-Q/L
(Built-in Ethernet
Function)
numbers of the devices) in "Open
Setting".*1
• Protocol: "UDP"
---
---
---
---
• Open System: "MELSOFT
Connection"
Set the following items from the
Ethernet setting of Network
Parameter.
• "Send Frame Setting" of "Operation
MELSEC-Q
(Ethernet Module)
Setting": "Ethernet(V2.0)"
• "Station No.<->IP Information
System" of "Station No.<->IP
Information": "Automatic Response
System"
Set the following items from the
MELSEC-QnA
(Ethernet Module)
• Create an initial processing
Ethernet setting of Network
program and turn off the bits (6 and
Parameter.
7) in the special function setting
• "Send Frame Setting" of "Operation
Setting": "Ethernet (V2.0)"
• "Station No.<->IP Information
area (address: 4(4H)) of buffer
memory.
• Turn on the bit 15 in the exchange
System" of "Station No.<->IP
instruction area during STOP
Information": "Automatic Response
(address: 103(67H)) of buffer
System"
memory.*4
Set the following items.
• SW3 (Automatic start up mode
setting): ON*3
• SW7 (CPU exchange timing
setting): ON*2
• Createv an initial processing
program and do the settings as
shown below.
• Set the IP address and the port
No. by referring (3) in this
section.
MELSEC-A
(Ethernet
---
Module)*5
• Set "UDP" for the
communication method.
• Turn on the bit 15 in the exchange
Set the following items.
• SW2 (Data code setting): OFF
• SW7 (CPU exchange timing
setting): ON*2
instruction area during STOP
(address: 496(1F0H)) of buffer
memory, and the bits
corresponding to the connection
No. used for bits 0 to 7.*4
*1
*2
*3
*4
*5
120
The module has the setting by default to communicate with one device whose protocol is "UDP".
To execute the simple PLC communication function when the CPU module (destination device for communications) is in
RUN state, turn on this switch.
If Ethernet module is in Automatic startup mode, turn on this switch.
To execute the simple PLC communication function when the CPU module (destination device for communications) is in
STOP state or in stop error state, turn on the bits.
The module cannot communicate regardless of the setting if a stop error occurs in it.
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(5) Available devices
The devices that can be specified as transmission source and transmission destination vary depending on the
destination device for communications. Both a bit device and a word device can be set for the same setting No.
Set the total points of setting No.1 to No.64 (up to 4096 words*1) for the device points.
*1
The maximum number that can be set for each setting No. is 512 words. (Maximum points of a word device: 256 points
+ Maximum points of a bit device: 4096 points)
Destination device for
communications
Bit device
MELSEC-Q/L (Built-in Ethernet Function)
MELSEC-QnA (Ethernet Module)
MELSEC-A (Ethernet Module)
*3
*4
Available device*2
Type
MELSEC-Q (Ethernet Module),
*2
10
Word device
X, Y, M, L, B, SB, SM
D, D (extended data register)*3, W, W (extended link
register)*3, R, ZR, SW, SD
Bit device
X, Y, M, L, B, SB, SM
Word device
D, W, R, ZR, SW, SD
Bit device
X, Y, M*4, B
Word device
D, W, R
The size of a bit device and a word device can be specified in units of 16 points and one point respectively. Use 0 or
multiples of 16 to specify the device number of a bit device.
The devices are compatible with the following modules:
• Universal model QCPU whose serial number (first five digits) is "09042" or later (except the Q00UJCPU)
• LCPU
Use "M9000 + multiples of 16" when specifying the device of M9000 or later.
● For I/O processing when X and Y are specified as transmission destination, refer to the following:
MELSEC-L CPU Module User’s Manual (Function Explanation, Program Fundamentals)
121
10.1 Setting Method
● Do not write any data to the special relay and the special register that are set on the system side. Doing so may cause a
system failure or communication failure.
(a) Timing of write or read of the device data
The data of a bit device and a word device set for each setting No. are communicated in the END processing.*1
Even so, depending on the destination device for communications, data communications for one setting may
not be done completely, resulting in data inconsistency.
Device data
Destination device for
communications
Bit device
MELSEC-Q/L
(Built-in Ethernet Function)
Data inconsistency for one setting
Word device
Data of a bit device and a word device are
Data inconsistency of a bit device and a word device is the
guaranteed to be communicated by setting
same level because the data of both devices are
unit.
communicated at the same timing.
MELSEC-Q
Data of a bit device
Data of a word device
(Ethernet Module)
are guaranteed to be
are guaranteed to be
setting No., the level of data inconsistency of both devices
MELSEC-QnA
communicated by
communicated by
may be different because the data of each device is
(Ethernet Module)
setting unit.
setting unit.
communicated at different timing.*2
Within the setting
range, data of a bit
device are
MELSEC-A
(Ethernet Module)*5
guaranteed to be
communicated in
units of 32 bits (2
words).
*1
*2
Within the setting
range, data of a word
device are
guaranteed to be
communicated in
units of 2 words.
If both a bit device and a word device are set for the same
• If both a bit device and a word device are set for the same
setting No., the level of data inconsistency of both devices
may be different because the data of each device is
communicated at different timing.*2
• If the data of 32 bits (2 words) or larger is communicated,
data inconsistency might differ in units of 32 bits (2
words).*3
If the COM instruction is used, the data are written or read not only in the END processing but also during sequence
scan (at the execution of the COM instruction).
The order of the write and read is shown below.
• When "Write" is set for Communication Pattern: A word device comes first, then a bit device.
• When "Read" is set for Communication Pattern: A bit device comes first, then a word device.
• When "Transfer" is set for Communication Pattern: The host station reads the data of transmission source in
order of a bit device and a word device, and writes them to transmission destination in order of a word device and
a bit device.
*3
122
Because the write and read is performed from the data with smaller device number, use the device with the largest No.
to secure the data.
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(6) Request Contact Device to Stop Fixed Interval Communication
Select the device from X, M, B and specify it as Request Contact Device to Stop Fixed Interval Communication*1
If "Fixed Interval" is set for Communication Setting, the communications for the specified setting No. temporarily
stop when Request Contact Device to Stop Fixed Interval Communication turns on. The communications re-start
10
when Request Contact Device to Stop Fixed Interval Communication turns off. The ON/OFF status is confirmed in
the END processing. This stop request is enabled when the communication status is "Communicating" or "Error".
*1
Request Contact Device to Stop Fixed Interval Communication cannot be specified overlapped with the following
devices.
• Request Contact
• Execution Status Flag Device
• Source device when the host station is a transmission destination device
• Request Contact that is used for other setting No.
• Execution Status Flag Device that is used for other setting No.
• Source device when the host station is a transmission destination device, which is used for other setting No.
● When communications are stopped by the request to stop fixed interval communication, the data communications at a
specified execution interval, which is performed when "Fixed Interval" is set for Communication Setting, is ignored.
● The stop time by the request to stop fixed interval communication is not counted as Execution Interval (Current Value).
● If the communications are stopped by the request to stop fixed interval communication during retry of communication, the
retry count is reset to 0.
(7) Execution Status Flag Device
Select the device from X, M, B and specify it as a device to store the execution status.*1 The ON/OFF status
10.1 Setting Method
below indicate the execution status.
• ON: Communicating (the state of "Status" being "3H")
• OFF: Communication Stop
*1
Execution Status Flag Device cannot be specified overlapped with the following devices.
• Request Contact
• Request Contact Device to Stop Fixed Interval Communication
• Source device when the host station is a transmission destination device
• Request Contact that is used for other setting No.
• Request Contact Device to Stop Fixed Interval Communication that is used for other setting No.
• Execution Status Flag Device that is used for other setting No.
• Source device when the host station is a destination device, which is used for other setting No.
For examples of how to use this device, refer to:
Page 127, Section 10.2.
123
(8) Status Save Destination Device
Select the device from D, D (extended data register), W, W (extended link register), R, ZR and specify it as a
device to store the communication status.*1 The values listed below indicate the communication status.
Setting and description
Item
Communication Communication
Status
When waiting for the latency time to pass
Fixed Interval is
Or during the time until communications start after the CPU
set.
1H
Description
Setting
module is powered off and on or reset
Preparing
When waiting for the latency time to pass
On Request is set.
Or during the time until communications start after the CPU
module is powered off and on or reset (including the waiting
time of check if the hub is connected or not)
2H
3H
Waiting for the
Only On Request
When waiting for the communication request by Request
Request
is set.
Contact
Fixed Interval is
When device data communications at a specified execution
set.
interval are possible
Communica-ting
On Request is set.
4H
Error Code No.
*1
Request Contact
Communica-tion
Only Fixed Interval
When the simple PLC communication function is stopped by
Stop
is set.
the request to stop fixed interval communication
The corresponding error code is stored.
Status Save Destination Device cannot be specified overlapped with the following devices.
• Status Save Destination Device
• Execution Interval (Current Value) Save Destination Device
• Source device when the host station is a transmission destination device
• Status Save Destination Device that is used for other setting No.
• Execution Interval (Current Value) Save Destination Device that is used for other setting No.
• Source device when the host station is a transmission destination device, which is used for other setting No.
For examples of how to use this device, refer to:
124
When device data are communicated according to the states of
Page 127, Section 10.2.
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(9) Execution Interval (Current Value) Save Destination Device
Select the device from D, D (extended data register), W, W (extended link register), R, ZR and specify it as a
device to store Execution Interval (Current Value).*1
Item
Execution Interval (Current
Value)
*1
10
Description
If "Fixed Interval" is set for Communication Setting, the actual execution interval of the
communications is stored. If the communications have never been performed properly, "0"
is stored.
Execution Interval (Current Value) Save Destination Device cannot be specified overlapped with the following devices.
• Status Save Destination Device
• Execution Interval (Current Value) Save Destination Device
• Source device when the host station is a transmission destination device
• Status Save Destination Device that is used for other setting No.
• Execution Interval (Current Value) Save Destination Device that is used for other setting No.
• Source device when the host station is a transmission destination device, which is used for other setting No.
For examples of how to use this device, refer to:
Page 127, Section 10.2.
10.1 Setting Method
125
(10)Time-out period and Retry count
Setting item
Description
Setting range
Set the time interval until an error is detected or the
retry of communication is performed when the
Time-out Period
10ms to 65535ms (1ms unit)*1
destination device for communications does not
respond or communications fail.
Set the number of communication retry to be performed
Retry Count
when the destination device for communications does
0 to 255*2
not respond or communications fail.
*1
*2
When the destination device for communications is "MELSEC-A (Ethernet Module)", the value is fixed at 65535ms.
When the destination device for communications is "MELSEC-A (Ethernet Module)", the value is fixed at 0.
Ex. Error detection timing when 2 is set for Retry Count
Communication
error at the
previous time
Communication
error at the
previous time
Retry of
communication,
first time
time-out period
Retry of
communication,
second time
Communication
Communication
Communication
Communication
Interval
Communication
error at the
previous time
time-out period
Error detection
time-out period
The error is detected if the destination device does not respond or communications fail by when the following time has
passed:
(Retry Count + 1) × Time-out Period
(a) Precautions for retry of communication
• Communications at a specified execution interval (when "Fixed Interval" is set for Communication Setting) or
communications according to the ON status of Request Contact (when "On Request" is set for
Communication Setting) are ignored during retry of communication because that period is regarded as Timeout Period.
• During retry of communication, the data at the time of communication error is sent to the destination device
(for writing of device data) and the data at the time of the retry of communication is received (for reading of
device data).
126
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(11)Comment
Comment can be set by entering up to 32 one-byte characters (16 double-byte characters).
10
(12)Latency Time
By setting the latency time, the start timings of the communications can be shifted so that the errors due to
concentration of the communications are prevented. During the latency time, "Preparing" is indicated in
Communication Status.
Setting item
Latency Time
Description
Setting range
Set the time required to start communications after
0s to 255s (1s unit)
completion of the CPU module startup.
Communications at a specified execution interval (when "Fixed Interval" is set for Communication Setting) or
communications at the rising (OFF to ON) of Request Contact (when "On Request" is set for Communication Setting) are
ignored during the latency time.
10.2
Program to check communications
This section shows the program used to check communications when "On Request" is set for Communication Setting.
(1) Devices used for the program
10.2 Program to check communications
Device number
Application
M0
Request Contact for setting No.1
M100
Execution Status Flag Device for setting No.1
M200
Flag to check if Request Contact turns on (when Status is "Communicating")
D1000
Status Save Destination Device for setting No.1
(2) Program example
Processing if communications
were not performed with
"On Request" set
Processing when
communications were completed
with "On Request" set
Processing if communications
failed with "On Request" set
Perform processing for
no communications.
Perform processing for
successful communications.
Perform processing for
communication failure.
127
10.3
Diagnostics
The communication status of the simple PLC communication function can be checked in "Simple PLC Communication
Status" tab of the "Ethernet Diagnostics" dialog box.
[Diagnostics]
[Ethernet Diagnostics]
For detail on Ethernet diagnostics, refer to the following.
GX Works2 Version1 Operating Manual (Common)
10.4
Errors related to the simple PLC communication function
If an error related to this function occurs, it is not regarded as a diagnostic error in the CPU module. Instead the simple
PLC communication status (the corresponding error code) is stored.
(1) Errors caused by the operation status of the CPU module or the operations of
each function
The errors are not stored in the history of Ethernet diagnostics.
Error
Error
code
item
Error timing
Description
Corrective action
After the values in "Device" of PLC
When the parameters
4900H
are written from the
"Write to PLC" window
Parameter of the CPU module, where the
simple PLC communication function had
been set, were changed, the parameters
were written to the CPU module from the
Power off and on the CPU
module. Or reset the CPU
module.
"Write to PLC" window.
If an error related to
4901H
Other
errors
4902H
the simple PLC
The file register used for the simple PLC
Correct the device number of
communication
communication function became out of
the file register. And power off
function occurs (at
range due to the block number change of
and on the CPU module or
corresponding setting
the file register.
reset the module.
No.)
If an error related to
The communication was stopped
the simple PLC
because an error occurred at the other
communication
setting No., for which the same
function occurs (at the
destination device of the corresponding
other setting No.)
setting No. had been set.
The communication was stopped
4903H
If a stop error occurs
because a stop error occurred in the CPU
module where the simple PLC
communication function had been set.
128
Remove the error cause.
Power off and on the CPU
module. Or reset the CPU
module.
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(2) Errors caused by communication failure
The errors are stored in the history of Ethernet diagnostics. The error codes to be stored are the same as those of
communication related errors. For error descriptions and the corrective actions, refer to the following.
10
MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection)
(3) Operations after the error
After the occurrence of the error, if the conditions are restored for proper communications, data communications
are re-started at the following timing.
• When "Fixed Interval" is set for Communication Setting: At the timing of the execution interval
• When "On Request" is set for Communication Setting: At the rising (OFF to ON) of Request Contact
10.4 Errors related to the simple PLC communication function
129
10.5
Precautions
This section provides precautions for the simple PLC communication function.
(1) The timing when the settings are enabled
The settings for this function are enabled at the following timing.
• When powering off and on the CPU module
• When resetting the CPU module
Even if the values of the settings are changed and the CPU module state is changed from STOP to RUN during
execution of this function, the CPU module keeps operating with the previous settings. If the device setting of PLC
parameter is changed and the parameters are written from the "Write to PLC" window, though, an error (error
code: 4900H) is detected while the parameters are being written.
(2) Communications with other CPU modules
The communications are possible only between the CPU modules connected with Ethernet cable.
(Communications with the other CPU modules cannot be performed through the CPU module connected with
Ethernet cable.)
(3) Device data
If the COM instruction is used, not only the data in the END processing but also the data during sequence scan
(at the execution of the COM instruction) are subjected to communications. Therefore, if you want to use exact
data in the END processing for the program, conduct following operations.
[Transmission source] For the program, use a different device from the one specified for this function. At the end
of the program (just before the END), reflect the data of that device to the one specified for this function.
[Transmission destination] At the beginning of the program, reflect the data of the device specified for this function
to the other device, and use that device for the program.
(4) Incomplete data reception and timeout
Because the load of Ethernet communication becomes heavy during the simple PLC communication, if the other
communication (MELSOFT connection or MC protocol) is simultaneously performed by using protocol UDP, the
data reception of UDP may not be completed, resulting in a timeout error. Therefore, to perform other
communications during the simple PLC communication, the communication using TCP is recommended. Also
conduct following operations to reduce Ethernet communication load.
• Increase the execution interval of the simple PLC communication.
• Reduce the number of device points for communication.
(5) Communication stop
For a certain setting No., if the device is waiting for the response of the destination device due to power off of the
module, cable disconnection, or power off of the hub, communications for the other setting No. might be stopped
for 1000ms.
130
CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION
(6) Errors at the destination device
If an error related to this function occurs, following errors might be detected at the destination device.
• When the destination device is L/Q series: Remote password mismatch error
10
• When the destination device is A series: Device number specification error
Also, an error might be detected depending on the settings of the destination device or the conditions of Ethernet
communication.
10.5 Precautions
131
Memo
132
APPENDICES
APPENDICES
Appendix 1
Operation Processing Time for Each
Instruction
The table below indicates the operation processing times required for the instructions introduced in this manual.
A
For the concept of the LCPU operation processing time, refer to the following manual.
MELSEC-Q/L Programming Manual (Common instructions)
Processing time(µs)
Type
Instruction
Condition
L02CPU, L02CPU-P
L26CPU-BT, L26CPU-BT
Minimum
Maximum
Minimum
Maximum
27.20
58.90
23.50
45.50
18.90
56.60
16.60
43.80
16.90
50.70
15.40
39.20
1 byte
16.30
46.30
16.00
35.20
2046 bytes
504.30
532.60
394.20
413.20
Active
SP.SOCOPEN
TCP
Unpassive
Fullpassive
UDP
From the host
CPU
SP.SOCCLOSE
TCP
From the
connected
device
UDP
TCP
UDP
Instructions for
the socket
communication
function
TCP
S.SOCRCVS
UDP
TCP
SP.SOCSND
UDP
2046 bytes
1 byte
2046 bytes
1 byte
16.30
46.30
16.00
35.20
2046 bytes
504.30
532.60
394.20
413.20
1 byte
45.70
61.30
36.60
48.20
2046 bytes
379.70
395.30
267.60
278.20
1 byte
45.70
61.30
36.60
48.20
2046 bytes
379.70
395.30
267.60
278.20
SP.SOCCINF
-
17.10
43.70
14.70
32.30
SP.SOCCSET
-
13.30
42.90
12.70
31.40
16.00
39.60
13.70
29.30
Standard mode →
SP.SOCRMODE
Fixed-length mode
Fixed-length mode →
Standard mode
SP.SOCRDATA
1 byte
13.00
35.60
11.30
26.10
2046 bytes
500.00
521.60
389.70
404.30
133
Appendix 1 Operation Processing Time for Each Instruction
SP.SOCRCV
1 byte
Appendix 2
Port Numbers Used by System
The following table lists port numbers used for the system.
Port number
Application
For future extension (For Q series Ethernet modules, this port number is
1388H (5000)
used for "Auto Open UDP Port".)
For future extension (For Q series Ethernet modules, this port number is
1389H (5001)
used for "over UDP/IP and Ethernet module".)
For future extension (For Q series Ethernet modules, this port number is
138AH (5002)
used for "over TDP/IP and Ethernet module".)
138BH (5003) to 138DH (5005)
For future extension
138EH (5006)
MELSOFT communication port (over UDP/IP and CPU module)
138FH (5007)
MELSOFT communication port (over TDP/IP and CPU module)
1390H (5008)
MELSOFT direct connection port (over CPU module)
1391H (5009)
For future extension
Appendix 3
Added and Changed Functions
The following table shows the built-in Ethernet function, which is changed or added to the CPU module and GX
Works2, as well as the serial No. and software version of the CPU module and GX Works 2 that support the function.
Added function
Simple PLC communication
function
134
Serial No. (first 5 digits)
of CPU module
"13042" or later
GX Works2 version
Reference
1.62Q or later
Page 115, CHAPTER 10
APPENDICES
Appendix 4
Performance List of Simple PLC
Communication Function
This section shows the performance of the execution interval (simple PLC communication function). The execution
interval varies depending on the number of settings, the number of communication points, the scan time of the CPU
module. The interval is also affected by the execution conditions of other functions or Ethernet communication
A
condition.
(1) Condition 1
• Communication Setting: "Fixed Interval"
• Destination device: "MELSEC-Q/L (Built-in Ethernet Function)" = L26CPU-BT
• Sequence scan time (host station): 1ms (the period before the execution of simple PLC communication
function)
• Sequence scan time (destination device): 1ms (The destination device means both the transmission source
and transmission destination for data transfer.)
• Device data: Bit device = M, Word device = D
• Number of settings: The number of destination devices (Double the number for data transfer.)
• The retry of communication is not performed.
CPU module
Communica-
Number of communication points for one
tion Pattern
setting
Read
8
16
32 words for each*1 (Total 64 words)
10.0
18.1
30.7
64 words for each*1 (Total 128 words)
10.0
18.2
31.0
10.0
37.8
-
Write
Transfer
Read
L26CPU-BT,
L26CPU-PBT
Write
(Total 512 words)
32 words for
each*1
(Total 64 words)
10.0
18.2
31.0
64 words for
each*1
(Total 128 words)
10.0
18.3
31.1
256 words for each*1 (Total 512 words)
12.0
39.2
-
32 words for each*1 (Total 64 words)
14.0
27.3
48.6
64 words for each*1 (Total 128 words)
14.0
27.3
48.6
256 words for each*1 (Total 512 words)
20.0
58.0
-
32 words for each
*1
(Total 64 words)
10.0
18.1
30.7
64 words for each
*1
(Total 128 words)
10.0
18.2
31.0
256 words for each*1 (Total 512 words)
10.0
37.8
-
32 words for each*1 (Total 64 words)
10.0
18.2
31.0
64 words for each*1 (Total 128 words)
10.0
18.3
31.1
256 words for each*1 (Total 512 words)
12.0
39.2
-
(Total 64 words)
14.0
27.3
48.6
(Total 128 words)
14.0
27.3
48.6
20.0
58.0
-
32 words for each
Transfer
*1
64 words for
*1
each*1
256 words for each*1 (Total 512 words)
*1
Number of points for each device (bit device and word device)
135
Appendix 4 Performance List of Simple PLC Communication Function
L02CPU-P
settings (unit: ms)
1
256 words for each
L02CPU,
Processing time by the number of
(2) Condition 2
• Communication Setting: "Fixed Interval"
• Destination device: "MELSEC-Q/L (Built-in Ethernet Function)" = L26CPU-BT
• Sequence scan time (host station): 10ms (the period before the execution of simple PLC communication
function)
• Sequence scan time (destination device): 1ms (The destination device means both the transmission source
and transmission destination for data transfer.)
• Device data: Bit device = M, Word device = D
• Number of settings: The number of destination devices (Double the number for data transfer.)
• The retry of communication is not performed.
CPU module
Communica-
Number of communication points for one
tion Pattern
setting
Read
8
16
32 words for each*1 (Total 64 words)
10.0
17.6
29.8
64 words for each*1 (Total 128 words)
11.0
17.9
30.2
256 words for each*1 (Total 512 words)
11.0
37.4
-
(Total 64 words)
10.0
18.1
30.7
(Total 128 words)
11.0
18.2
31.0
256 words for each*1 (Total 512 words)
12.0
39.5
-
32 words for each*1 (Total 64 words)
13.0
26.7
47.4
64 words for each*1 (Total 128 words)
14.0
26.9
47.9
256 words for each*1 (Total 512 words)
20.0
58.3
-
(Total 64 words)
10.0
17.6
29.8
(Total 128 words)
11.0
17.9
30.2
11.0
37.4
-
32 words for each*1 (Total 64 words)
10.0
18.1
30.7
64 words for each*1 (Total 128 words)
11.0
18.2
31.0
256 words for each*1 (Total 512 words)
12.0
39.5
-
32 words for each
L02CPU-P
Write
Transfer
64 words for
each*1
*1
32 words for each
Read
64 words for
each*1
*1
256 words for each
L26CPU-BT,
L26CPU-PBT
Write
(Total 64 words)
13.0
26.7
47.4
*1
(Total 128 words)
14.0
26.9
47.9
20.0
58.3
-
64 words for each
256 words for
*1
136
(Total 512 words)
*1
32 words for each
Transfer
settings (unit: ms)
1
*1
L02CPU,
Processing time by the number of
each*1
(Total 512 words)
Number of points for each device (bit device and word device)
INDEX
A
M
Active open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
MC protocol .
mdelete . . . .
mdir . . . . . .
mget . . . . . .
mls . . . . . . .
mput . . . . . .
B
binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
bye . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . . . . . . . 100
. . . . . . . . . . . . . . . . . . . . . . . . . . . 100
. . . . . . . . . . . . . . . . . . . . . . . . . . . 101
. . . . . . . . . . . . . . . . . . . . . . . . . . . 101
. . . . . . . . . . . . . . . . . . . . . . . . . . . 101
I
N
C
change . . . . . . . . . . . . . . . . . . . . . . . . .
class . . . . . . . . . . . . . . . . . . . . . . . . . . .
close . . . . . . . . . . . . . . . . . . . . . . . . . . .
CPU module . . . . . . . . . . . . . . . . . . . . . .
CPU-module-dedicated subcommands . . .
. . . . . . 103
. . . . . . . 30
. . . . . . . 99
. . . . . . . 15
. . . . . . 103
D
2
NAK message . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
O
open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
P
Data communication frame . . . . . . . . . . . . . . . . . . 36
delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
dir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
DIRECT CONNECTION . . . . . . . . . . . . . . . . . . . . 28
Passive open . . . . .
passwd-rd . . . . . . .
passwd-wr . . . . . . .
password-lock . . . .
password-unlock . .
pm-write . . . . . . . .
Programming tool . .
put . . . . . . . . . . . .
pwd . . . . . . . . . . . .
E
Ethernet cable . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Ethernet communication . . . . . . . . . . . . . . . . . . . . 20
. . . . . . . . . . . . . . . . . . . . . . . 41
. . . . . . . . . . . . . . . . . . . . . . 105
. . . . . . . . . . . . . . . . . . . . . . 106
. . . . . . . . . . . . . . . . . . . . . . 104
. . . . . . . . . . . . . . . . . . . . . . 103
. . . . . . . . . . . . . . . . . . . . . . 105
. . . . . . . . . . . . . . . . . . . . . . . 15
. . . . . . . . . . . . . . . . . . . . . . 102
. . . . . . . . . . . . . . . . . . . . . . 102
Q
F
FILE TRANSFER FUNCTION . . . . . . . . . . . . . . . . 90
FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
FTP Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 96
FTP server support commands . . . . . . . . . . . . . . . . 99
Fullpassive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
quote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
R
recv function
rename . . . .
ret . . . . . . . .
Routers . . . .
run . . . . . . .
G
get. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
GOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
. . . . . . . . . . . . . . . . . . . . . . . . . . . 102
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
. . . . . . . . . . . . . . . . . . . . . . . . . . . 104
S
H
host name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
hosts file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
hub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
K
KeepAlive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
L
SD memory card . . . . . . . . . . . . . . . . . . . . . . . . . 15
Searching CPU Modules . . . . . . . . . . . . . . . . . . . . 24
SIMPLE CONNECTION . . . . . . . . . . . . . . . . . . . . 28
Simultaneous broadcast . . . . . . . . . . . . . . . . . . . . 53
SNTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
SNTP CLIENT . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Socket Communication Function Instructions . . . . . . 58
status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
stop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Subcommand . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
LCPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
lock processing . . . . . . . . . . . . . . . . . . . . . . . . . . 110
ls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
137
7
8
T
TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
TCP fixed-length receive mode . . . . . . . . . . . . . . .
TCP socket functions . . . . . . . . . . . . . . . . . . . . . .
TCP standard receive mode . . . . . . . . . . . . . . . . .
TIME SETTING FUNCTION . . . . . . . . . . . . . . . . .
19
83
37
83
87
U
UDP . . . . . . . . . .
unlock processing
Unpassive . . . . . .
user . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 19
. . . . . . . . . . . . . . . . . . . . . . . 110
. . . . . . . . . . . . . . . . . . . . . . . . 41
. . . . . . . . . . . . . . . . . . . . . . . 102
W
wild card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
138
INSTRUCTION INDEX
S
S(P).SOCRDATA
S.SOCRCVS . . .
SP.SOCCINF . . .
SP.SOCCLOSE .
SP.SOCCSET . .
SP.SOCOPEN . .
SP.SOCRCV . . .
SP.SOCRMODE .
SP.SOCSND . . .
2
. . . . . . . . . . . . . . . . . . . . . . . . . 85
. . . . . . . . . . . . . . . . . . . . . . . . . 70
. . . . . . . . . . . . . . . . . . . . . . . . . 77
. . . . . . . . . . . . . . . . . . . . . . . . . 64
. . . . . . . . . . . . . . . . . . . . . . . . . 80
. . . . . . . . . . . . . . . . . . . . . . . . . 59
. . . . . . . . . . . . . . . . . . . . . . . . . 67
. . . . . . . . . . . . . . . . . . . . . . . . . 82
. . . . . . . . . . . . . . . . . . . . . . . . . 73
I
7
8
139
REVISIONS
*The manual number is given on the bottom left of the back cover.
Print date
January 2010
*Manual number
Revision
SH(NA)-080891ENG-A First edition
April 2010
SH(NA)-080891ENG-B
Partial correction
Section 8.5
January 2011
SH(NA)-080891ENG-C
Partial correction
TERMS, Chapter 2, Section 3.5, 5.1, 6.1, 6.2, 6.3, 6.4.1, 6.4.3, 6.4.4, 6.4.5,
6.4.6, 8.4.2, 8.5
Additions
Appendix 2
July 2011
SH(NA)-080891ENG-D
Partial correction
INTRODUCTION, Chapter 1, Section 5.2.2, 6.3, 6.4.1, 6.4.6, Appendix 1
Additions
Chapter 10, Section 10.1, 10.2 10.3, 10.4, 10.5, Appendix 3, Appendix 4
September 2011 SH(NA)-080891ENG-E
Partial correction
SAFETY PRECAUTIONS, RELEVANT MANUALS, TERMS, Chapter 2,
Section 3.5, 5.2.2
Japanese manual version SH-080875-E
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses.
Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may
occur as a result of using the contents noted in this manual.
© 2010 MITSUBISHI ELECTRIC CORPORATION
140
WARRANTY
Please confirm the following product warranty details before using this product.
1. Gratis Warranty Term and Gratis Warranty Range
If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the
product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or
Mitsubishi Service Company.
However, if repairs are required onsite at domestic or overseas location, expenses to send an engineer will be
solely at the customer's discretion. Mitsubishi shall not be held responsible for any re-commissioning,
maintenance, or testing on-site that involves replacement of the failed module.
[Gratis Warranty Term]
The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated
place.
Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months,
and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of
repair parts shall not exceed the gratis warranty term before repairs.
[Gratis Warranty Range]
(1) The range shall be limited to normal use within the usage state, usage methods and usage environment, etc.,
which follow the conditions and precautions, etc., given in the instruction manual, user's manual and caution
labels on the product.
(2) Even within the gratis warranty term, repairs shall be charged for in the following cases.
1. Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure
caused by the user's hardware or software design.
2. Failure caused by unapproved modifications, etc., to the product by the user.
3. When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if
functions or structures, judged as necessary in the legal safety measures the user's device is subject to or
as necessary by industry standards, had been provided.
4. Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the
instruction manual had been correctly serviced or replaced.
5. Failure caused by external irresistible forces such as fires or abnormal voltages, and Failure caused by
force majeure such as earthquakes, lightning, wind and water damage.
6. Failure caused by reasons unpredictable by scientific technology standards at time of shipment from
Mitsubishi.
7. Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user.
2. Onerous repair term after discontinuation of production
(1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is
discontinued.
Discontinuation of production shall be notified with Mitsubishi Technical Bulletins, etc.
(2) Product supply (including repair parts) is not available after production is discontinued.
3. Overseas service
Overseas, repairs shall be accepted by Mitsubishi's local overseas FA Center. Note that the repair conditions at
each FA Center may differ.
4. Exclusion of loss in opportunity and secondary loss from warranty liability
Regardless of the gratis warranty term, Mitsubishi shall not be liable for compensation of damages caused by any
cause found not to be the responsibility of Mitsubishi, loss in opportunity, lost profits incurred to the user by Failures
of Mitsubishi products, special damages and secondary damages whether foreseeable or not, compensation for
accidents, and compensation for damages to products other than Mitsubishi products, replacement by the user,
maintenance of on-site equipment, start-up test run and other tasks.
5. Changes in product specifications
The specifications given in the catalogs, manuals or technical documents are subject to change without prior notice.
141
Microsoft, Windows, Windows NT, and Windows Vista are registered trademarks of Microsoft Corporation in the United
States and other countries.
Pentium is a trademark of Intel Corporation in the United States and other countries.
Ethernet is a trademark of Xerox Corporation.
The SD logo and SDHC logo are trademarks.
All other company names and product names used in this manual are trademarks or registered
trademarks of their respective companies.
142
SH(NA)-080891ENG-E
MITSUBISHI ELECTRIC
HEADQUARTERS
EUROPEAN REPRESENTATIVES
EUROPEAN REPRESENTATIVES
MITSUBISHI ELECTRIC EUROPE B.V.
EUROPE
German Branch
Gothaer Straße 8
D-40880 Ratingen
Phone: +49 (0)2102 / 486-0
Fax: +49 (0)2102 / 486-1120
MITSUBISHIELECTRICEUROPEB.V.-org.sl. CZECH REP.
Czech Branch
Avenir Business Park, Radlická 714/113a
CZ-158 00 Praha 5
Phone: +420 - 251 551 470
Fax: +420 - 251-551-471
MITSUBISHI ELECTRIC EUROPE B.V.
FRANCE
French Branch
25, Boulevard des Bouvets
F-92741 Nanterre Cedex
Phone: +33 (0)1 / 55 68 55 68
Fax: +33 (0)1 / 55 68 57 57
MITSUBISHI ELECTRIC EUROPE B.V.
IRELAND
Irish Branch
Westgate Business Park, Ballymount
IRL-Dublin 24
Phone: +353 (0)1 4198800
Fax: +353 (0)1 4198890
MITSUBISHI ELECTRIC EUROPE B.V.
ITALY
Italian Branch
Viale Colleoni 7
I-20041 Agrate Brianza (MB)
Phone: +39 039 / 60 53 1
Fax: +39 039 / 60 53 312
MITSUBISHI ELECTRIC EUROPE B.V.
POLAND
Poland Branch
Krakowska 50
PL-32-083 Balice
Phone: +48 (0)12 / 630 47 00
Fax: +48 (0)12 / 630 47 01
MITSUBISHI ELECTRIC EUROPE B.V.
RUSSIA
52, bld. 3 Kosmodamianskaya nab 8 floor
RU-115054 Мoscow
Phone: +7 495 721-2070
Fax: +7 495 721-2071
MITSUBISHI ELECTRIC EUROPE B.V.
SPAIN
Spanish Branch
Carretera de Rubí 76-80
E-08190 Sant Cugat del Vallés (Barcelona)
Phone: 902 131121 // +34 935653131
Fax: +34 935891579
MITSUBISHI ELECTRIC EUROPE B.V.
UK
UK Branch
Travellers Lane
UK-Hatfield, Herts. AL10 8XB
Phone: +44 (0)1707 / 27 61 00
Fax: +44 (0)1707 / 27 86 95
MITSUBISHI ELECTRIC CORPORATION
JAPAN
Office Tower “Z” 14 F
8-12,1 chome, Harumi Chuo-Ku
Tokyo 104-6212
Phone: +81 3 622 160 60
Fax: +81 3 622 160 75
MITSUBISHI ELECTRIC AUTOMATION, Inc.
USA
500 Corporate Woods Parkway
Vernon Hills, IL 60061
Phone: +1 847 478 21 00
Fax: +1 847 478 22 53
GEVA
AUSTRIA
Wiener Straße 89
AT-2500 Baden
Phone: +43 (0)2252 / 85 55 20
Fax: +43 (0)2252 / 488 60
TECHNIKON
BELARUS
Oktyabrskaya 19, Off. 705
BY-220030 Minsk
Phone: +375 (0)17 / 210 46 26
Fax: +375 (0)17 / 210 46 26
ESCO DRIVES & AUTOMATION
BELGIUM
Culliganlaan 3
BE-1831 Diegem
Phone: +32 (0)2 / 717 64 30
Fax: +32 (0)2 / 717 64 31
Koning & Hartman b.v.
BELGIUM
Woluwelaan 31
BE-1800 Vilvoorde
Phone: +32 (0)2 / 257 02 40
Fax: +32 (0)2 / 257 02 49
INEA RBT d.o.o.
BOSNIA AND HERZEGOVINA
Aleja Lipa 56
BA-71000 Sarajevo
Phone: +387 (0)33 / 921 164
Fax: +387 (0)33/ 524 539
AKHNATON
BULGARIA
4, Andrei Ljapchev Blvd., PO Box 21
BG-1756 Sofia
Phone: +359 (0)2 / 817 6000
Fax: +359 (0)2 / 97 44 06 1
INEA RBT d.o.o.
CROATIA
Losinjska 4 a
HR-10000 Zagreb
Phone: +385 (0)1 / 36 940 - 01/ -02/ -03
Fax: +385 (0)1 / 36 940 - 03
AutoCont C.S. s.r.o.
CZECH REPUBLIC
Technologická 374/6
CZ-708 00 Ostrava-Pustkovec
Phone: +420 595 691 150
Fax: +420 595 691 199
Beijer Electronics A/S
DENMARK
Lykkegårdsvej 17
DK-4000 Roskilde
Phone: +45 (0)46/ 75 76 66
Fax: +45 (0)46 / 75 56 26
Beijer Electronics Eesti OÜ
ESTONIA
Pärnu mnt.160i
EE-11317 Tallinn
Phone: +372 (0)6 / 51 81 40
Fax: +372 (0)6 / 51 81 49
Beijer Electronics OY
FINLAND
Peltoie 37
FIN-28400 Ulvila
Phone: +358 (0)207 / 463 540
Fax: +358 (0)207 / 463 541
UTECO
GREECE
5, Mavrogenous Str.
GR-18542 Piraeus
Phone: +30 211 / 1206 900
Fax: +30 211 / 1206 999
MELTRADE Kft.
HUNGARY
Fertő utca 14.
HU-1107 Budapest
Phone: +36 (0)1 / 431-9726
Fax: +36 (0)1 / 431-9727
Beijer Electronics SIA
LATVIA
Ritausmas iela 23
LV-1058 Riga
Phone: +371 (0)784 / 2280
Fax: +371 (0)784 / 2281
Beijer Electronics UAB
LITHUANIA
Savanoriu Pr. 187
LT-02300 Vilnius
Phone: +370 (0)5 / 232 3101
Fax: +370 (0)5 / 232 2980
ALFATRADE Ltd.
MALTA
99, Paola Hill
Malta- Paola PLA 1702
Phone: +356 (0)21 / 697 816
Fax: +356 (0)21 / 697 817
INTEHSIS srl
MOLDOVA
bld. Traian 23/1
MD-2060 Kishinev
Phone: +373 (0)22 / 66 4242
Fax: +373 (0)22 / 66 4280
HIFLEX AUTOM.TECHNIEK B.V.
NETHERLANDS
Wolweverstraat 22
NL-2984 CD Ridderkerk
Phone: +31 (0)180 – 46 60 04
Fax: +31 (0)180 – 44 23 55
Koning & Hartman b.v.
NETHERLANDS
Haarlerbergweg 21-23
NL-1101 CH Amsterdam
Phone: +31 (0)20 / 587 76 00
Fax: +31 (0)20 / 587 76 05
Beijer Electronics AS
NORWAY
Postboks 487
NO-3002 Drammen
Phone: +47 (0)32 / 24 30 00
Fax: +47 (0)32 / 84 85 77
Fonseca S.A.
PORTUGAL
R. João Francisco do Casal 87/89
PT - 3801-997 Aveiro, Esgueira
Phone: +351 (0)234 / 303 900
Fax: +351 (0)234 / 303 910
Sirius Trading & Services srl
ROMANIA
Aleea Lacul Morii Nr. 3
RO-060841 Bucuresti, Sector 6
Phone: +40 (0)21 / 430 40 06
Fax: +40 (0)21 / 430 40 02
INEA RBT d.o.o.
SERBIA
Izletnicka 10
SER-113000 Smederevo
Phone: +381 (0)26 / 615 401
Fax: +381 (0)26 / 615 401
SIMAP s.r.o.
SLOVAKIA
Jána Derku 1671
SK-911 01 Trencín
Phone: +421 (0)32 743 04 72
Fax: +421 (0)32 743 75 20
PROCONT, spol. s r.o. Prešov
SLOVAKIA
Kúpelná 1/A
SK-080 01 Prešov
Phone: +421 (0)51 7580 611
Fax: +421 (0)51 7580 650
INEA RBT d.o.o.
SLOVENIA
Stegne 11
SI-1000 Ljubljana
Phone: +386 (0)1 / 513 8116
Fax: +386 (0)1 / 513 8170
Beijer Electronics AB
SWEDEN
Box 426
SE-20124 Malmö
Phone: +46 (0)40 / 35 86 00
Fax: +46 (0)40 / 93 23 01
Omni Ray AG
SWITZERLAND
Im Schörli 5
CH-8600 Dübendorf
Phone: +41 (0)44 / 802 28 80
Fax: +41 (0)44 / 802 28 28
GTS
TURKEY
Bayraktar Bulvari Nutuk Sok. No:5
TR-34775 Yukarı Dudullu-Ümraniye-İSTANBUL
Phone: +90 (0)216 526 39 90
Fax: +90 (0)216 526 3995
CSC Automation Ltd.
UKRAINE
4-B, M. Raskovoyi St.
UA-02660 Kiev
Phone: +380 (0)44 / 494 33 55
Fax: +380 (0)44 / 494-33-66
Systemgroup
UKRAINE
2 M. Krivonosa St.
UA-03680 Kiev
Phone: +380 (0)44 / 490 92 29
Fax: +380 (0)44 / 248 88 68
EURASIAN REPRESENTATIVES
TOO Kazpromavtomatika
Ul. Zhambyla 28
KAZ-100017 Karaganda
Phone: +7 7212 / 50 10 00
Fax: +7 7212 / 50 11 50
KAZAKHSTAN
MIDDLE EAST REPRESENTATIVES
ILAN & GAVISH Ltd.
ISRAEL
24 Shenkar St., Kiryat Arie
IL-49001 Petah-Tiqva
Phone: +972 (0)3 / 922 18 24
Fax: +972 (0)3 / 924 0761
GIRIT CELADON LTD
ISRAEL
12 H'aomanut Street
IL-42505 Netanya
Phone: +972 (0)9 / 863 39 80
Fax: +972 (0)9 / 885 24 30
CEG INTERNATIONAL
LEBANON
Cebaco Center/Block A Autostrade DORA
Lebanon - Beirut
Phone: +961 (0)1 / 240 430
Fax: +961 (0)1 / 240 438
AFRICAN REPRESENTATIVE
CBI Ltd.
Private Bag 2016
ZA-1600 Isando
Phone: + 27 (0)11 / 977 0770
Fax: + 27 (0)11 / 977 0761
SOUTH AFRICA
Mitsubishi Electric Europe B.V. /// FA - European Business Group /// Gothaer Straße 8 /// D-40880 Ratingen /// Germany
Tel.: +49(0)2102-4860 /// Fax: +49(0)2102-4861120 /// info@mitsubishi-automation.com /// www.mitsubishi-automation.com
Download PDF