Mitsubishi L02CPU, L26CPU-P, L02CPU-P, L26CPU-BT, L26CPU-PBT User Manual

...
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

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.
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.
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.
To maintain the safety of the programmable controller system against unauthorized access from external devices via the network, take appropriate measures. To maintain the safety against unauthorized access via the Internet, take measures such as installing a firewall.
2
[Design 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.
[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 (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.
3
[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 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.
[Wiring Precautions]
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]
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 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).
[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 (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]
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.
[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

Remark
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 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
CPU module Model
LCPU
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.
L02CPU, L02CPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P, L26CPU-BT, and L26CPU-PBT
8

RELEVANT MANUALS

(1) CPU module user's manual
Manual name
<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)
<SH-080889ENG, 13JZ35>
MELSEC-L CPU Module User's Manual (Built-In I/O Function)
<SH-080892ENG, 13JZ38>
QnUDVCPU/LCPU User's Manual (Data Logging Function)
<SH-080893ENG, 13JZ39>
(2) Programming manual
Manual name
<manual number (model code)>
MELSEC-Q/L Programming Manual (Common Instruction)
<SH-080809ENG, 13JW10>
Description
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
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
Description
Detailed description and usage of instructions used in programs
(3) Operating manual
Manual name
<manual number (model code)>
GX Works2 Version 1 Operating Manual (Common)
<SH-080779ENG, 13JU63>
GX Developer Version 8 Operating Manual
<SH-080373E, 13JU41>
System configuration, parameter settings, and online operations of GX Works2, which are common to Simple projects and Structured projects
Operating methods of GX Developer, such as programming, printing, monitoring, and debugging
(4) I/O module and intelligent function module manual
Manual name
<manual number (model code)>
MELSEC Communication Protocol Reference Manual
<SH-080008, 13JF89>
Details of MELSEC communication protocol (MC protocol) that is used for data communication between a target device and a CPU module
Description
Description
9

CONTENTS

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
10
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
11.3 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
11.4 Detection of Unauthorized Access and Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
CHAPTER 12 SIMPLE PLC COMMUNICATION FUNCTION 165
12.1 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
12.2 Program to Check Communications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
12.3 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
12.4 Errors Related to the Simple PLC Communication Function . . . . . . . . . . . . . . . . . . . . . . . . . 178
12.5 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
CHAPTER 13 IP ADDRESS CHANGE FUNCTION 181
13.1 IP Address of the Built-in Ethernet Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
13.2 How to Use the Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
13.2.1 Write operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183
13.2.2 Clear operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186
13.3 Checking the IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
13.4 Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
CHAPTER 14 IP PACKET TRANSFER FUNCTION 191
CHAPTER 15 E-MAIL SEND/RECEIVE FUNCTION 193
15.1 E-mail Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
15.2 Setting Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
15.2.1 Parameter setting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .195
15.2.2 Settings at programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198
15.3 Function Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
15.3.1 Function to read/write device when e-mail is received. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199
15.3.2 Send destination e-mail address edit function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203
15.4 E-mail Send/Receive Function Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
15.4.1 Send e-mail (SP.MLSEND) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204
15.4.2 Send e-mail (SP.MLRECV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
15.4.3 E-mail address registration/deletion (SP.MLOPEADR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .213
15.4.4 E-mail address acquisition (SP.MLGETADR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .216
15.5 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
APPENDICES 219
Appendix 1 Operation Processing Time for Each Instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Appendix 2 Port Numbers Used by Built-in Ethernet Port LCPU. . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Appendix 3 Added and Changed Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Appendix 4 Performance List of Simple PLC Communication Function . . . . . . . . . . . . . . . . . . . . . 223
Appendix 5 Specifications Comparison with Ethernet Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
INDEX 231
12
INSTRUCTION INDEX 233
REVISIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
WARRANTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
TRADEMARKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
13

MANUAL PAGE ORGANIZATION

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].
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.
14
Pages describing instructions are organized as shown below.
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
The following illustration is for explanation purpose only, and should not be referred to as an actual documentation.
15
• Instructions can be executed under the following conditions.
Execution condition Any time During on
Symbol No symbol
On the rising
edge
During off
• The following devices can be used.
Link direct
device
J\
Setting
data
Internal device
(system, user)
File
register
Bit Word Bit Word
Applicable
*1
device
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, $
*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.
Intelligent
function module
device
U\G
Index
register
Zn
Constant *3Others
• The following data types can be used.
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
On the falling
edge
*3
P, I, J , U, D,
X, DY, N,
BL, TR, BL\S, V
16

TERMS

Unless otherwise specified, this manual uses the following terms.
Ter m Description
Branch module The abbreviation for the MELSEC-L series branch module
Built-in Ethernet port LCPU
CPU module The 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 The abbreviation for the MELSEC-L series extension cable
Extension module The abbreviation for the MELSEC-L series extension module
External device
FTP The abbreviation for File Transfer Protocol, which is a standard network protocol used to exchange files
GX Works2
GX Developer
LCPU Another term for the MELSEC-L series CPU module
MC protocol
Power supply module The abbreviation for the MELSEC-L series power supply module
Programming tool A generic term for GX Works2 and GX Developer
SD memory card
SNTP
A generic term for the L02CPU, L02CPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P, L26CPU-BT, and L26CPU-PBT
A GOT, measuring instrument, ID module, bar code reader, adjuster, and other CPU modules connected with a CPU module for the data communication
The product name of the software package for the MELSEC programmable controllers
The abbreviation for the MELSEC communication protocol, a protocol to access a CPU module from a target device in the Ethernet or serial communication
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.
The 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
(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 easily transferred.
(9) Remote password ( Page 159, CHAPTER 11)
Remote password setting can prevent unauthorized access from the outside and enhance the security of the system.
(10)Simple PLC communication function ( Page 165, CHAPTER 12)
Device data can be communicated between the CPU modules connected with Ethernet cable without programming.
(11)IP packet transfer function ( Page 191, CHAPTER 14)
Communications can be performed with a device which supports the following IP addresses, which have been specified via a CC-Link IE Field Network module, using a protocol such as the FTP or HTTP via a built-in Ethernet port from an Ethernet device such as a personal computer.
• External devices on CC-Link IE Field Network
• External devices on the Ethernet network, which are connected through the built-in Ethernet ports
(12)E-mail send/receive function ( Page 193, CHAPTER 15)
E-mail can be sent and received between the CPU module and electronic devices such as mobile phones and personal computers. In addition, writing an MC protocol command in the message body of incoming mail enables device reading and writing.
1
19

CHAPTER 2 COMMUNICATION SPECIFICATIONS

The following are the communication specifications of the built-in Ethernet port of the CPU module.
Item Specifications
Data transfer speed 100/10Mbps
Communication mode Full-duplex or half-duplex
Transmission method Base band Transmission specifications
Number of connections
Connection
*1
cable
Maximum distance between hub and
node
Maximum
number of
nodes/connection
TCP/IP A total of 16 connections of socket communications, MELSOFT connection,
UDP/IP
10BASE-T
100BASE-TX Ethernet cable of category 5 or higher (STP cable)
*1 Straight cables can be used. When the CPU module is directly connected to GOT with the Ethernet cable, a cross cable
of Category 5e or lower can also be used.
*2 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. *3 Use of STP cables is recommended in an environment with noise. *4 One setting of FTP client or e-mail uses two consecutive connections.
10BASE-T
100BASE-TX
Cascade connection: Up to four
Cascade connection: Up to two
MC protocol, predefined protocol, FTP client, and e-mail
1 connection for FTP server
Ethernet cable of category 3 or higher (STP/UTP cable)
100m
*2
*2
*4
*3
Hubs with 10BASE-T or 100BASE-TX ports*5 can be used. Up to 16 external devices can access one CPU module at the same time.
*5 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 offered 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.
If the destination device of the CPU module does not respond due to power-off or other reasons, Ethernet communication
of the CPU module may delay up to 500ms.
20
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 simultaneous broadcast is available.
Select an appropriate protocol, considering the specifications of the external device and the characteristics of the above protocols.
2
21
CHAPTER 3 CONNECTION WITH PROGRAMMING
Programming
tool
Programming
tool
GOT
Hub
Ethernet
CPU module CPU module
Start
Setting parameters
Writing to the CPU module
Connecting cables and external devices
Setting the connection target
End
TOOL AND GOT
This chapter describes how to connect the CPU module to a programming tool or GOT.
To start Ethernet communication, perform the following steps.
For the GOT setting, refer to the following.
Manual for the GOT used
Set PLC parameters using the programming tool.
( Page 23, Section 3.1 (1))
Write the set parameters to the CPU module. Power off and on or reset the CPU module to enable the parameters.
( Page 24, Section 3.1 (2))
Connect cables and devices required for Ethernet communication.
Set a connection target by the programming tool.
( Page 25, Section 3.2)
22
CHAPTER 3 CONNECTION WITH PROGRAMMING TOOL AND GOT
1.
2.
3.1 Setting Required 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]
3
1. Set the IP address of the CPU module.
2. Set MELSOFT connection.
Project window [Parameter] [PLC Parameter] [Built-in Ethernet Port Setting] [Ethernet Conf.] or [Open Setting] button
• For the "Ethernet Conf.", drag and drop the "MELSOFT Connection Module" from "Module List" to the left side on the window. Select a protocol from "Protocol" depending on the target device.
• For the "Open Setting"
Item Setting
Protocol Select "TCP" or "UDP" depending on the connected device.
Open System Select "MELSOFT Connection".

3.1 Setting Required for the CPU Module

23
(2) Writing parameters to the CPU module
From the "Write to PLC" window, write the parameters 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.
24
CHAPTER 3 CONNECTION WITH PROGRAMMING TOOL AND GOT
3.2 Setting Required for the Programming Tool
Configure the settings in the "Transfer Setup" window.
Connection Destination window [Connection1]
3
2.
3.
1.
1. Select "Ethernet Board" for "PC side I/F".
In the "PC side IF Ethernet Board Setting" window, select a "TCP" or "UDP" protocol. Select the same
protocol as the one set in the "Ethernet Conf." or "Open Setting" window. ( Page 23, Section 3.1)

3.2 Setting Required for the Programming Tool

25
2. 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" window, as shown below. (For the host name, enter the name set in the Microsoft hosts file.)
3. Set "Other Station Setting".
Select an item appropriate to the operating environment.
Windows
26
CHAPTER 3 CONNECTION WITH PROGRAMMING TOOL AND GOT
Clicking this button will automatically enter the IP address of the CPU module.
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" window will start searching for CPU modules connected to the hub where the programming tool is also connected, and display a list of them.
3
• 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)" window, or the service processing time value in the Service processing setting tab of PLC parameter.
• By selecting the item shown below in the "Built-in Ethernet Port Setting" tab of PLC parameter, the Find CPU function can be disabled and the system does not respond to a search request on the network.

3.3 Searching CPU Modules on the Network

27

3.4 Communication via Routers

Corporate
LAN
Router
Factory
Control room
Personal computer
CPU module
From the built-in Ethernet port, access is available via routers on a network such as a corporate LAN.
*1 The following functions do not support the communication via routers.
Searching CPU modules on the network Simultaneous broadcast in socket communication
For access via a router, follow the instruction ( in the step 1 on Page 23, Section 3.1) to set the subnet mask pattern and the default router IP address in addition to the IP address.
Project window [Parameter] [PLC Parameter] [Built-in Ethernet Port Setting]
*1
Set the subnet mask pattern and default router IP address.
28
Loading...
+ 212 hidden pages