Mitsubishi MELSEC L Series User Manual

Cpu module, built-in ethernet function
Hide thumbs Also See for MELSEC L Series:
Table of Contents

Advertisement

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi MELSEC L Series

  • Page 3: Safety Precautions

    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"...
  • Page 4 [Design Precautions] WARNING (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.
  • Page 5 [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. ●...
  • Page 6 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.
  • Page 7 [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.
  • Page 8 [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...
  • Page 9: Conditions Of Use For The Product

    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.
  • Page 10: Introduction

    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.
  • Page 11: Relevant Manuals

    RELEVANT MANUALS (1) CPU module user's manual Manual name Description <manual number (model code)> MELSEC-L CPU Module User's Manual Specifications of the CPU modules, power supply modules, display unit, (Hardware Design, Maintenance and Inspection) SD memory cards, and batteries, information on how to establish a <SH-080890ENG, 13JZ36>...
  • Page 12: Table Of Contents

    CONTENTS CONTENTS SAFETY PRECAUTIONS ............. 1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 13 CHAPTER 7 TIME SETTING FUNCTION ( SNTP CLIENT) Setting Method ............. Precautions.
  • Page 14: Manual Page Organization

    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.
  • Page 15 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 Setting side Descriptions of...
  • Page 16 • Instructions can be executed under the following conditions. On the falling On the falling Execution condition Any time During on During off edge edge Symbol No symbol • The following devices can be used. Internal device Link direct device Intelligent Index Setting...
  • Page 17: Terms

    TERMS Unless otherwise specified, this manual uses the following terms. Term Description CPU module Abbreviation for the MELSEC-L series CPU module Power supply module Abbreviation for the MELSEC-L series power supply 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 Secure Digital Memory Card, which is a flash memory device.
  • Page 18: Chapter 1 Overview

    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.
  • Page 19 CHAPTER 1 OVERVIEW Memo...
  • Page 20: Chapter 2 Communication Specifications

    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...
  • Page 21 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. •...
  • Page 22: Chapter 3 Connection Of Programming Tools And Got

    Connect cables and devices required for Ethernet Connecting cables and external devices communication. Set a connection target by the programming tool. Setting the connection target Page 23, Section 3.2 For the GOT setting, refer to the following manual. GOT1000 Series Connection Manual (Mitsubishi Products)
  • Page 23: Setting For The Cpu Module

    CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT 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] Set the IP address of the CPU module. Set MELSOFT connection.
  • Page 24 (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.
  • Page 25: Setting For The Programming Tool

    CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT Setting for the Programming Tool Configure the settings in the "Transfer Setup" dialog box. Connection Destination window [Connection1] Select "Ethernet Board" for "PC side I/F". In the "PC side IF Ethernet Board Setting" dialog box, select a "TCP" or "UDP" protocol. ( Page 21, Section 3.1 Select the same protocol as the one set in the Open Setting dialog box.) Select "PLC Module"...
  • Page 26: Searching Cpu Modules On The Network

    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.
  • Page 27: Communication Via Routers

    CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT Communication via Routers From the built-in Ethernet port, access is available via routers on a network such as a corporate LAN. Router Personal computer Corporate LAN Factory Control room The following functions do not support the communication via routers. •...
  • Page 28: Precautions

    Precautions (1) 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.
  • Page 29 CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT (5) 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. (6) 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.
  • Page 30: Chapter 4 Direct Connection To Programming Tool

    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...
  • Page 31: Setting Method

    CHAPTER 4 DIRECT CONNECTION TO PROGRAMMING TOOL (SIMPLE CONNECTION) Setting Method Set the items on the Transfer Setup screen. Connection Destination window [Connection1] Select "Ethernet Board" for "PC side I/F". Select "PLC Module" for "PLC side I/F". In the "PLC side IF Detailed Setting of PLC Module" dialog box, select the Ethernet Port Direct Connection checkbox as shown below.
  • Page 32: Precautions

    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 •...
  • Page 33: Chapter 5 Mc Protocol Communication

    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.
  • Page 34: Setting Method

    Setting Method Setting for communication using the MC protocol is described below. Project window [Parameter] [PLC Parameter] [Built-in Ethernet Port Setting] 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.
  • Page 35: Mc Protocol Commands

    CHAPTER 5 MC PROTOCOL COMMUNICATION 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 Number of Function (Subcomm Description processed points STOP Write Write and)*1...
  • Page 36: Available Devices

    5.2.2 Available devices lists the devices available in the commands used for MC protocol communication. The following table Classification Device Device number range(Default) Remarks Input 000000 001FFF Hexadecimal Output 000000 001FFF Hexadecimal Internal relay 000000 008191 Decimal Latch relay Decimal 000000 008191 Annunciator...
  • Page 37: Precautions

    CHAPTER 5 MC PROTOCOL COMMUNICATION 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.
  • Page 38 (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 Is TCP connection open? Received data within the time specified by the monitoring timer value? Check the received data size.
  • Page 39: Error Codes For Mc Protocol Communication

    CHAPTER 5 MC PROTOCOL COMMUNICATION 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 Corrective action...
  • Page 40: Chapter 6 Socket Communication Function

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION (1) Socket communication functions 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 * Connection No.1 Program Connection No.2 SP.SOCRCV instruction...
  • Page 41 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (2) 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.
  • Page 42: Communication Using Tcp

    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 •...
  • Page 43 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (2) Program example for Active open The following shows a communication flow of an Active open. Start Specify the port number of the external device waiting for TCP connection and open a connection by Active open. Open processing: SP.SOCOPEN instruction YES (Completed, or disconnected by the external device.)
  • Page 44 (b) Devices used in the program The following table lists the device numbers and applications used in the sample program. Device number Application M1000 Open direction D100 to D109 SP.SOCOPEN instruction control data M100 and M101 SP.SOCOPEN instruction completion device M1002 Normal open indication M1003...
  • Page 45 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (c) Sample program <<Fixed length mode setting>> Setting TCP receive mode to 1 Setting receive data size to 6 Changing TCP receive mode of Connection No.1 <<Connection No.1 open processing (Active)>> Setting Execution/completion type to 0 Connection No.1 open Normal completion Error completion...
  • Page 46 (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> TCP disconnection completed upon Open completion signal response from the external device...
  • Page 47 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (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. Send or receive? Send by the SP.SOCSND instruction, or receive by the SP.SOCRCV or S.SOCRCVS instruction.
  • Page 48 (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 12 , and BC...
  • Page 49 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (c) Sample program <<Fixed length mode setting>> Setting TCP receive mode to 1 Setting receive data size to 6 Changing TCP receive mode of Connection 1 <<Target checking>> Obtaining information of connected device <<Data sending>> Setting send data length Setting send data Sending data to Connection No.1...
  • Page 50 (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...
  • Page 51: Communication Using Udp

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION 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 •...
  • Page 52 (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 12 , 34...
  • Page 53 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (c) Sample program <<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>>...
  • Page 54 (2) Simultaneous broadcast For simultaneous broadcast using UDP, set the parameters as follows. • Destination IP Address: FF.FF.FF.FF • Destination Port No.: FFFF CPU module (IP address: xx.xx.xx.xx, Subnet mask: 255.255.255.0) Ethernet Sending data from port No.A of the CPU Port No.A module to each port No.N of all external External device 1...
  • Page 55 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (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.
  • Page 56 (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. IP address of the CPU module side 168.
  • Page 57: Precautions For The Socket Communication Function

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION Precautions for the Socket Communication Function This section provides other precautions for the socket communication function. (1) Port number Because port numbers 0001 to 03FF are assigned to the host station for use of major protocols (WELL KNOWN PORT NUMBERS), it is recommended to use port numbers 0400 to 1387 or 1392...
  • Page 58 (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.
  • Page 59: Socket Communication Function Instructions

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION 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 Description Reference...
  • Page 60: Establishing A Connection (Sp.socopen)

    6.4.1 Establishing a connection (SP.SOCOPEN) Command SP.SOCOPEN SP.SOCOPEN Internal device Setting Constant R, ZR U \G Others data K, H Word Word File registers set for each local device or program cannot be used. (1) Setting data Setting data Description Data type Set by Dummy...
  • Page 61 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (2) Control data Device Item Description Setting range Set by Specify which settings are used to open a connection, parameter settings configured by a programming tool or control data settings Execution/ 0000 User 0000 completion type 8000 Connection is opened according to the settings set in "Open settings"...
  • Page 62 (3) Function This instruction opens a connection specified in The set values used for the open processing is selected in The result of the SP.SOCOPEN instruction can be checked with the completion device, +0 and • Completion device Turns on in the END processing of the scan after completion of the SP.SOCOPEN instruction, and turns off in the next END processing.
  • Page 63 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (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...
  • Page 64 (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 •...
  • Page 65: Disconnecting A Connection (Sp.socclose)

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6.4.2 Disconnecting a connection (SP.SOCCLOSE) Command SP.SOCCLOSE SP.SOCCLOSE Internal device Setting Constant R, ZR U \G Others data K, H Word Word File registers set for each local device or program cannot be used. (1) Setting data Setting data Description Data type...
  • Page 66 (3) Function This instruction closes a connection specified in . (Disconnection of a connection) The result of the SP.SOCCLOSE instruction can be checked with the completion device, +0 and • Completion device Turns on in the END processing of a scan after completion of the SP.SOCCLOSE instruction, and turns off in the next END processing.
  • Page 67 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (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...
  • Page 68: Reading Out Received Data In The End Processing (Sp.socrcv)

    6.4.3 Reading out received data in the END processing (SP.SOCRCV) Command SP.SOCRCV SP.SOCRCV Internal device Setting Constant R, ZR U \G Others data K, H Word Word File registers set for each local device or program cannot be used. (1) Setting data Setting data Description Data type...
  • Page 69 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (3) Function This instruction reads out received data of the connection specified in from the Socket communication receive data area in the END processing after execution of the SP.SOCRCV instruction. CPU module Receive data D1 +0 length Socket communication Receive data...
  • Page 70 (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 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) •...
  • Page 71: Reading Out Received Data During Instruction Execution (S.socrcvs)

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6.4.4 Reading out received data during instruction execution (S.SOCRCVS) Command S.SOCRCVS S.SOCRCVS Internal device Setting Constant R, ZR U \G Others data K, H Word Word (1) Setting data Setting data Description Data type Set by Dummy Character string Connection number (Setting range: 1 to 16)
  • Page 72 (3) Function This instruction reads out received data of the connection specified in from the Socket communication receive data area. CPU module Receive data D +0 length Socket communication Receive data D +1 receive data area Connection Receive data D +2 External device No.
  • Page 73 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (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 •...
  • Page 74: Sending Data (Sp.socsnd)

    6.4.5 Sending data (SP.SOCSND) Command SP.SOCSND SP.SOCSND Internal device Setting Constant R, ZR U \G Others data K, H Word Word File registers set for each local device or program cannot be used. (1) Setting data Setting data Description Data type Set by Dummy Character string...
  • Page 75 CHAPTER 6 SOCKET COMMUNICATION FUNCTION (2) Control data Device Item Description Setting range Set by System area Completion status is stored. Completion 0000 : Completed System status Other than 0000 : Failed (Error code) Send data length The length of send data is specified (in bytes). 1 to 2046 User Send data...
  • Page 76 (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 is other than 1 to 16. (Error code: 4101) • The device numbers specified for , and exceed the device point range.
  • Page 77: Reading Out Connection Information (Sp.soccinf)

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6.4.6 Reading out connection information (SP.SOCCINF) Command SP.SOCCINF SP.SOCCINF Internal device Setting Constant R, ZR U \G Others data K, H Word Word (1) Setting data Setting data Description Data type Set by Dummy Character string Connection number (Setting range: 1 to 16) User BIN 16-bit...
  • Page 78 (2) Control data Device Item Description Setting range Set by System area Completion status is stored. Completion 0000 : Completed status Other than 0000 : Failed (Error code) to FFFFFFFF : No target Target device IP IP address of the target device is stored. (FFFFFFFF address Simultaneous...
  • Page 79 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...
  • Page 80: Changing The Target Of A Connection (Udp/Ip) (Sp.soccset)

    6.4.7 Changing the target of a connection (UDP/IP) (SP.SOCCSET) Command SP.SOCCSET SP.SOCCSET Internal device Setting Constant R, ZR U \G Others data K, H Word Word (1) Setting data Setting data Description Data type Set by Dummy Character string Connection number (Setting range: 1 to 16) User BIN 16-bit Start number of the device from which control data are stored...
  • Page 81 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 (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. ●...
  • Page 82: Changing The Receive Mode Of A Connection (Sp.socrmode)

    6.4.8 Changing the receive mode of a connection (SP.SOCRMODE) Command SP.SOCRMODE SP.SOCRMODE Internal device Setting Constant R, ZR U \G Others data K, H Word Word (1) Setting data Setting data Description Data type Set by Dummy Character string Connection number (Setting range: 1 to 16) User BIN 16-bit Start number of the device from which control data are stored...
  • Page 83 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.
  • Page 84 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.
  • Page 85: Socket Communication Receive Data Read (S(P).Socrdata)

    CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6.4.9 Socket communication receive data read (S(P).SOCRDATA) Command S.SOCRDATA S.SOCRDATA Command SP.SOCRDATA SP.SOCRDATA Internal device Setting Constant R, ZR U \G Others data K, H Word Word (1) Setting data Setting data Description Data type Set by Dummy Character string...
  • Page 86 ● 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.
  • Page 87: Chapter 7 Time Setting Function ( Sntp Client)

    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.
  • Page 88: Setting Method

    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 Setting range SNTP Function Setting Select whether to use this function or not. Used or Not used 0.0.0.1 to SNTP Server IP Address...
  • Page 89: Precautions

    CHAPTER 7 TIME SETTING FUNCTION ( SNTP CLIENT) 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 FFFF (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.
  • Page 90: Chapter 8 File Transfer Function (Ftp)

    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. CPU module (FTP server) Target device (FTP client)
  • Page 91: Setting For Ftp Communication

    CHAPTER 8 FILE TRANSFER FUNCTION (FTP) Setting for FTP Communication (1) Operation on the CPU module side Project window [Parameter] [PLC Parameter] [Built-in Ethernet Port Setting] Set the IP address of the CPU module. Select "Enable online change (FTP, MC Protocol)" when data need to be written even while the CPU module is in RUN state.
  • Page 92 (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>...
  • Page 93 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. Start up the FTP from the MS-DOS prompt of Microsoft Windows .
  • Page 94: Files Transferable Using Ftp

    Files Transferable Using FTP The following table lists the files that can be transferred using the file transfer function. :Available, :N/A × Program Standard SD memory Standard memory File type card File name or extension *2 *3 Drive 0 Drive 3 Drive 4 Drive 2 Parameter...
  • Page 95: Files That Can Be Deleted Using Ftp

    CHAPTER 8 FILE TRANSFER FUNCTION (FTP) Files That Can Be Deleted Using FTP The following table lists the files that can be deleted using the file transfer function. : Deletable, : Not deletable only in RUN state, ×: Not deletable, -: Not writable Program Standard SD memory...
  • Page 96: Ftp Commands

    FTP Commands 8.4.1 List of FTP commands : Available, × : N/A CPU module state Remote password Command Function Unlocked Locked Write Write STOP enabled disabled Notifies the FTP server of file transfer without conversion. × binary Disconnects the line to the FTP server and terminates the session.
  • Page 97 CHAPTER 8 FILE TRANSFER FUNCTION (FTP) The following table lists the subcommands available with the command, "quote". : Available, × : N/A CPU module state Remote password Subcommand Function STOP Unlocked Locked Write Write enabled disabled change × × Displays or changes the CPU module file attribute. password-lock Locks an unlocked remote password.
  • Page 98: How To Specify An Ftp Command

    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: •...
  • Page 99: Details Of Ftp Commands

    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.
  • Page 100 ● [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...
  • Page 101 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.
  • Page 102 ● [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]...
  • Page 103 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"...
  • Page 104 password-lock ● [Function] Locks the remote password set in the CPU module. [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 Use this command only when FTP communication port is specified as a remote password check target. ●...
  • Page 105 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.
  • Page 106 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.
  • Page 107: Precautions

    CHAPTER 8 FILE TRANSFER FUNCTION (FTP) 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. •...
  • Page 108 (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.
  • Page 109: Chapter 9 Remote Password

    CHAPTER 9 REMOTE PASSWORD CHAPTER 9 REMOTE PASSWORD 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.
  • Page 110: Communication Using Remote Password

    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.
  • Page 111: Remote Password Setting

    CHAPTER 9 REMOTE PASSWORD Remote Password Setting (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] [Remote Password] Item Description Setting range Up to four Password Setting Enter a remote password to be set for the CPU module.
  • Page 112 (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.
  • Page 113: Precautions

    CHAPTER 9 REMOTE PASSWORD Precautions (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.) •...
  • Page 114: Detection Of Unauthorized Access And Actions

    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.
  • Page 115: Appendices

    APPENDICES APPENDICES Appendix 1 Operation Processing Time for Each Instruction APPEN The table below indicates the operation processing times required for the instructions introduced in this manual. 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...
  • Page 116 Memo...
  • Page 117: Index

    INDEX ........98 ......40 Active open .
  • Page 118 ........19 ....81 TCP fixed-length receive mode .
  • Page 119: Instruction Index

    INSTRUCTION INDEX ......83 S(P).SOCRDATA ......69 S.SOCRCVS .
  • Page 120: Revisions

    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.
  • Page 121: Warranty

    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.
  • Page 122 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.
  • Page 124 Phone: +380 (0)44 / 490 92 29 Fax: +380 (0)44 / 248 88 68 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...

Table of Contents