Mitsubishi Electric CPU Module v4 User's Manual
![Mitsubishi Electric CPU Module manual cover](/images/ff7b68b07c7ea0f3dea75a84/thumbs/thumb175x175.webp)
![English English](/static/img/blank.webp)
MELSEC-L CPU Module User's Manual (Built-In Ethernet Function)
-L02CPU -L02CPU-P -L06CPU -L06CPU-P -L26CPU -L26CPU-P -L26CPU-BT -L26CPU-PBT
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".
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.
WARNING
CAUTION
Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
Indicates that incorrect handling may cause hazardous conditions, resulting in minor or moderate injury or property damage.
1
[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 dog 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.
(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. (5) 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).
(6) 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.
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.
To prevent the malfunction of the programmable controller system due to harmful e-mails, take preventive measures (such as antivirus measures) so that the mail server for this module does not receive harmful e-mails.
2
[Design Precautions]
[Design Precautions]
[Security Precautions]
WARNING When changing data from a peripheral device connected to the CPU module during operation,
configure an interlock circuit in the program to ensure that the entire system will always operate safely. For other forms of control (such as program modification or operating status change) of a running programmable controller, read the relevant manuals carefully and ensure that the operation is safe before proceeding. Especially, when a remote programmable controller is controlled by an external device, immediate action cannot be taken if a problem occurs in 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.
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.
WARNING To maintain the security (confidentiality, integrity, and availability) of the programmable controller and
the system against unauthorized access, denial-of-service (DoS) attacks, computer viruses, and other cyberattacks from external devices via the network, take appropriate measures such as firewalls, virtual private networks (VPNs), and antivirus solutions.
3
[Installation Precautions]
[Installation Precautions]
[Wiring Precautions]
WARNING Shut off the external power supply (all phases) used in the system before mounting or removing a
module. Failure to do so may result in electric shock or cause the module to fail or malfunction.
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 until they click. 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.
When using an SD memory card, fully insert it into the SD memory card slot. Check that it is inserted completely. Poor contact may cause malfunction.
Do not directly touch any conductive parts and electronic components of the module or SD memory card. Doing so can cause malfunction or failure of the module.
WARNING Shut off the external power supply (all phases) used in the system 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.
4
[Wiring Precautions]
[Startup and Maintenance Precautions]
CAUTION Individually ground the FG and LG terminals of the programmable controller with a ground resistance
of 100 ohms or less. 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.
Tighten the terminal block screws 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, 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 Electric 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).
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 (all phases) used in the system before cleaning the module or retightening the terminal block screws. Failure to do so may result in electric shock.
5
[Startup and Maintenance Precautions]
[Disposal Precautions]
[Transportation Precautions]
CAUTION Before performing online operations (especially, program modification, forced output, and operating
status change) for the running CPU module from the peripheral connected, read relevant manuals carefully and ensure the safety. Improper operation may damage machines or cause accidents.
Do not disassemble or modify the module. 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 (all phases) used in the system before mounting or removing a module. Failure to do so may cause the module to fail or malfunction.
Tighten the terminal block screws 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, do not insert/remove the memory card more than 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.
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).)
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.
(3) Mitsubishi shall have no responsibility or liability for any problems involving programmable controller trouble and system trouble caused by DoS attacks, unauthorized access, computer viruses, and other cyberattacks.
7
INTRODUCTION Thank you for purchasing the Mitsubishi Electric MELSEC-L series programmable controllers. This manual describes the functions of the CPU module and programming necessary for Ethernet communication.
Before using this 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 an 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
Remark
This manual describes only the functions of CPU module using 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) QnUDVCPU/LCPU User's Manual (Data Logging Function)
The L02SCPU and L02SCPU-P do not support the built-in Ethernet function.
CPU module Model
LCPU L02CPU, L02CPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P, L26CPU-BT, and L26CPU-PBT
8
RELEVANT MANUALS
(1) CPU module user's manual
(2) Programming manual
(3) Operating manual
(4) I/O module and intelligent function module manual
Manual name
Description
MELSEC-L CPU Module User's Manual (Hardware Design, Maintenance and Inspection)
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
MELSEC-L CPU Module User's Manual (Function Explanation, Program Fundamentals)
MELSEC-L CPU Module User's Manual (Built-In I/O Function)
The general-purpose I/O function, interrupt input function, pulse catch function, positioning function, and high-speed counter function of the CPU module
QnUDVCPU/LCPU User's Manual (Data Logging Function)
The data logging function of the CPU module
Manual name
Description
MELSEC-Q/L Programming Manual (Common Instruction)
Detailed description and usage of instructions used in programs
Manual name
Description
GX Works2 Version 1 Operating Manual (Common)
System configuration, parameter settings, and online operations of GX Works2, which are common to Simple projects and Structured projects
GX Developer Version 8 Operating Manual
Operating methods of GX Developer, such as programming, printing, monitoring, and debugging
Manual name
Description
MELSEC Communication Protocol Reference Manual
Details of MELSEC communication protocol (MC protocol) that is used for data communication between a target device and a CPU module
9
CONTENTS
10
CONTENTS
SAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 CONDITIONS OF USE FOR THE PRODUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 RELEVANT MANUALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 MANUAL PAGE ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 TERMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
CHAPTER 1 OVERVIEW 18
CHAPTER 2 COMMUNICATION SPECIFICATIONS 20
CHAPTER 3 CONNECTION WITH PROGRAMMING TOOL AND GOT 22
3.1 Setting Required for the CPU Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Setting Required for the Programming Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3 Searching CPU Modules on the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.4 Communication via Routers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.5 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
CHAPTER 4 DIRECT CONNECTION TO PROGRAMMING TOOL (SIMPLE CONNECTION) 31
4.1 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
CHAPTER 5 MC PROTOCOL COMMUNICATION 34
5.1 Sending a Command from an External Device to the CPU Module . . . . . . . . . . . . . . . . . . . . . 34
5.1.1 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
5.1.2 MC Protocol Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
5.1.3 Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
5.1.4 Error Codes for MC Protocol Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
5.2 Sending a Command from the CPU Module to an External Device . . . . . . . . . . . . . . . . . . . . . 43
5.2.1 Sending an SLMP frame (SP.SLMPSND) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
CHAPTER 6 DATA COMMUNICATIONS USING THE PREDEFINED PROTOCOL 53
6.1 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.2 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.3 Setting Items of Predefined Protocol Support Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.3.1 Communication type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
6.3.2 Packet elements set for "Packet Setting". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
6.4 Predefined Protocol Function Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.4.1 Executing the predefined protocol (SP.ECPRTCL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
6.5 Execution Conditions of Predefined Protocol Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.6 Operation Image and Data Structure of the Predefined Protocol Function . . . . . . . . . . . . . . . 62
6.7 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
CHAPTER 7 SOCKET COMMUNICATION FUNCTION 64
7.1 Communication Using TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.2 Communication Using UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.3 Precautions for the Socket Communication Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.4 Socket Communication Function Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.4.1 Establishing a connection (SP.SOCOPEN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
7.4.2 Disconnecting a connection (SP.SOCCLOSE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92
7.4.3 Reading out received data in the END processing (SP.SOCRCV) . . . . . . . . . . . . . . . . . . . . .95
7.4.4 Reading out received data during instruction execution (S.SOCRCVS) . . . . . . . . . . . . . . . . .99
7.4.5 Sending data (SP.SOCSND) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102
7.4.6 Reading out connection information (SP.SOCCINF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
7.4.7 Changing the target of a connection (UDP/IP) (SP.SOCCSET). . . . . . . . . . . . . . . . . . . . . . .109
7.4.8 Changing the receive mode of a connection (SP.SOCRMODE) . . . . . . . . . . . . . . . . . . . . . . 111
7.4.9 Socket communication receive data read (S(P).SOCRDATA) . . . . . . . . . . . . . . . . . . . . . . . .114
CHAPTER 8 TIME SETTING FUNCTION (SNTP CLIENT) 116
8.1 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
8.2 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
CHAPTER 9 FILE TRANSFER FUNCTION (FTP SERVER) 119
9.1 Setting for FTP Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
9.2 Files That Can Be Transferred Using FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
9.3 Files That Can Be Deleted Using FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
9.4 FTP Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
9.4.1 List of FTP commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
9.4.2 How to specify an FTP command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129
9.4.3 Details of FTP commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130
9.5 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
CHAPTER 10 FILE TRANSFER FUNCTION (FTP CLIENT) 139
10.1 Transferrable Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
10.2 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
10.2.1 Parameter setting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141
10.2.2 Settings at programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143
10.3 File Transfer Function Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
10.3.1 FTP client file transmission (SP.FTPPUT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146
10.3.2 FTP client file acquisition (SP.FTPGET). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152
10.4 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
10.5 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
CHAPTER 11 REMOTE PASSWORD 159
11.1 Communication Using Remote Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
11.2 Remote Password Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
11
12
11.3 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
11.4 Detection of Unauthorized Access and Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
CHAPTER 12 SIMPLE PLC COMMUNICATION FUNCTION 165
12.1 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
12.2 Program to Check Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
12.3 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
12.4 Errors Related to the Simple PLC Communication Function . . . . . . . . . . . . . . . . . . . . . . . . . 184
12.5 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
CHAPTER 13 IP ADDRESS CHANGE FUNCTION 188
13.1 IP Address of the Built-in Ethernet Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
13.2 How to Use the Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
13.2.1 Write operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190
13.2.2 Clear operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193
13.3 Checking the IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
13.4 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
CHAPTER 14 IP PACKET TRANSFER FUNCTION 198
CHAPTER 15 E-MAIL SEND/RECEIVE FUNCTION 200
15.1 E-mail Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
15.2 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
15.2.1 Parameter setting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202
15.2.2 Settings at programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205
15.3 Function Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
15.3.1 Function to read/write device when e-mail is received. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206
15.3.2 Send destination e-mail address edit function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210
15.4 E-mail Send/Receive Function Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
15.4.1 Send e-mail (SP.MLSEND) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211
15.4.2 Send e-mail (SP.MLRECV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .215
15.4.3 E-mail address registration/deletion (SP.MLOPEADR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
15.4.4 E-mail address acquisition (SP.MLGETADR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222
15.5 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
APPENDICES 225
Appendix 1 Operation Processing Time for Each Instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Appendix 2 Port Numbers Used by Built-in Ethernet Port LCPU. . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Appendix 3 Added and Changed Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Appendix 4 Performance List of Simple PLC Communication Function . . . . . . . . . . . . . . . . . . . . . 229
Appendix 5 Specifications Comparison with Ethernet Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
INDEX 239
INSTRUCTION INDEX 241
REVISIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 WARRANTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 TRADEMARKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
13
MANUAL PAGE ORGANIZATION In this manual, pages are organized and the symbols are used as shown below. The following illustration is for explanation purpose only, and should not be referred to as an actual documentation.
*1 The mouse operation example (for GX Works2) is provided below.
The section of the current page is shown.
The chapter of the current page is shown.
"" is used for screen names and items.
[ ] is used for items in the menu bar and the project window.
shows operating procedures.
shows reference manuals.
shows notes that requires attention.
shows mouse operations.*1
shows reference pages.
shows setting or operating examples. Ex.
shows useful information.
A window selected in the view selection area is displayed.
View selection area
[Online] [Write to PLC...] Select [Online] on the menu bar, and then select [Write to PLC...].
Project window [Parameter] [PLC Parameter] Select [Project] from the view selection area to open the Project window.
Menu bar
Ex.
Ex.
In the Project window, expand [Parameter] and select [PLC Parameter].
14
Pages describing instructions are organized as shown below. The following illustration is for explanation purpose only, and should not be referred to as an actual documentation.
Descriptions of setting data and data type
Instruction name
Structure of the instruction in the ladder mode
shows the devices applicable to the instruction
Descriptions of control data (if any)
Execution condition of the instruction
Setting side User : Device value is set by the user. System: Device value is set by the CPU module.
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
Detailed descriptions of the instruction
15
Instructions can be executed under the following conditions.
The following devices can be used.
*1 For details on each device, refer to the following. MELSEC-L CPU Module User's Manual (Function Explanation, Program Fundamentals)
*2 FX and FY can be used for bit data only, and FD for word data only. *3 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.
Execution condition Any time During on On the rising
edge During off
On the falling edge
Symbol No symbol
Setting data
Internal device (system, user) File
register
Link direct device J\
Intelligent function module
device U\G
Index register
Zn Constant *3 Others *3
Bit Word Bit Word
Applicable
device*1
X, Y, M, L, SM, F, B, SB, FX,
FY*2
T, ST, C, D, W, SD,
SW, FD, @
R, ZR U\G Z K, H, E, $
P, I, J, U, D, X, DY, N, BL, TR, BL\S, V
Data type Description Bit 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
16
TERMS Unless otherwise specified, this manual uses the following terms.
Term Description Branch module An abbreviation for the MELSEC-L series branch module
Built-in Ethernet port LCPU A generic term for the L02CPU, L02CPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P, L26CPU-BT, and L26CPU-PBT
CPU module An abbreviation for the MELSEC-L series CPU module
Display unit A liquid crystal display to be attached to the CPU module
END cover A cover to be attached to the right side of the rightmost MELSEC-L series module
Extension cable An abbreviation for the MELSEC-L series extension cable
Extension module An abbreviation for the MELSEC-L series extension module
External device A GOT, measuring instrument, ID module, bar code reader, adjuster, and other CPU modules connected with a CPU module for the data communication
FTP An abbreviation for File Transfer Protocol, which is a standard network protocol used to exchange files
GX Developer The product name of the software package for the MELSEC programmable controllers
GX Works2
LCPU Another term for the MELSEC-L series CPU module
MC protocol An abbreviation for the MELSEC communication protocol, a protocol to access a CPU module from a target device in the Ethernet or serial communication
Power supply module An abbreviation for the MELSEC-L series power supply module
Programming tool A generic term for GX Works2 and GX Developer
SD memory card Secure Digital Memory Card, which is a flash memory device. The NZ1MEM-2GBSD, NZ1MEM-4GBSD, NZ1MEM-8GBSD, NZ1MEM-16GBSD, L1MEM-2GBSD, and L1MEM-4GBSD are available.
SNTP An abbreviation for Simple Network Time Protocol, which is a protocol for synchronizing the clocks of computer systems over a TCP/IP based network
17
CHAPTER 1 OVERVIEW
The following describes the built-in Ethernet function of the CPU module.
(1) Connection with programming tool and GOT ( Page 22, 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 programming tool (simple connection) ( Page 31, 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 34, CHAPTER 5) From an external device such as a personal computer or HMI, device data of the CPU module can be read or written using MC protocol commands. In addition, MC protocol messages (QnA-compatible 3E frame) can be sent from the CPU module to external devices connected on the Ethernet network.
(4) Communications using the predefined protocol ( Page 53, CHAPTER 6) The predefined protocol function sends and receives packets predefined by using GX Works2, enabling easy communications with external devices (such as measuring instruments and bar code readers). Protocol can be either selected from the prepared predefined protocol library, or created and edited by users.
(5) Socket communication function ( Page 64, CHAPTER 7) 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.
(6) Time setting function (SNTP client) ( Page 116, CHAPTER 8) Automatic time setting of the CPU module can reduce the maintenance cost for time setting. By sharing the same clock data among CPU modules connected to Ethernet via their built-in Ethernet ports,
the order of errors between processes can be traced, facilitating problem solving. Since the automatic time setting is enabled upon power-on of the CPU module, operations can be started
based on accurate clock data.
(7) File transfer function (FTP server) ( Page 119, CHAPTER 9) 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.
18
CHAPTER 1 OVERVIEW
1
(8) File transfer function (FTP client) ( Page 139, CHAPTER 10) Each of the files stored in the CPU module can be read or written from the interfacing device with the FTP server function, and a large amount of data can be