FX3U-ENET-L USER'S MANUAL
SAFETY PRECAUTIONS (Read these precautions before use.) Before installation, operation, maintenance or inspection of this product, thoroughly read through and understand this manual and all of the associated manuals. Also, take care to handle the module properly and safely. This manual classifies the safety precautions into two categories: "DANGER" and "CAUTION." DANGER Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
[Design Precautions] CAUTION When the status control (remote RUN/STOP) of the PLC is performed from the external device, select the "Always wait for OPEN" parameter set by an user in advance. (Select with the initial timing setting (BFM#24 b8) in the operational setting.) When "Do not wait for OPEN" is selected, the communication line at remote STOP is closed. The communication line cannot be reopened on the PLC side after that, and the remote RUN from the external device cannot start.
[Wiring Instructions] DANGER Before mounting or wiring the module, make sure to shut off all of the external power supply. Failure to do so may cause electric shocks or damage the module. When turning on the power and operating after mounting or wiring the module, make sure to install the accessory terminal covers to the product. Otherwise, it may cause electric shocks. CAUTION Make sure to place the communication cables and the power cables in a duct or fasten them using a clamp.
[Setup and Maintenance Precautions] DANGER Do not touch any terminal while the PLC's power is on. Doing so may cause electric shock or malfunctions. Before cleaning or retightening terminal screws and module mounting screws, externally cut off all phases of the power supply. Failure to do so may cause electric shock, fire, malfunctions and product damage.
CONTENTS SAFETY PRECAUTIONS .....................................................................................................................A- 1 CONTENTS ..........................................................................................................................................A- 5 About Manuals ......................................................................................................................................A- 9 Associated Manuals.......................................
5 COMMUNICATION PROCEDURE 5- 1 to 5-46 5.1 Overview of the Communication Procedure .................................................................................. 5- 1 5.2 Initial Processing............................................................................................................................ 5- 3 5.2.1 Initial processing ...................................................................................................................... 5- 3 5.2.2 Initial settings ...............
8 COMMUNICATION USING MC PROTOCOL 8- 1 to 8- 5 8.1 Data Communication Function....................................................................................................... 88.1.1 Accessing the PLC using MC protocol..................................................................................... 88.1.2 How to Read the Control Procedures of the MC Protocol ....................................................... 88.1.3 Access Timing on the PLC Side ..............................................
11 TROUBLESHOOTING 11- 1 to 11-42 11.1 How to Check Errors Using LED Displays ................................................................................. 11- 2 11.1.1 Checking error display ......................................................................................................... 11- 2 11.1.2 How to turn off COM.ERR LED and to read/clear error information .................................... 11- 4 11.2 How to Check an Error Through FX Configurator-EN-L ................................
About Manuals This manual explains the mounting of FX3U-ENET-L, the specifications, broadcast functions and communication methods. For the instructions and programs of the sequence as well as the parameter settings by FX Configurator-EN-L, also refer to the following manuals. Associated Manuals Manual name Manual No.
Applicable Standard Certification of UL, cUL standards The following product has UL and cUL certification. UL, cUL File Number: E95239 Models: MELSEC FX3U series manufactured FX3U-ENET-L Regarding the standards that comply with the main unit, please refer to either the FX series product catalog or consult with your nearest Mitsubishi product provider.
Caution to conform with EC Directives • Installation in Enclosure Programmable logic controllers are open-type devices that must be installed and used within conductive control cabinets. Please use the programmable logic controller while installed within a conductive shielded control cabinet. Please secure the cabinet door to the control cabinet (for conduction). Installation within a control cabinet greatly affects the safety of the system and aids in shielding noise from the programmable logic controller.
The Manual's Usage and Structure How to use this manual In this manual, explanations are given for each application of the Ethernet modules (FX3U-ENET-L). Please use this manual using the following key items below as a reference. (1) Features and utility lists (a) Features and functions • Chapter 1 describes the features of the Ethernet modules. • Chapter 3 describes the common functions and specifications of the Ethernet modules.
(3) Connection between the Ethernet module and external devices (a) Communication procedures • Section 5.1 describes an outline of the communication procedures (b) Connections with the external devices • Section 5.6 describes the connections (open and close processing) for each communication method (TCP/IP) and the open method (Active, Passive), including programming procedures. (4) Details on the data communication functions (a) Communication functions • Section 1.
About the Generic Terms and Abbreviations This manual uses the following generic terms and abbreviations to describe the Model FX3U-ENET-L Ethernet interface block. Generic Term/Abbreviation Description Ethernet Address A machine-specific address that is also referred to as the MAC (Media Access Control Address). This is used to identify the addresses of external devices over a network. The Ethernet address of the Ethernet module can be verified on BFM.
1 OVERVIEW MELSEC-F 1 OVERVIEW This manual provides information on the specifications of the Ethernet interface block, FX3U-ENET-L (hereinafter called FX3U-ENET-L or the Ethernet module), as well as the procedures before starting operation, the control procedures and data communication method for communicating with external devices, maintenance, inspection, and troubleshooting.
1 OVERVIEW MELSEC-F 1) Collection and modification of PLC data (Communication using the MELSEC Communication Protocol (referred to below as the MC Protocol)) 2) Transmission and reception of arbitrary data to/from external devices (Communication using fixed buffers) 3) Data transmission by e-mail (When using the e-mail function) 1 POINT The module operation is not guaranteed if any of the following connection is used. Check the module operation on the user side.
1 OVERVIEW MELSEC-F 1.2 Features of the Ethernet Module (1) Data communication using MC protocol (Details are explained in Chapter 8 and Chapter 9) Response Command Using MC protocol, the device data of the PLC can be read from/written to the host system. This protocol is a passive protocol that communicates data solely according to the requests from the host system. It does not require a sequence program for data communication after a connection is established.
1 OVERVIEW MELSEC-F (3) Sending by e-mail (Details are explained in Chapter 10) In "E-mail send", data can be sent to and from an external device at a remote location using e-mails via an internet connection. (a) Sending e-mail from the PLC The following data can be sent by e-mail. 1) Sending data as attached files Up to 2k words of data can be sent to from a personal computer or other Ethernet module with mail function as a file attached to an e-mail.
1 OVERVIEW MELSEC-F (4) Connecting FX Configurator-EN-L (Details are explained in the Operating Manuals for FX Configurator-EN-L) (a) Simplifying sequence programs using FX Configurator-EN-L FX Configurator-EN-L supports the parameter setting function to perform the Ethernet module initialization and the open processing with external devices. By setting up the following parameters with FX Configurator-EN-L, access is enabled from the external device to the PLC.
1 OVERVIEW MELSEC-F (b) Connecting multiple MELSOFT products (GX Developer, MX Component) This product can be connected with one or more MELSOFT product, via TCP/IP communication (through the in-house LAN, etc.) or UDP/IP communication (through the in-house LAN, etc.). 1) Connection via TCP/IP communication • If a MELSOFT product is to be connected with the FX ConfiguratorEN-L open settings, a maximum of two units can be connected with MELSOFT product.
1 OVERVIEW MELSEC-F 1.3 Software Configuration The Ethernet modules support the TCP/IP and UDP/IP protocols.
1 OVERVIEW MELSEC-F (2) UDP (User Datagram Protocol) This protocol may not guarantee data credibility or reliability in communication between a personal computer/work station and PLC that are connected via network. Thus, even if the data does not reach the target node, it will not be retransmitted. • Because it is connectionless, communication efficiency is much improved than TCP/IP. • A check sum is used to increase the reliability of the communication data.
1 OVERVIEW MELSEC-F 3) 4) 5) 6) 1-9 PSH (Push Flag) When this bit is ON (1), the host that has received this segment sends the data to the upper application with high priority. This bit is to be turned ON when the data should be sent to an external device as soon as possible. When this bit is OFF (0), the timing when the received data is sent to the upper application depends on the TCP layer of the receiving side.
2 SYSTEM CONFIGURATIONS MELSEC-F 2 SYSTEM CONFIGURATIONS This section explains the system configurations that may be combined with the Ethernet modules. 2 2.1 Applicable Systems Ethernet modules can be used with the following systems: (1) Applicable PLC and number of modules that can be mounted The following table lists the PLC where the Ethernet module can be mounted and the number of modules that can be mounted.
2 SYSTEM CONFIGURATIONS MELSEC-F 2.2 Devices Required for Network Configuration This section explains the devices that are required to configure a network. Network installation work requires sufficient safeguard; ask a network specialist for installation. When connecting FX3U-ENET-L to a network, either a 10BASE-T or 100BASETX can be used. The Ethernet module detects whether it is 10BASE-T or 100BASE-TX, and the full-duplex or half-duplex transmission mode according to the hub.
2 SYSTEM CONFIGURATIONS MELSEC-F (2) Connection using the 10BASE-T Hub Twisted pair cable * Up to 4 levels are allowed for cascade connection External device Ethernet module Use devices that satisfy the standards of IEEE802.3 and 10BASE-T. • Shielded twisted pair cable (STP cable), category 3 (4, 5) * Straight cables can be used. (Correct operation is not guaranteed if a crossed cable is used to connect to an external device via the 10BASE-T of the Ethernet module.
3 SPECIFICATIONS MELSEC-F 3 SPECIFICATIONS This section explains the Ethernet module performance specifications and transmission specifications. For the general specifications, refer to the packaged manual and the User’s Manual of the PLC main unit. 3.1 Performance Specifications The following explains the performance specifications of the Ethernet module.
3 SPECIFICATIONS MELSEC-F Item Data size Specification Attached file 2048 words 1 Main text 256 words 1 Data transfer method When sending: Sends either a file as attachment or main text (select one). Subject US-ASCII format or ISO-2022-JP (Base64) Attached file format MIME format MIME Version 1.0 Binary/ASCII/CSV can be selected. File name: XXXX.bin (binary), XXXX.asc (ASCII), XXXX.
3 SPECIFICATIONS MELSEC-F 3.2 Data Codes for Communication This section explains the data codes used in the communication between the Ethernet module and the external device or the PLC. (1) The data codes used while communicating are listed below. 1) Ethernet module External device Data can be communicated by selecting either binary code or ASCII code in the data code setting of FX Configurator-EN-L or the PLC, as shown below. For more details about binary code/ASCII code changeover, refer to Section 4.
3 SPECIFICATIONS MELSEC-F 2) Ethernet module PLC Data is sent and received in binary code. Ethernet module Binary code Binary code PLC Communication data storage area External device BIN/ASCII conversion ASCII code (2) When communicating using ASCII code, 1-byte binary code data is automatically converted into 2-byte ASCII code data and then transmitted.
3 SPECIFICATIONS MELSEC-F 3.3 Relationship between the External Devices and Additional Functions for Each Communication Function This section explains which external devices data communication can be performed with and which additional functions can be used for each function. (1) Communicability with external devices using various functions The following table lists the communicability with external devices using various functions.
3 SPECIFICATIONS MELSEC-F 3.4 Ethernet Module Function List This section shows a list of Ethernet module functions. (1) Basic functions of the Ethernet module The Ethernet module can perform the communications shown in the table below via TCP/IP or UDP/IP communication. Function Communication using MC protocol Description Reference section Subset of A compatible 1E Reads/writes PLC data from/to an external device.
3 SPECIFICATIONS MELSEC-F 3.5 List of Setting Items for Ethernet Modules The following table lists the parameter setting items that are set using Ethernet Module. Function and parameter setting Parameter setting item requirement (*1) Description of setting MC Fixed Mail MELSOFT Reference section Ethernet module settings Settings for using the Ethernet module as a network module. Section 4.5 Operational settings Set the common items between the modules.
3 SPECIFICATIONS MELSEC-F 3.6 List of Applications and Assignments of the Buffer Memory Data transmission/reception between Ethernet Module and PLC is performed via the Ethernet Module buffer memory (hereinafter called BFM). Reading/writing data in the buffer memory from the PLC must be performed by the FROM/TO instructions (instructions that can access BFM). In addition, the initial value of the buffer memory or the internally stored value is written when the power is turned on.
3 SPECIFICATIONS MELSEC-F (2) Assignments of the buffer memory A buffer memory consists of 16 bits per address. b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 The following shows the buffer memory addresses. (a) Initial processing parameter (BFM #0 to 31) BFM number Decimal (Hexadecimal) 0 to 1 (0 to 1H) 2 (2H) Attribute * 1 Name Initial value Decimal (Hexadecimal) Local station Ethernet module IP address (Initial value 192.168.1.
3 SPECIFICATIONS MELSEC-F (Continued from the previous page) BFM number Attribute Decimal (Hexadecimal) Application Name Initial value Decimal (Hexadecimal) Flash ROM save Reference section Flash ROM writing control 0000H: Normal status 25 (19H) Flash ROM writing control area R/W Flash ROM control 9872H: Write command for configuration data to a flash ROM.
3 SPECIFICATIONS MELSEC-F (b) Communication parameter setting area (BFM #32 to 102) BFM number Attribute Decimal (Hexadecimal) 32 (20H) 33 (21H) Application R/W Communication parameters setting area Initial value Flash Decimal ROM (Hexadecimal) save Name Connection usage setting area Connection No.
3 SPECIFICATIONS MELSEC-F (Continued from the previous page) BFM number Attribute Decimal (Hexadecimal) 40 (28H) R/W 41 to 42 (29 to 2AH) R/W 43 (2BH) R/W 44 to 46 (2C to 2EH) R/W 47 to 53 (2F to 35H) R/W 54 to 60 (36 to 3CH) Application Connection No. 1 Communication parameters setting area Initial value Decimal (Hexadecimal) Name Communication address setting area 0 (0H) Section 5.5 Destination IP address 0 (0H) Section 5.5 Destination Port No. 0 (0H) Section 5.
3 SPECIFICATIONS MELSEC-F (c) Communication status storage area (BFM #103 to 226) BFM number Attribute Decimal (Hexadecimal) Application Initial value Flash ROM Decimal save (Hexadecimal) Name Reference section 103 to 104 (67 to 68H) — 105 (69H) R 106 to 107 (6A to 6BH) R 108 to 110 (6C to 6EH) R 111 to 119 (6F to 77H) — 120 (78H) R Local station Port No. 0 (10H) — 121 to 122 (79 to 7AH) R Destination IP address 0 (0H) — 123 (7BH) R Destination Port No.
3 SPECIFICATIONS MELSEC-F (Continued from the previous page) BFM number Attribute Decimal (Hexadecimal) 200 (C8H) 201 (C9H) Application Name Initial value Flash ROM Decimal save (Hexadecimal) Stores Ethernet module status (The same specification as BFM#28 "Module status area") R 0*1 (0H) Hub connection status area • Communication mode (b9) 0: Half duplex 1: Full duplex • Hub connection status (b10) 0: Hub not connected/disconnected 1: Hub connected • Data transmission speed (b14) 0: Operating at
3 SPECIFICATIONS MELSEC-F (d) Error log partition area (BFM #227 to 511) BFM number Decimal (Hexadecimal) Attribute Application Name Initial value Decimal (Hexadecimal) Flash ROM save 227 (E3H) R Number of error occurrences 228 (E4H) R Error log write pointer 229 (E5H) R Error code/end code 230 (E6H) R Subheader 231 (E7H) R Command code 232 (E8H) R 233 (E9H) R 234 to 235 (EA to EBH) R Destination IP address 236 (ECH) R Destination Port No.
3 SPECIFICATIONS MELSEC-F (Continued from the previous page) BFM number Decimal (Hexadecimal) Attribute Application Name 376 to 377 (178 to 179H) R Received IP packet count 378 to 379 (17A to 17BH) R Received IP packet count discarded due to sum check error 380 to 381 (17C to 17DH) R Sent IP packet total count 382 to 397 (17E to 18DH) — 398 to 399 (18E to 18FH) R Simultaneous transmission error detection count (Receiving descripter deletion count) 400 to 407 (190 to 197H) — System are
3 SPECIFICATIONS MELSEC-F (e) Router relay parameter setting area (BFM #512 to 1599) BFM number Decimal (Hexadecimal) Attribute 512 to 513 (200 to 201H) R/W 514 to 515 (202 to 203H) R/W 516 to 1599 (204 to 63FH) — 3 - 17 Application Name Initial value Decimal (Hexadecimal) Sub-net mask Router relay parameter setting area 0 (0H) Default router IP address System area Flash ROM save — Reference section Section 5.
3 SPECIFICATIONS MELSEC-F (f) Open/close control (BFM #1600 to 1663) BFM number Decimal (Hexadecimal) Attribute Application Name Initial value Decimal (Hexadecimal) Flash ROM save Reference section Reinitialization • Write value Re-initialization request 0001H : Re-initialization ([COM.ERR.] LED OFF) 0002H : Re-initialization after reading data in Flash ROM ([COM.ERR.] LED OFF) 0005H : Re-initialization ([COM.ERR.] LED retains status.
3 SPECIFICATIONS MELSEC-F (Continued from the previous page) BFM number Decimal (Hexadecimal) Attribute Application Fixed buffer communication 1610 (64AH) Initial value Decimal (Hexadecimal) Name R/W When sending request or reception complete confirmation signal of connection No.
3 SPECIFICATIONS MELSEC-F (g) Fixed buffer area (BFM #1664 to 9855) BFM number Decimal (Hexadecimal) Attribute 1664 (680H) R/W 1665 to 2687 (681 to A7FH) R/W 2688 (A80H) R/W 2689 to 3711 (A81 to E7FH) R/W 3712 to 9855 (E80 to 267FH) — 3 - 20 Application Name Fixed buffer No. 1 Fixed buffer data area Fixed buffer No.
3 SPECIFICATIONS MELSEC-F (h) Mail send parameter settings (BFM #9856 to 20479) BFM number Decimal (Hexadecimal) Attribute Application Name 9856 to 9887 (2680 to 269FH) R/W 9888 to 9912 (26A0 to 26B8H) — 9913 to 9920 (26B9 to 26C0 H) R/W Password to the POP3 server (16 characters) 9921 (26C1 H) R/W Method for designating SMTP server 0: Domain name designation 1: IP address designation (Decimal) 2: IP address designation (Hexadecimal) 9922 to 9953 (26C2 to 26E1 H) R/W 9954 (26E2 H) R/W 9
3 SPECIFICATIONS MELSEC-F (Continued from the previous page) BFM number Decimal (Hexadecimal) Attribute Application Initial value Flash ROM Decimal save (Hexadecimal) Name Reference section R/W Mail sending command • Write value Mail sending instruction (0001H) • Read value Returns to "0000H" when mail sending commences Multiple requesting exists.
3 SPECIFICATIONS MELSEC-F (i) Connection status storage area (BFM #20480 to 22639) BFM number Decimal (Hexadecimal) Attribute 20480 (5000H) R 20481 (5001H) — Application R 20483 to 20484 (5003 to 5004H) — Initial value Flash ROM Decimal save (Hexadecimal) Open complete signal 0: Open incomplete 1: Open completed • Connection No. 1 (b0) • Connection No. 2 (b1) • Connection No. 3 (b2) • Connection No.
3 SPECIFICATIONS MELSEC-F (j) E-mail status storage area (BFM #22640 to 31999) BFM number Decimal (Hexadecimal) Attribute Application Initial value Flash ROM Decimal save (Hexadecimal) Name 22640 to 23354 (5870 to 5B3AH) — System area 23355 (5B3BH) R Number of mails normally completed 23356 (5B3CH) R Attached files sent count 23357 (5B3DH) R Sent to the SMTP server count 23358 (5B3EH) R Number of mails abnormally completed 23359 (5B3FH) R Error log write count 23360 (5B40H) R Er
3 SPECIFICATIONS MELSEC-F (Continued from the previous page) BFM number Decimal (Hexadecimal) 24320 (5F00H) Attribute Application Name Initial value Flash ROM Decimal save (Hexadecimal) Reference section 25 (19H) Section 10.6 0 (0H) Section 10.6 R/W SMTP server port number 24321 (5F01H) R/W SMTP authentication setting 0: No authentication 1: SMTP-AUTH 2: POP before SMTP Any other value is handled as "0".
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4 SETTINGS AND PROCEDURES PRIOR TO OPERATION This chapter explains the settings and procedures required prior to operating the Ethernet module in a system. 4.1 Loading and Installation This section explains precautions for Ethernet module handling from unpacking to installation, as well as the installation environment common to all modules.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F Be careful not to let any foreign matter such as wire chips get inside the module. They may cause fire, as well as breakdowns and malfunctions of the module. CAUTION Never disassemble or modify the module. This may cause breakdowns, malfunctions, injuries or fire. When attaching or removing the base module and all expansion module special blocks, make sure to cut all external power supplies.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.2 Settings and Procedures Prior to Starting the Operation The following shows a flow of the procedure that is required prior to operating: Procedures prior to operation Connect the Ethernet module to the base module and wire the 24VDC power supply. Connect the Ethernet module to the Ethernet network. See Section 4.4, "Connecting to the Network." Setting the Ethernet module network parameters . See Section 4.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F Important (1) Do not write any data in the "System area" of Ethernet module buffer memory. (2) When status control (such as remote RUN/STOP) from a external device is used for the PLC, the user should select "Always wait for OPEN" beforehand using the setting parameters. (Select using initial timing in the operation settings.) If "Do not wait for OPEN" is selected, the communication line will be closed during remote STOP.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.3 Components of the Ethernet Module This section shows the components of the Ethernet module. 4) 1) 3) 2) View with the cover removed Name 4-5 Description 1) LED display Refer to the contents of the LED displays (1). 2) 10BASE-T/100BASE-TX connector (RJ45) Connector for connecting the Ethernet module to the 10BASE-T/100BASE-TX. (Ethernet module chooses between 10BASE-T and 100BASE-TX according to the hub.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F (1) LED display contents (*1) LED name Display description When the LED is on When the LED is off RUN Normal operation display Normal (when FROM/TO instruction can be executed from PLC side) Abnormal (when WDT is in operation) INIT.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.4 Connecting to the Network The following explains how to connect the Ethernet module to the 100BASE-TX/ 10BASE-T networks. Some precautions that should be observed while connecting the Ethernet module are also shown below. Pay close attention to safety and use the Ethernet module properly. (1) Sufficient network knowledge and safety precautions are required when installing 100BASE-TX or 10BASE-T networks.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.4.1 Connecting to the 10BASE-T/100BASE-TX network This section explains how to connect the Ethernet module to the 10BASE-T, 100BASE-TX network. The following shows the connection diagram for the twisted paid cable. RJ45 type modular shielded twisted-pair cable (Category 3, 5, 5e) RJ45 type modular jack (Step 1) Connect the twisted-pair cable to the hub. (Step 2) Connect the twisted-pair cable to the Ethernet module.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.5 Ethernet Module Setting Setting the Ethernet module as a network module. The settings found must always be set in order to use the Ethernet module. (1) "Operational settings" (Details are explained in Section 4.6) This is for setting common items for when other modules use the Ethernet module. This settings must always be set, since they are required for the Ethernet initial processing. (2) "Initial settings" (Details are explained in Section 5.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.6 Operational Settings This section explains how to set the operations parameters. BFM number [Decimal] (bit number) Setting name Setting description Setting range/selection Communication data code 24 (b1) Select the communication data code.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F (2) TCP Existence confirmation setting (BFM #24 b4) Select the existence check method for TCP communication. For the existence check function, refer to Subsection 5.2.2. Name of setting Description of setting Use the KeepAlive Checks connection status with KeepAlive. Use the Ping Checks connection status with Ping. POINT (1) "Operational settings" parameters must always be set.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F (4) Initial Timing (BFM#24 b8) (a) Select the timing to open connections for which TCP-Passive open or UDP open are selected with the "Open settings" parameter (*1). *1 For more details on the open settings, see Section 5.5 "Open Settings". Name of setting Do not wait for OPEN (Communication impossible after STOP) Always wait for OPEN (Communication possible after STOP) Description of setting • Execute open/close processing using a sequence program.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F (5) IP Address settings - IP address (BFM #0 to 1) (a) Set the IP address of the local station according to the specified input format (decimal or hexadecimal). It should be set so that the local station Ethernet module and the communicating external device have the same class and sub-net address (two words). [IP address] BFM #1 BFM #0 Values bits 7 to 0 to Values bits 31 to 24 (Example) Program for "192.168.1.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.7 Self-Diagnostic Tests This section explains the self-diagnostic tests for checking the hardware and transmission and reception function of the Ethernet module. 4.7.1 Self loopback test The following explains the self loopback test that is used to check the hardware including the Ethernet module's transmission and reception circuit.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.7.2 Hardware test (H/W Test) This section explains the RAM and ROM tests for the Ethernet module. The procedure for the hardware test is as shown in the table below. The test results are judged from the LED displays on the front of the Ethernet module. Step Status of LED Description of operation [RUN] [C1] [ERR.] 1 Perform a hardware test in operation mode.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.8 Maintenance and Inspection This section explains the maintenance and inspection as well as the installing and uninstalling of the Ethernet module. 4.8.1 Maintenance and inspection The Ethernet module does not need to be inspected for anything particular other than checking whether or not the connections of cables and the terminal screws are loose.
4 SETTINGS AND PROCEDURES PRIOR TO OPERATION MELSEC-F 4.8.2 Installing and uninstalling the module Before installing or uninstalling the Ethernet module, make sure to read Section 4.1, "Handling Precautions" thoroughly, ensure the safety of the installation, and handle the module properly according to the instructions. The following explains the procedures when installing/uninstalling the Ethernet module.
5 COMMUNICATION PROCEDURE MELSEC-F 5 COMMUNICATION PROCEDURE This chapter gives an overview of the communication procedure using the Ethernet module, as well as the required initial processing of the Ethernet prior to data communication and the open processing for communication with an external device. The sequence program can be effectively simplified by setting the parameters of the Ethernet module supported by FX Configurator-EN-L. 5.
5 COMMUNICATION PROCEDURE MELSEC-F NOTE The following communication can be performed with an open device on other end. • Communication using MC protocol • Sending/receiving in fixed buffer communication (procedure exists) When receiving communication request data from an external device PLC Ethernet module (Subheader code) 60 H Request from an external device (receive) Header Response to the request (send) 80 to 85 H 93 to 96 H Header Ethernet Data 00 to 05 H 13 to 16 H IP Device memory, etc.
5 COMMUNICATION PROCEDURE MELSEC-F 5.2 Initial Processing This section explains the initial processing of the Ethernet module. 5.2.1 Initial processing The initial processing enables data communication with an external device by setting the parameters required for data communication via the Ethernet module. Set the following parameters in the sequence program, write them to the Ethernet module; the initial processing of the Ethernet module is then performed by one of the following methods.
5 COMMUNICATION PROCEDURE MELSEC-F 5.2.2 Initial settings This section explains the initial settings. Timer setting Setting item name BFM number [Decimal] Description of setting Setting range/options TCP ULP timer 4 Set the time of packet existence at TCP data transmission. TCP zero window timer 5 Set the interval for checking the reception enabled status. 2 to 32767 2 to 32767 TCP resend timer 6 Set the time to resend at TCP data transmission.
5 COMMUNICATION PROCEDURE MELSEC-F (1) Timer setting - TCP ULP timer (BFM#4) (a) This item sets the time of packet existence during TCP data sending. This timer is passed through the parameter when TCP opens or data is sent. (b) Set the value in the range from 2 to 32767. (c) Timer setting = setting value 500 ms (2) Timer setting - TCP zero window timer (BFM#5) (a) The window indicates the reception buffer on the receiving side.
5 COMMUNICATION PROCEDURE MELSEC-F (5) Timer setting - IP assembly timer (BFM#8) (a) Communication data may be divided on the IP level due to the buffer restriction at the sending or receiving station. (b) Set the value in the range from 1 to 32766. (c) Timer setting = setting value 500 ms (6) Timer setting - Response monitoring timer (BFM#9) (a) This timer setting sets the following times. 1) The time to wait for a response after sending a command.
5 COMMUNICATION PROCEDURE MELSEC-F POINT To adjust settings with FX Configurator-EN-L, select "Initial Settings" from the initial screen, and make the settings at the "Ethernet Initial Settings" screen. NOTE (1) Set the value of each timer on the Ethernet module side such that the following relations are met.
5 COMMUNICATION PROCEDURE MELSEC-F (3) When communication errors occur, the setting value should be changed to increase the number of retries.
5 COMMUNICATION PROCEDURE MELSEC-F 1) Checking by KeepAlive This method is used for a connection opened via the TCP/IP protocol. The Ethernet module performs an existence check by sending an existence check ACK message to a remote device with which communication has not been performed for a certain period of time and waiting to see whether or not a response is received. (*1) *1 The connection is cut off if the remote device does not support the TCP KeepAlive function (response to KeepAlive ACK messages).
5 COMMUNICATION PROCEDURE MELSEC-F 5.2.3 Re-initialization Re-initialization is performed in order to place the Ethernet module into its startup status without actually restarting the PLC. Re-initialization of the Ethernet module can be performed in a sequence program. The purposes of and how to program the re-initialization of the Ethernet module are explained below. NOTE When FX Configurator-EN-L is being used, re-initialization can be performed after downloading the parameters.
5 COMMUNICATION PROCEDURE MELSEC-F (2) Programming and timing for re-initialization The programming and timing for re-initialization is shown below: • Program example for the unit No.
5 COMMUNICATION PROCEDURE MELSEC-F (3) Operation for re-initialization Operation for re-initialization differs as follows, depending on the value written to BFM#1600. Operation Written value COM. ERR LED 0001H Turns off 0002H 0005H No change 0006H Re-reading flash ROM*1 Not re-read Re-read Not re-read Re-read *1: When re-reading the flash ROM, the re-initialization is performed in the same status as when the power supply is turned on.
5 COMMUNICATION PROCEDURE MELSEC-F 5.3 Router Relay Parameter This section explains the router relay parameter. Setting item name BFM number [Decimal] Description of setting Setting range/options 2 (b4, b5) 00 : Use Select whether the router relay function is not used or is used. 01 : Not used Sub-net mask pattern 512, 513 Set the sub-net mask. C0000000 to FFFFFFFCH Router IP address 514, 515 Set the IP address of the router to be routed through.
5 COMMUNICATION PROCEDURE MELSEC-F (2) Subnet mask pattern (BFM#512, 513) (a) Set the subnet mask. *1 (Setting range: C0000000 to FFFFFFFCH) Consult the network administrator for the setting. (b) When not using the subnet mask, set any of the following table values according to the class.
5 COMMUNICATION PROCEDURE MELSEC-F 5.4 Confirming the Completion of the Initial Processing The initial processing for the Ethernet module completes by selecting re-initialization, then turning the power ON again, or re-initializing via buffer memory operations after parameters are written to the Ethernet module. (When the processing is completed normally, the [INIT.] LED on the front of the Ethernet module turns on.
5 COMMUNICATION PROCEDURE 5.4.1 PING command (Personal computer MELSEC-F Ethernet module) The following example illustrates how to confirm the completion of the initial processing by issuing the PING command to the local station's Ethernet module from an external device connected on the same Ethernet network. (In the example, the confirmation is made between devices whose IP address class and sub-net address are identical.
5 COMMUNICATION PROCEDURE MELSEC-F 5.4.2 Loop back test (Communication using MC protocol) The loop back test can be performed with communication using MC protocol in order to check the completion status of the initial processing for the target Ethernet module. The following is an overview of the loop back test for communication using MC protocol. See Chapter 9 for details.
5 COMMUNICATION PROCEDURE MELSEC-F 5.5 Open Settings This section explains the open setting. A sequence program can perform open processing (establishing connection) with up to a maximum of 4 external device stations Once a connection is established with an external device, it is possible to communicate using MC protocol, fixed buffer communication. Thus, the open processing is required even when communicating using MC protocol.
5 COMMUNICATION PROCEDURE MELSEC-F (2) Open system (connection numbers 1, 2; BFM#32, 33 b15, b14) (a) Select the connection open system for each connection for which "TCP" is selected in "(1) Protocol". If "UDP" is selected, the specification of this item is not required. Name of setting Description of setting Active Perform active open processing to an external device that waits for a passive open (Fullpassive/Unpassive) on the TCP connection.
5 COMMUNICATION PROCEDURE MELSEC-F (4) Fixed buffer communication (connection numbers 1, 2; BFM#32, 33 b9 to b10) (a) For this item, select the communication method when communicating using the fixed buffers. Name of setting Description of setting Procedure exist • In fixed buffer communication, data is communicated in 1:1 by handshaking with the external device. No procedure • The no procedure fixed buffer communication uses dedicated connections.
5 COMMUNICATION PROCEDURE MELSEC-F (6) Existence confirmation (connection numbers 1, 2; BFM#32, 33 b1) (a) This setting selects whether or not the Ethernet module should confirm that an external device still operates normally when there is no communication for a fixed period of time. The open processing for the connection with the external device must have been completed. Name of setting Description of setting No confirm Do not confirm the existence of the external device.
5 COMMUNICATION PROCEDURE MELSEC-F (9) Destination Port No. (connection numbers 1, 2; BFM#43, 50) (a) Set the port numbers of the external devices for each connection. (b) The port numbers of the external devices are set in the range from 1025 to 65534. (c) Set the port numbers for the external device upon consulting a network administrator. (d) The following table provides some precautions that should be observed when setting port numbers. ( in the diagram indicates a device and indicates a port number.
5 COMMUNICATION PROCEDURE MELSEC-F POINT Set parameters according to the open method to be used for open connection. TCP Communication system open system Active ARP function of external device Parameter Communication address 5 - 23 Yes UDP Passive No Un-passive Full-passive ARP function of external device Yes No Local station Port No. Destination IP address Destination Port No.
5 COMMUNICATION PROCEDURE MELSEC-F 5.5.2 MELSOFT/MC protocol connections (connection No. 3 and connection No. 4) Setting item name BFM number [Decimal] Setting range/options Description of setting MELSOFT MC protocol connection*1 Protocol Open system Existence confirmation Setting value Unpassive Connection usage Set the connection usage 34, 35 TCP Fullpassive UDP Set the local station's port No Local station Port No. 54, 61 Destination IP address 55 to 56, 62 to 63 Dest. Port No.
5 COMMUNICATION PROCEDURE MELSEC-F 5.6 Open Processing/Close Processing of the Connection This section explains the open processing/close processing using sequence programs. (1) Open processing (a) The purpose of the open processing is to establish a connection with an external device in order to perform the following forms of data communication. They can be performed with an external device opened by the user. • Sending/receiving using the fixed buffers (Procedure exists/No procedure) : Connections No.
5 COMMUNICATION PROCEDURE MELSEC-F (2) Close processing (a) The purpose of the close processing is to disconnect (cancel) the connection with the external device established by open processing mentioned previously. (b) The close processing is used when terminating a connection with an external device, changing an external device of a connection, changing communication conditions, etc. (c) Perform the close processing for connections established by open processing using sequence programs.
5 COMMUNICATION PROCEDURE MELSEC-F 5.6.1 Active open processing/close processing This section explains the procedure for opening and closing a connection with an external device from the Ethernet module. • Program example for the unit No. 1 <
5 COMMUNICATION PROCEDURE Power-on MELSEC-F 1) Parameter update completed Open status 2) Hub connected Open allowed status Closed status Initial normal completion BFM#27=0001H Hub connected signal BFM #28b7 OPEN/ CLOSE instruction status BFM#1602 3) OPEN CLOSE status instruction W0001H 0000H OPEN processing 0003H OPEN status 0005H (OPEN failure 0010H) CLOSE instruction W8000H CLOSE status 0000H CLOSE processing 0009H 6) Open completion signal BFM#20480 Open request signal BFM#20482 SYN 4) 5)
5 COMMUNICATION PROCEDURE MELSEC-F POINT This example uses connection number 1 for explanation. Use the corresponding BFM No. and bits for other connection numbers. *1 *2 *3 PLC Open request signal (CLOSE processing execution) Open completion signal Processing when the open processing is abnormally completed (TCP) When opening from the Ethernet module under a normal situation, if the Ethernet module sends a SYN, the external device returns an ACK and a SYN.
5 COMMUNICATION PROCEDURE MELSEC-F 1) The open request signal turns off by writing "8000H" to the BFM#1602. 2) The Ethernet module executes the close processing. 3) The Ethernet module sends a FIN request to the external device. 4) The external device sends back FIN and ACK messages in reply to the FIN request sent by the Ethernet module. (When the reply is not returned, the Ethernet module sends the FIN request again.) 5) The Ethernet module waits for the external device to send an ACK and a FIN.
5 COMMUNICATION PROCEDURE MELSEC-F Program example This example explains a program for open processing/close processing when Active open is selected in the Open system setting. (1) Execution environment for the program example (a) The Ethernet module is connected to the second special module. (The unit number is setting 1) (b) The unit number specified at the sequence program and FX ConfiguratorEN-L is 1. (c) Make Operation settings in the following manner.
5 COMMUNICATION PROCEDURE MELSEC-F • Program example for the unit No.
5 COMMUNICATION PROCEDURE MELSEC-F 5.6.2 Passive open processing/close processing This section explains the procedure for opening and closing a connection with the Ethernet module via an external device. The operations of Passive open processing/close processing differ depending on whether "Always wait for OPEN" or "Do not wait for OPEN" is selected, as shown in this section.
5 COMMUNICATION PROCEDURE MELSEC-F 1) After the parameters are sent, the normal completion of the Ethernet module initial processing is confirmed (Initial normal completion signal BFM#27 "0001H") After the initial processing is normally completed, the connection is placed in the open allowed status and the Ethernet module waits for an open request from the external device. 2) The Ethernet module starts the open processing upon receiving the open request (SYN) from the external device.
5 COMMUNICATION PROCEDURE MELSEC-F • Program example for the unit No.
5 COMMUNICATION PROCEDURE Power-on Open status MELSEC-F Parameter communication completed 1) Open allowed status (closed) (Active open acknowledge enabled) (*1) Closed status Initial normal completion BFM#27="0001H" 2) 8000H 0001H OPEN/ CLOSE operation TO BFM#1602 0001H 3) OPEN/ CLOSE status FROM BFM#1602 0000H 0003H 0005H 0009H 0000H 0003H Open completion signal BFM#20480 Open allowed status BFM#20482 4) SYN+ACK SYN *1 FIN+ACK 5) FIN If an open request (SYN) received after the nor
5 COMMUNICATION PROCEDURE MELSEC-F POINT This example uses connection number 1 for explanation. Use the appropriate BFM signals and bits for other connection numbers. NOTE (1) If the settings of the connection need modifying, the modifications should be done before writing the open instruction to the buffer memory. (2) Once open processing is executed, an open request cannot be canceled before the open processing is completed.
5 COMMUNICATION PROCEDURE MELSEC-F Program example This example explains a program for open processing/close processing when Unpassive open is selected in the open system setting. (1) Execution environment for the program example (a) The Ethernet module is connected to the second special module. (The unit number is setting 1) (b) The unit number specified at the sequence program and in FX ConfiguratorEN-L is 1. (c) Adjust Operation settings in the following manner.
5 COMMUNICATION PROCEDURE MELSEC-F • Program example for the unit No.
5 COMMUNICATION PROCEDURE MELSEC-F 5.6.3 UDP/IP open processing/close processing The following explains the UDP/IP open processing. The operations of the open processing/close processing in UDP/IP differ depending on whether "Always wait for OPEN" or "Do not wait for OPEN" is selected in the initial timing settings (BFM #24 b8) from operational settings.
5 COMMUNICATION PROCEDURE MELSEC-F • Program example for the unit No. 1 <
5 COMMUNICATION PROCEDURE Power-on MELSEC-F Parameter update completed Open status 1) Closed status Initial normal completion BFM#27=001 2) OPEN/CLOSE instruction and status BFM#1602 Open completion signal BFM#20480 R 0000H W0001H 3) R0005H 4) Internal processing W 8000H R 0009H 6) R 0000H 7) Internal processing 1) After communicating the parameter settings, confirm the normal completion of the Ethernet module initial processing.
5 COMMUNICATION PROCEDURE MELSEC-F 5.7 Pairing Open The following explains communication using the paring open method via the Ethernet module. 5.7.1 Pairing open Pairing open is an opening method for establishing a connection in which the local station and the external device use a single port for each, by pairing the receiving and sending connections through fixed buffer communication (both the procedure exists and no procedure are allowed) of the Ethernet module.
5 COMMUNICATION PROCEDURE MELSEC-F 5.7.2 Example of pairing open settings This section explains the settings in order to communicate in the pairing open method by giving an example. • Connection No. 1 and 2 are used. (When connection No. 1 is specified at pairing open settings, connection No. 2 is automatically used as pairing. Therefore, connection No. 2 cannot be specified as pairing.
5 COMMUNICATION PROCEDURE MELSEC-F (7) Local station Port No. (BFM#40, 47) Set this for the receiving connection for receiving only. (Setting is not required for the sending connection.) Set the port number upon consulting a network administrator. (8) Destination IP address (BFM#41 to 42, 48 to 49) (a) If the setting is not required • Open system: At [Unpassive] setting (b) If the setting is required Set for the receiving connection only upon consulting a network administrator.
5 COMMUNICATION PROCEDURE MELSEC-F 5.8 Hub Connection Status Monitor Function The current connection status of the Ethernet module and hub, the transmission speed, and the number of times the Ethernet module detected disconnection can be checked at the following buffer memory addresses. 10BASE-T/100BASE-TX, Full duplex/half duplex Hub Ethernet module External device (1) Hub connection status area (BFM#201) Stores the current connection status of the FX3U-ENET-L and hub and the transmission speed.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) This chapter explains how the PLC and external device communicate in a 1:1 mode using the fixed buffers (with the procedure exist control method) of the Ethernet module. 6.1 Control Method The following explains how communication is performed using the fixed buffers and the procedure exist control method.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F POINT In communication where the procedure exist control method is selected, the data can be communicated by the following methods after the open processing is completed. • Fixed buffer communication with the procedure exist control method (sending or receiving) (3) At data sending/receiving, the Ethernet module processes the following.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 6.2 Sending Control Method This section explains the control method when data is sent from the Ethernet module to an external device using the fixed buffer No. 1 and the area corresponding to connection No. 1 as an example. • Program example for the unit No.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F Initial Open Send data processing processing writing Initial processing normally completed BFM#=0001H HUB connection is signal BFM #28 b7 OPEN/CLOSE instruction status BFM#1602=0005H Write the send data word count and the send data in BFM Response receiving Data sending 1) 2) 3) 4) TO 8) 5) R 0004H(Success)/0008H(Error issued) ACK (TCP only) Response 6) R 0002H ACK (TCP only) W 0001H Data sending Fixed buffer
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F POINT The destination setting (see Section 5.5) for a connection whose parameters are set in FX Configurator-EN-L becomes valid when the open completion signal (BFM#20480 corresponding bit) of the Ethernet module switches from off to on. The setting also becomes valid when the each value in BFM#1602 to #1605 is "0005H" for Connection No.1 to 4.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 6.3 Receiving Control Method This section explains the control method when the Ethernet module receives data from an external device. 6.3.1 Receive processing with the main program This section explains the receiving process to be performed with the main program, using an example in which the fixed buffer No. 2 and the area corresponding to connection No. 2. • Program example for the unit No.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 1) Confirm the normal completion of the open processing of connection No. 2. 2) Upon receiving data from the designated external device (set in the open processing), the Ethernet module processes the following. • Stores the received data to the fixed buffer (No. 2) area.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 6.4 Data Format When communicating between the Ethernet module and an external device, the data format explained below is used. The communication data consists of a "header" and "application data" as follows: Header Application data Maximum of 2040 bytes 6.4.1 Header The header for TCP/IP or UDP/IP is used. In case of the Ethernet module, the Ethernet module adds and deletes the header.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 6.4.2 Application data As shown below, the data code in the application data can be expressed in either binary code or ASCII code. Switching between binary code and ASCII code is performed via the communication data code setting (BFM #24 b1 OFF: binary code, ON: ASCII code).
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F (2) Subheader The format of the subheader is as shown below. The user does not need to set the subheader when using the Ethernet module since the Ethernet module adds and deletes it. b7 b6 b5 b4 b3 b2 b1 b0 1 1 0 0 0 0 0 Command/response type (The bit status indicated in the figure shows that communication using fixed buffers is being performed.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F (3) Data length setting This value indicates the data size of the text (command) section. POINT The data length can be designated in the following range: • Communication using binary code : Maximum of 1017 words • Communication using ASCII code : Maximum of 508 words (*1) *1 Since data is sent/received as ASCII data, the communication data size is approximately half of the data size when using binary code.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F (b) Communication using ASCII code Command format Maximum of 1016 words (H) to (L) 36H 30H 30H 30H (H) to (L) (H) to (L) (H) to (L) Subheader Data designation/ storage device for sending/ receiving instructions Send/ receive data (Maximum of 508 words) ASCII-BIN conversion n Data length setting n+1 (H) (L) n+2 (H) (L) (H) (L) n + data length setting 1 word (2 bytes) (Example) 36H 30H 30H Subheader n+
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 6.5 Programming This section explains the programming method when the Ethernet module communicates with an external device using fixed buffers and the procedure exist control method. 6.5.1 Precautions when creating programs (1) In order to communicate using the fixed buffer, the initial processing and the connection open processing must be completed.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F 6.5.2 Fixed buffer communication program example (with the procedure exist control method) This section explains the programming method in order to communicate data (procedure exist control method) with an external device using the fixed buffers. FX3U-1st station FX3U-2nd station (1) Execution environment for the program example (a) Send program (FX3U-1st station) 1) Connection No. 1 is used for fixed buffer sending.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F (b) Receive program (FX3U-2nd station) 1) Connection No. 1 is used to process the fixed buffer receiving in the main program. 2) The unit number specified at the sequence program and FX Configurator-EN-L is 0. 3) Make Operational Settings in the following manner.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F (2) Outline of the program example (a) Send program (Ethernet module-1st station) 1) After setting each parameter with FX Configurator-EN-L or a sequence program and writing to the Ethernet module, select re-initial, power ON the module again, or confirm that the initial processing is completed via buffer memory operations. 2) Perform open processing (Active open) of connection No. 1.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F (Send program) Open processing program (See Subsection 5.6.1) • Program example for the unit No.
6 FIXED BUFFER COMMUNICATION (WITH THE PROCEDURE EXIST CONTROL METHOD) MELSEC-F (Receive program) • Program example for the unit No. 0 * <
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F 7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) This chapter explains how the PLC and external device communicate using the fixed buffers (with the no procedure control method) via the Ethernet module. POINT The following points describe the difference from the "Procedure exist" using fixed buffer communication: 1) It is possible to send and receive data which match the message format of the external device.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F (2) Data can be communicated with the following external devices. • Device on the Ethernet to which the Ethernet module is connected. • Devices connected with the router relay function (see Section 5.3) As shown in the diagram below, when using each fixed buffer (No. 1, No. 2), the destination devices and usage conditions (for sending/receiving, procedure exist/ no procedure, etc.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F (3) At data sending/receiving, the Ethernet module processes the following. 1) When sending data The fixed buffer communication transmission request (writing "0001H " in BFM#1610, #1611) allows the fixed buffer data stored in the fixed buffer data area (BFM#1664 to #3711) to be sent to the specified external device (BFM#40 to #53).
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F 7.2 Sending Control Method This section explains the control method when data is sent from the Ethernet module to an external device using fixed buffer No. 1 and the area corresponding to connection No. 1 as an example. • Program example for the unit No.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F Initial Open Write processing Processing sent data Initial processing normal completion BFM#27=0001H Response receiving Data sending 1) HUB connection is signal BFM#28 b7 2) OPEN/CLOSE instruction status BFM#1602=0005H 3) 4) Write sent byte count and sent data to BFM TO instruction 7) 5) Fixed buffer send instruction and send completion BFM#1610 Data receiving W 0001H R 0002H R 0004H (Success)/0008H (Failure) ACK
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F 7.3 Receiving Control Method This section explains the control method when the Ethernet module receives data from an external device. 7.3.1 Receive processing with the main program This section explains the receiving process to be performed with the main program, using an example in which the fixed buffer No. 2 and the area corresponding to connection No. 2. • Program example for the unit No.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F Data receiving Read the word count for the received data and receive data FROM instruction 2) Notice the receive status and receive completion of the fixed buffer BFM#1611 3) W 0002H R 4) 0004H(Success) /0008H(Error issued) ACK(only in TCP) Data receiving 1) R BFM#1611=0001H 1) Upon receiving data from the designated external device (set in the open processing), the Ethernet module processes the following.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F 7.4 Data Format When communicating between the Ethernet module and an external device, the data format explained below is used. The communication data consists of a "header" and "application data" as shown below. Header Application data (1) Header The header for TCP/IP or UDP/IP is used. In case of the Ethernet module, the Ethernet module adds and deletes the header. Thus, the user does not need to set it.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F 7.5 Programming This section explains the programming method when the Ethernet module communicates with an external device using fixed buffers and the no-procedure control method. 7.5.1 Precautions when creating programs (1) In order to communicate using the fixed buffers, the initial processing and the connection open processing must be completed.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F 7.5.2 Fixed buffer communication program example (with the no procedure control method) This section explains the programming method in order to communication data (through the no procedure control method) with an external device using the fixed buffers. FX3U-1st station FX3U-2nd station (1) Execution environment for the program example (a) Send program (FX3U-1st station) 1) Connection No. 1 is used for fixed buffer sending.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F (b) Receive program (FX3U -2nd station) 1) Connection No. 2 is used to process the fixed buffer receiving. 2) The unit number specified at the sequence program and FX Configurator-EN-L is 0. 3) Make Operation settings in the following manner. Communication data code : Binary code Initial timing : Do not wait for OPEN (Communications impossible at STOP time) Local station IP address : 10.97.85.223 (0A.61.55.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F (2) Outline of the program example (a) Send program (FX3U-1st station) 1) After setting each parameter with FX Configurator-EN-L or a sequence program and writing to the Ethernet module, power ON the module again, or confirm that the initial processing is completed via buffer memory operations. 2) Perform open processing (Active open) for connection No. 1.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F (Send program) • Program example for the unit No.
7 FIXED BUFFER COMMUNICATION (WITH THE NO PROCEDURE CONTROL METHOD) MELSEC-F (Receive program) • Program example for the unit No. 0 * <
8 COMMUNICATION USING MC PROTOCOL MELSEC-F 8 COMMUNICATION USING MC PROTOCOL This chapter gives an overview of the MC protocol. NOTE The frame type of MC protocol (data communication messages) used by the external device to access the PLC via this product is equivalent to A compatible 1E frame. IP (14 bytes) (20 bytes) TCP / UDP Text (Command) PC ACPU Head device No.
8 COMMUNICATION USING MC PROTOCOL MELSEC-F (2) Remote control of the PLC This function executes remote RUN/STOP operations. Remote operations of the PLC can be performed from the external device side. Send frame Communication using MC protocol *1 Communication data code A compatible 1E ASCII code or binary code *1 frame.
8 COMMUNICATION USING MC PROTOCOL MELSEC-F 8.1.3 Access Timing on the PLC Side The following diagram illustrates the access timing on the PLC side when an external device accesses the PLC via the Ethernet module.
8 COMMUNICATION USING MC PROTOCOL MELSEC-F 8.1.4 PLC setting for performing data communication Data communication via MC protocol is enabled by adjusting the following settings using FX Configurator-EN-L and writing the parameters to the Ethernet module. 1) Operational settings (see Section 4.6.) 2) Initial settings (see Section 5.2) 3) Open settings (see Subsection 5.5.2) 8.1.
8 COMMUNICATION USING MC PROTOCOL MELSEC-F MEMO 8-5 8-5
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL This chapter explains the message format, how to designate data items in a message and restrictions for data communication with an Ethernet module using MC protocol with A compatible 1E frames. 9.1 Message Formats and Control Procedures This section explains the message format and control procedure for each command when data communication is performed using A compatible 1E frames.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (2) When an external device writes data to the PLC PLC side Complete code Area C Header Subheader Monitoring timer External device side Header Subheader PC No. (Command message) (Response message) 1) Area C indicates transmission from the external device to the PLC. 2) The program of the external device is generated so that the data is transmitted sequentially from left to right.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.1.2 Message format and control procedure This section explains the message format and control procedure. (1) Message format This section explains the message format for transmission between the Ethernet module and an external device. The communication data consists of "header" and "application data" as shown below. Header Application data (a) Header The header for TCP/IP or UDP/IP is used.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (2) Control procedure The following diagrams illustrate the control procedure for communicating with the MC protocol and the order of data items in the application data field. The header section shown in the message explanation diagram of this section corresponds to the portion of the message explanation diagrams indicated in Subsection 9.3.2 and later. See Subsection 9.1.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 2) When writing data to the local station PLC from the external device side External device side PLC side (Command message) Monitoring timer PC No. Subheader (Data name) Header Text (Command) The contents and arrangement of the data items in the text differs according to the function to use. See the sections explaining functions found in Subsection 9.3.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 2) When writing data to the local station PLC from the external device side PLC side (Command message) External device side Monitoring timer PC No. Subheader (Data name) Header Text (Command) L H 0AH 00H The contents and arrangement of the data items in the text differs according to the function to use. See the sections explaining functions found in Subsection 9.3.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.1.3 Contents of data designation items This section explains the data items of commands and responses when communicating using MC protocol. In the response that is returned by the Ethernet module to an external device, the data is automatically specified by the Ethernet module; the user does not need to specify it. (1) Header The header for TCP/IP or UDP/IP is used.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (6) Character field (response) This data contains data read/processing result when an external device reads/ writes data from/to the target PLC station. The contents and order of data in the Character field (response) differ depending on the function used. The order or data items at normal completion for each function is explained in each function's reference section in Subsection 9.3.2. and later.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F NOTE The following example shows the designation of the subheader to the monitoring timer when communicating using MC protocol under the following conditions.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (2) Format when communicating in ASCII code (a) The order when sending a command (external device Ethernet module) Application data Subheader PC number (H) Header "0" 30H "0" 30H Monitoring timer (L) (H) "F" "F" "0" 46H 46H 30H (Local station) "D" "2" 44H 32H (M) "0" "0" 30H 30H (2500 ms) "A" 41H Application data Text (command) (Head device number) (Device name) (H) "4" 34H (L) (L) "0" 30H (H) "0" 30H "0" 30H "0" 30H "0" "0" 30H
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.1.4 Character area transmission data This section explains how to transmit the bit device data and word device data handled in the character areas, as well as the order of transmission when communicating data between an external device and the PLC by each command. The transmission data shown in the examples is contained in character area B when reading, and in character area C when writing, testing.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (b) When reading from or writing to a word device memory Each word of the word device memory is expressed in hexadecimal values in 4-bit units sequentially from the higher bit.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (2) Data communication using binary code (a) When reading to or writing from the bit device memory The bit device memory can be read and written in bit units (one device point) or word units (16 device points). How data is transmitted in each case is explained below.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (b) Reading from or writing to a word device memory Each word of a word device memory is designated by 16 bits and the designated number of points from the designated head device are sequentially expressed in one-point units in the order, low byte (L: bits 0 to 7) to high byte (H: bits 8 to 15).
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.2 List of Commands and Functions for The MC protocol The following table lists the commands and functions when an external device accesses the PLC. Command/response type Processing Function Bit units Batch read Batch write Device memory PLC control Loop test *1 Word units 01H Bit units 02H Word units 03H Bit units Test (Random write) 00H Word units 04H 05H Reads bit devices (X, Y, M, S, T, C) in 1-point units.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.3 Device Memory Read/Write This section explains the designations in the control procedure when reading from and writing to the device memory by providing an example. 9.3.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (2) Designation method and accessible range of devices. (a) In device read/write, each device is set by a device code and number as shown in the diagram below. B15 B0 B31 to to B0 Device number (Set in hexadecimal) Device code [Example] In case of D100 D100 = 4420 00000064H Device number (hexadecimal) Device code (b) The following table outlines the device codes and numbers.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F POINT (1) Bit devices and word devices are classified according to the following. Bit devices : X, Y, M, S, T (contact), C (contact) Word devices : T (current value), C (current value), D, R (2) When word units are designated, always make the head device number of a bit device a multiple of 16 (0, 16... in decimal representation).
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.3.2 Batch read in bit units (command: 00) The examples shown in this section explain the command/response format when batch-reading the bit device memory. For more details on the order and contents of data items of the areas marked by " " shown in the control procedure diagram, see Subsection 9.1.2. [Control procedure] Reading the on/off status of M100 to M111 of the PLC on which the FX3U-ENET-L is loaded.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F Number of device points Head device (Data name) PLC side Complete code H L H - - L H - - - - - - - - - - L H L 0 0 F F 0 0 0 A 4 D 2 0 0 0 0 0 0 0 6 4 0 C 0 0 30H 30H 46H 46H30H 30H 30H 41H 34H44H 32H 30H 30H 30H 30H 30H 30H 30H 36H 34H 30H 43H 30H 30H Subheader (Example) Monitoring timer External device side PC No.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.3.3 Batch write in bit units (command: 02) The examples shown in this section explain the command/response format when batch writing to the bit device memory. For more details on the order and contents of data items of the areas marked by " " shown in the control procedure diagram, see Subsection 9.1.2. [Control procedure] Writing the on/off status of M50 to M61 of the PLC on which the Ethernet module is loaded.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F Head device External device side H L H - - L H - - - - - - - - - - L H L 0 2 F F 0 0 0 A 4 D 2 0 0 0 0 0 0 0 3 2 0 C 0 0 1 1 30H 32H 46H 46H30H 30H 30H 30H 34H 44H 32H 30H 30H 30H 30H 30H 30H 30H 33H 32H30H 43H 30H 30H 31H 31H - - - - 0 1 30H 31H Subheader (Example) Data for the number of designed device points Characters for the number of device points (Data name) PLC side This designates to turn M50 ON This designates to turn M51 ON
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.3.4 Test in bit units (random write) (command: 04) The examples shown in this section explain the command/response format when writing data by designating bit device memories arbitrarily. For more details on the order and contents of data items of the areas marked by " " shown in the control procedure diagram, see Subsection 9.1.2.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (Example) Designated device Designated device ON/OFF designation ON/OFF designation Monitoring timer Number of device points External device side PC No.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.3.5 Batch read in word units (command: 01) The examples shown in this section explain the command/response format when batch reading the word device memory and the bit device memory (16 point units). For more details on the order and contents of data items of the areas marked by " " shown in the control procedure diagram, see Subsection 9.1.2.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F Number of device points Head device H L H - - L H - - - - - - - - - - L H L 0 1 F F 0 0 0 A 5 9 2 0 0 0 0 0 0 0 4 0 0 2 0 0 30H 31H 46H 46H 30H 30H 30H 41H 35H 39H 32H 30H 30H 30H 30H 30H 30H 30H 34H 30H 30H 32H 30H 30H PLC side Subheader Y100 (Data name) 32/16 = 2 points Y100 (Octadecimal) = 40 (Hexadecimal) Data for the number of designed device points Characters for the number of device points H L H - - L H - - L 8 1 0 0 8 2 9 D 5 5 3 E
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F NOTE C200 to C255 (Current Values) Batch Read Since C200 to C255 are 32 bit devices, the device points should be specified as twice as much as the points actually read. Also, make sure that the device points are specified by an even number. If they are specified by an odd number, the batch read cannot be performed.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F Monitoring timer Head device H L H L H - - - - - - - - - - L H L 0 1 F F 0 0 0 A 4 3 4 E 0 0 0 0 0 0 D C 4 0 0 0 30H 31H 46 H 46 H 30 H 30 H 30 H 41H 34H 33 H 34 H 45 H 30H 30H 30H 30H 30H 30H 44H 43H 34 H 30H 30H 30H (Data name) PLC side (Example) * Complete code (4 bytes x 2) x 32=256bytes Subheader (Example) * Number of device points External device side PC No.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.3.6 Batch write in word units (command: 03) The examples shown in this section explain the command/response format when batch writing to a word device memory and bit device memory (16 point units). For more details on the order and contents of data items of the areas marked by " " shown in the control procedure diagram, see Subsection 9.1.2. [Control procedure] Writing data to D100 to D102 of the PLC on which the Ethernet module is loaded.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F Monitoring timer Data for the number of designed device points (Characters for the number of device points) H L H - - L H - - - - - - - - - - L H L H - - L H - - L H - - L 0 3 F F 0 0 0 A 4 4 2 0 0 0 0 0 0 0 6 4 0 3 0 0 1 2 3 4 9 8 7 6 0 1 0 9 30H 33H 46H 46H 30H 30H 30H 41H 34H 34H 32H 30H 30H 30H 30H 30H 30H 30H 36H 34H 30H 33H 30H 30H 31H 32H 33H 34H 39H 38H 37H 36H 30H 31H 30H 39H Subheader D100 (Data name) PLC side Complete code (Example)
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F NOTE C200 to C255 (Current Values) Batch Write Since C200 toC255 are 32 bit devices, the device points should be specified twice as much as the points actually read. Also, make sure that the device points are specified by even number. If they are specified by odd number, the batch read cannot be performed.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (2) When communicating in ASCII code Head device - - - 0 0 0 0 H L H L H - - 0 3 F F 0 0 0 A 4 3 4 E 30H 33H 46H 46H 30H 30H 30H 41H 34 H 33 H 34 H 45 H 30 H 30 H 30 H 30 0 H 30 0 H 30 D H L H L C 4 0 Head data Low16bit 0 0 H 6 1 4 44 H 43 H 34 H 30 H 30 H 30 H 36 H 31 H 34 L E H Last data High16bit 45 Low16bit H - - L 0 0 B C H 30 H 30 H 42 H 43 H 0 H 1 4 High16bit L 0 30 H 31 H 34 H 30 H - 0 2 B H 30 H 32 H 42 L
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.3.7 Test in word units (random write) (command: 05) The examples shown in this section explain the command/response format when writing data by designating word device memories and bit device memories (16 point units) arbitrarily. These examples are not applicable for writing the current values of C200 to C255 (32-bit devices).
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (Data name) External device side Monitoring timer Number of device points Subheader PC No.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.4 Remote RUN/STOP, PLC model name code read This function is used to remotely RUN/STOP a PLC and read the model name of a PLC from an external device. 9.4.1 Commands and control contents This section describes the commands and control contents of the control procedure when controlling the status of the PLC.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.4.2 Remote RUN (command: 13) / Remote STOP(Command: 14) The examples shown in this section explain the control procedure of remote RUN. The order and content of data items of the areas marked by " " shown in the control procedure diagram differ depending on the module used as well as the frame and format used for communication. See the detailed information described in Subsection 9.1.2.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F POINT • When executing the remote RUN/STOP using other external devices or computer link, the remote RUN/STOP is executed in the order of execution. • When the power of PLC is turned on, then off, and then on again with the remote RUN/STOP executed, the remote RUN/STOP status is canceled and the setting of the PLC's RUN/STOP switch becomes valid.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.4.3 PLC model name read (command: 15) The examples shown in this section explains the control procedure for reading the model name of the PLC. The order and content of data items of the areas marked by " " shown in the control procedure diagram differ depending on the module used as well as the frame and format used for communication. See the detailed information described in Subsection 9.1.2.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F 9.5 Loopback Test A loopback test checks whether or not the communication function between an external device and the Ethernet module operates normally. The examples show the control procedure using this function.
9 WHEN COMMUNICATING DATA USING THE MC PROTOCOL MELSEC-F (2) Performing a loopback test while communicating in ASCII code H F 0 Last send data Second send data Head send data L 0 0 A H L H L H L H L Subcommand 31H 36H 46 H 46 H 30 H 30 H 30 H 41 H (Data name) PLC side (Example) 9 6 H L 0 0 39 H 36 H 30 H 30 H H L H L H Last send data L F Second send data H Head send data 6 Data length (1 to 254 bytes) 1 Complete code (Example) Data length (1 to 254 bytes) Exter
10 USING THE E-MAIL FUNCTION MELSEC-F 10 USING THE E-MAIL FUNCTION This chapter explains e-mail functions of the Ethernet module. 10.1 E-mail Function The e-mail function sends e-mails to PCs or PLCs at a remote location using the network (via the mail server). The PLC sends e-mails using sequence programs and buffer memory. 10.1.
10 USING THE E-MAIL FUNCTION MELSEC-F (2) Data conversion method used by the Ethernet module The following shows the data conversion method used by the Ethernet module.
10 USING THE E-MAIL FUNCTION MELSEC-F 10.2 Configuration and Environment of the Applicable System This section explains the environment and system configuration for using the e-mail function from the Ethernet module.
10 USING THE E-MAIL FUNCTION MELSEC-F 10.3 Precautions for Using the E-mail Function The following explains precautions when using the e-mail function of the Ethernet module. (1) Precautions regarding the system (a) Design the system so that the entire system operates normally at all times when sending e-mails to/from a running system and controlling the PLC. (2) Precautions regarding the external device (a) E-mails can be sent to PLC stations in which Q series Ethernet modules are installed.
10 USING THE E-MAIL FUNCTION MELSEC-F 10.4 E-mail Specifications The following table lists the specifications of the e-mail function. Item Data size Specification Attached file 2048 words 1 256 words 1 Main text When sending: Sends either a file as attachment or main text (select one). Data transfer method Subject US-ASCII format or ISO-2022-JP (Base 64) Attached file format MIME format MIME Version 1.0 Binary/ASCII/CSV can be selected. Data of attached file format File name: XXXX.
10 USING THE E-MAIL FUNCTION MELSEC-F 10.5 Processing Procedure of the E-mail Function The following flowchart illustrates the procedure that is required before sending e-mails: Start When DNS is not used When DNS is used Register the DNS server See Section 10.6 (1) Register the mail address of the local station's Ethernet module Register the mail address of the external device See Section 10.
10 USING THE E-MAIL FUNCTION MELSEC-F 10.6 E-mail Settings This section explains the settings required to send e-mails. (1) DNS settings Specify the IP address of the DNS server when setting the mail server name using the domain name from the e-mail settings (see (2)). BFM number Setting name DNS setting [Decimal] Description of setting Setting range/options IP address of DNS server 1 20505 to 20506 Set IP address of DNS server 1.
10 USING THE E-MAIL FUNCTION MELSEC-F (2) E-mail settings Set in order to use the e-mail function.
10 USING THE E-MAIL FUNCTION MELSEC-F POINT • The mail server must be designated in order to use the e-mail function. (See POINT of (1).) (c) SMTP authentication setting 1) Set the authentication method for the outgoing mail server (SMTP). The steps 2) and 3) below are required when "SMTP-AUTH" is selected in the SMTP authentication method. 2) Set the login ID of the outgoing mail server (SMTP). 3) Set the password of the outgoing mail server (SMTP).
10 USING THE E-MAIL FUNCTION MELSEC-F 10.7 Sending E-mail (Attached Files) by the PLC This section explains how to send attached files when sending e-mails. 10.7.1When sending data as an attached file The following explains the buffer memory addresses and program for sending e-mail. The following instruction shows how to store data in an attached file and send it to an external device. 1) Check whether mail can be sent or not. (BFM#10334 b15: OFF) 2) Designate the destination of the mail.
10 USING THE E-MAIL FUNCTION MELSEC-F The table below shows the buffer memory to be used for sending mail.
10 USING THE E-MAIL FUNCTION MELSEC-F • Program example for the unit No. 1 X000 Mail sending instruction M102 Mail abnormally M103 completed (M100 ) Mail sending request (Self-holding) Mail normally completed M100 [MOV Mail sending request (Self-holding) M101 [MOV Mail sending (Selfholding) U1\ G10334 D100 Mail sending status Mail sending status U1\ G10336 D101 ] ] Individual Individual success success and failure and failure D100.
10 USING THE E-MAIL FUNCTION MELSEC-F [FEND ] P0 M8000 [ZRST Creates text data R1000 R1002 ] R1000 ] Head of attached data M8000 [MOV R1234 Head of attached data 10 - 13 [MOV H5678 R1001 ] [MOV R9ABC R1002 ] [SRET ] [END ] 10 - 13
10 USING THE E-MAIL FUNCTION MELSEC-F (2) Execution timing of the instruction Initial processing Initial processing normal completion Mail sending completed Mail sending start 1) 2) Writing the necessary data for sending a mail to BFM Mail sending request BFM#10333 Writing the mail data to BFM 3) 0000H 0000H 0001H 4) Mail sending status BFM#10334 8000H 0001H (Normally completed) 0002H (Abnormally completed) Communication with a SMTP server 0000H 1) 2) 3) 4) Check whether the initial process
10 USING THE E-MAIL FUNCTION MELSEC-F (3) Receiving with a personal computer The following explains how a PC/UNIX receives e-mails sent from the Ethernet module. After setting an environment with application software that processes e-mails, e-mails can be received on a receive message screen as shown below. (Example) The following shows an example of the received e-mail. (The screen display shows Microsoft Corporation's Outlook Express 6.
10 USING THE E-MAIL FUNCTION MELSEC-F 10.7.2Contents of the attached files The following explains the contents of the attached file data. The data format of the attached file is ASCII code (ASCII format, CSV format) or binary code (binary format). The following example shows the transmission contents for each data format (binary/ ASCII/CSV) when the Ethernet module sends the data register value as an attached file.
10 USING THE E-MAIL FUNCTION MELSEC-F 10.8 Sending E-mail (Main Text) by the PLC This section explains how to send the main text of e-mail. 10.8.1When sending data as main text of e-mail The following explains the buffer memory address and sequence program for sending e-mail. This section explains how to store the data in main text and send it to the external device. 1) Check whether mail can be sent or not. (BFM#10334 b15: OFF) 2) Destination of the mail.
10 USING THE E-MAIL FUNCTION MELSEC-F The table below shows the buffer memory to be used for sending mail.
10 USING THE E-MAIL FUNCTION MELSEC-F (1) Send using the sequence program Method for sending e-mails by the sequence program is similar to the one by an attached file. See Subsection 10.7.1 for sample programs for sending e-mail from PLC. (2) Receiving by a personal computer The following explains how a PC/UNIX/portable terminal receives e-mail sent from the Ethernet module.
11 TROUBLESHOOTING MELSEC-F 11 TROUBLESHOOTING This section explains the contents of the errors that may occur during communication between the Ethernet module and an external device as well as the troubleshooting procedures. The following are methods for checking if there is an error on the Ethernet module side and the contents of the error. Use one of the following methods to check if there is an error and its content, then take corrective actions.
11 TROUBLESHOOTING MELSEC-F 11.1 How to Check Errors Using LED Displays 11 This section describes the errors that can be checked with the LED displays on the front of the Ethernet module. 11.1.1 Checking error display The following can be checked with the LED displays on the front of the Ethernet module. LED name Status to check Cause/corrective action 1 RUN Turns off after powering on the Ethernet module.
11 TROUBLESHOOTING MELSEC-F (Continued from the previous page) LED name 6 SD Status to check The [SD] LED does not flash at data sending. Cause/corrective action 1) [ERR.] or [COM.ERR] LED turns on. Remove the factors that turn on the [ERR.] or [COM.ERR] LED. 2) Program reviewing is required Review the sequence program for sending. 1) [ERR.] or [COM.ERR] LED turns on. Remove the factors that turn on the [ERR.] or [COM.ERR] LED.
11 TROUBLESHOOTING MELSEC-F 11.1.2 How to turn off COM.ERR LED and to read/clear error information This section explains how to turn off [COM.ERR] LED and to read/clear error information using a sequence program. (1) How to turn off [COM.ERR] LED using buffer memory The [COM.ERR] LED on the front of the Ethernet module is turned on when a communication error occurs in an external device. (BFM#28...b4: ON) (a) The [COM.ERR] LED is turned off by writing "0001H" to the off request signal (BFM#1601). [COM.
11 TROUBLESHOOTING MELSEC-F (4) How to clear error information by writing to buffer memory Writing to BFM#31800 to 31802 allows clearing the error information and turning off COM.ERR.
11 TROUBLESHOOTING MELSEC-F 11.2 How to Check an Error Through FX Configurator-EN-L The status of the various settings for the Ethernet module can be checked using the FX Configurator-EN-L functions. (1) Ethernet diagnostics (See Section 11.2.2.) The block status of an Ethernet module, parameter settings, communication status, error log and others can be checked using the diagnostic function. The following are the functions of the diagnostics.
11 TROUBLESHOOTING MELSEC-F 11.2.1 Buffer memory that can be monitored with the FX Configurator-EN-L diagnostic function The following is a list of the buffer memory addresses that can be displayed on the "Ethernet diagnostics" screen of FX Configurator-EN-L. BFM address Decimal (hexadecimal) 32 (20H) 33 (21H) D Destination existence confirmation (b1) Pairing open (b7) Connection No.1 Communication system (protocol) (b8) Open system (b15, b14) Connection No.2 (same as connection No.1) Connection No.
11 TROUBLESHOOTING BFM address Decimal (hexadecimal) 408 to 409 (198 to 199 H) 410 to 411 (19A to 19B H) 412 to 413 (19C to 19D H) 414 to 415 (19E to 19F H) 416 to 417 (1A0 to 1A1 H) 418 to 419 (1A2 to 1A3 H) 420 to 421 (1A4 to 1A5 H) 440 to 441 (1B8 to 1B9 H) 442 to 443 (1BA to 1BB H) 444 to 445 (1BC to 1BD H) 472 to 473 (1D8 to 1D9 H) 474 to 475 (1DA to 1DB H) Applicable buffer memory ICMP Ethernet diagnostics display screen Display contents Received ICMP packet count Total number of receives Rece
11 TROUBLESHOOTING MELSEC-F 11.2.2 Ethernet diagnostics [Purpose] The block status of an Ethernet module, parameter settings, communication status, error log and others can be checked using the Ethernet diagnostic function of FX Configurator-EN-L. [Operating procedure] FX Configurator-EN-L Diagnostics Diagnostics [Ethernet diagnostics screen] 1) 2) 7) 3) 4) 5) 6) [Explanation of items] No.
11 TROUBLESHOOTING MELSEC-F 11.3 Checking the error information by the buffer memory batch monitoring function It is explained here how the Ethernet module errors can be checked from GX Developer. Error codes stored in the buffer memory of the Ethernet module can be monitored using the "Buffer memory batch monitoring" function of GX Developer.
11 TROUBLESHOOTING MELSEC-F 11.4 Error Code List This section explains the error codes (abnormal codes) for the errors that may occur in each processing when communicating data between the Ethernet module and an external device as well as those generated by processing requests from the local station's FX series PLC. 11.4.1 Type of error incident The details of errors and error handling procedures are described. Type of error Description Error code storage buffer memory BFM#105.............
11 TROUBLESHOOTING MELSEC-F (1) Initial error code (BFM#105) (a) This address stores the error codes generated when the initial processing is executed. (b) Error codes are stored as binary values when the initial abnormal completion signal (BFM#28...b5) is on. (c) An error code is cleared when the initial normal completion signal (BFM#27"0001H", BFM#28...b0: ON) is turns on, but can also be cleared by the following operations.
11 TROUBLESHOOTING MELSEC-F (5) Error log area (BFM#227 to 372) This area stores the following errors. • Errors whose source cannot be confirmed • Errors that occurred during communications using the random access buffer • Errors that occurred during communications using MC protocol (a) Number of error occurrences (BFM#227) 1) This address stores the number of errors registered in the error log block area. 2) When errors occur more than 65536 times, the count is stopped at FFFFH (65535).
11 TROUBLESHOOTING (f) MELSEC-F Error log block - Connection No. (starting from BFM#232) 1) The faulty connection No. is stored in bits 0 to 3 of the corresponding area. ("0" is stored in bits 4 to 15). 2) For errors below the TCP and UDP levels, "0" is stored. (g) Error log block - Local station Port No. (starting from BFM#233) 1) This block stores the local station's port No. when an error occurred. 2) "0" is stored for errors below the TCP and UDP levels.
11 TROUBLESHOOTING MELSEC-F (6) E-mail status storage area (BFM#22640 to 24575) * When the storage count exceeds FFFFH times, the count starts from 0H again. (a) E-mail status storage area for sending (BFM#23355 to 23712) 1) Number of mails normally completed (BFM#23355) • This address stores a cumulative count of how many times the Ethernet module transferred send mails to the Send mail server. 0 : No mail was sent.
11 TROUBLESHOOTING MELSEC-F 6) Sending error log write pointer (BFM#23360) • This address stores the error log block area number where the latest sending error logging is registered. 0 : No error. (No registration of sending error log) 1 or more : Error log block number where the latest sending error logging is registered * If the pointer value is "8", it means that the latest error logging is registered in the sending error log block 8 area.
11 TROUBLESHOOTING MELSEC-F 11.4.2 End codes (Complete codes) returned to an external device during data communication This section explains the end codes (complete codes) that are added to responses when communicating using the fixed buffer or the MC protocol. For more details on the error codes that are added to responses during communication using A compatible 1E frames through the MC protocol, see Subsection 11.4.3.
11 TROUBLESHOOTING MELSEC-F 11.4.3 Abnormal codes returned during communication using MC protocol This section explains the abnormal codes (error codes) that are added to responses when communicating using MC protocol (An abnormal code is added only when an end code is "5B".) For more details on the end codes (error codes) that are added to responses, see Subsection 11.4.2. For more details on the end codes (error codes) that are stored in the buffer memory of the Ethernet module, see Subsection 11.4.4.
11 TROUBLESHOOTING MELSEC-F 11.4.4 Error codes stored in the buffer memory When an error occurs at each data communication processing between the Ethernet module and an external device, the error code (abnormal code) is stored in the buffer memory of the Ethernet module. This section explains the contents of this type of errors and error handling procedures. The "Storage destination" column in the error code list indicates the buffer memory where the applicable error code is stored.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C001H • At initial processing, the IP address setting value of the Ethernet module is incorrect. • When using the router relay function, the setting value of the sub-net mask field is incorrect. • Correct the IP address. Set the class to A/B/C.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C020H Data length exceeds the allowable range. • Correct the data length. • If the data transmitted is larger than the allowable size, divide and then send it. C021H An abnormal end response was received after a transmission using fixed buffers.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C041H C042H C043H C044H to C048H When TCP is used, the checksum of the receive • Review the checksum on the external device data is incorrect. side and send the correct value.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C05FH The request could not be executed on the target • Correct the network number and PC number. • Correct the content of the read/write request. PLC. C060H The content of a request is incorrect. (Incorrect data was designated for bit devices, etc.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C0C7H An Ethernet module system error occurred. C0C8H to C0CAH System error • The OS detected any error. C0CBH Another sending request was made when the sending processing has not been completed. C0CCH • Execute the initial processing again.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 Handshake error on TO instruction with a base module • Check whether or not there is a contact failure on the extension connector. • Check whether or not there are any factors possibly causing noise. • The Ethernet module hardware may be faulty.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C115H to C118H System error • The OS detected any error. (*1) C11CH Mail address not found. • Check whether the mail setting of the parameter setting is correct or not.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C139H System error • The OS detected any error. C13AH The SMTP server was performing processing and an error response was received. (Exceeded the allocation of memory area) • Check the status of the SMTP server.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23361 C160H C161H Received a response from the DNS server after • Check whether or not there is too much load timeout. on the network. Could not receive a response from the DNS • Check the status of the DNS server. server. C162H An error is returned from DNS server.
11 TROUBLESHOOTING MELSEC-F E-mail log Error code Connection Error handling Fixed sending Description of error Open Error code (abnormal code) Initial Storage destination BFM# BFM# BFM# BFM# BFM# BFM# 105 124 125 126 229 23661 C281H Improper usage setting of connections for fixed • Review and correct the set value for usage of connections No. 1 and 2.
11 TROUBLESHOOTING MELSEC-F (1) When communication is performed using fixed buffer (with procedure) (a) If the data length specified immediately after the subheader is smaller than the amount of text data received 1) The data immediately following the part of the text data equivalent to the data length specified immediately after the subheader will be regarded as the next message.
11 TROUBLESHOOTING MELSEC-F (2) When communication is performed using fixed buffer (non-procedure) Since no message data length is specified in non-procedure communication, the data received is stored in the receive buffer area as is. It is recommended to set up some method of checking that the data is received correctly.
11 TROUBLESHOOTING MELSEC-F 11.5 Troubleshooting Flowchart This section explains some simple troubleshooting procedures when the Ethernet module and an external device have communication problems in a flowchart format. (*1) POINT If trouble occurs when using the Ethernet module, check the block status, error status and others for the Ethernet module using the Ethernet diagnostic function of FX Configurator-EN-L described in Subsection 11.2.2. Data cannot be communicated.
11 TROUBLESHOOTING MELSEC-F 1) Is initial processing normally completed (BFM#27= "0001H") NO (BFM#27= "0001H") YES Perform initial processing. (See Subsection 5.2.1.) If the initial processing parameters set with FX Configurator-EN-L and the sequence program for initial processing overlap, delete the sequence program for initial processing. Check and fix the faulty part for each communication processing.
11 TROUBLESHOOTING MELSEC-F POINT (1) When the Ethernet module is replaced due to an error, reboot the following external devices and restart data communication: (If the external device retains the Ethernet address, it may be impossible to continue communication because when a module is replaced the Ethernet address changes.) In the same way, when the external device (personal computer, etc.) is replaced, restart the Ethernet module.
11 TROUBLESHOOTING MELSEC-F 11.5.1 Sending errors during fixed buffer communication (common to procedure exist and no procedure) Sending error Check the open status of the connection with an external device. Are the corresponding connection LEDs (C1-C2) lit? NO Execute the open processing of the applicable connection. (For details, see Section 5.6.) NO Fix the error according to the error code (see Section 11.4). NO Fix the error according to the error code (see Section 11.4).
11 TROUBLESHOOTING MELSEC-F 1) Does the communication protocol (TCP/UDP) match that of the external device? NO Match the protocol with the communication protocol (TCP/UDP) of the external device. (For details, see Section 5.5.) YES Was the "0001H" written to from BFM#1610, 1611? NO Correct the write condition of BFM#1610, 1611.
11 TROUBLESHOOTING MELSEC-F 11.5.2 Receiving errors during fixed buffer communication (common to procedure exist and no procedure) POINT Perform error code reading while the connection is open. Receiving error Do the expected length of data to be received and the amount of data actually received match? NO If the amount of actually received data is smaller than the length of data expected to be received, the subsequent processing must allow reception of the remaining data.
11 TROUBLESHOOTING MELSEC-F 1) Is the parameter for IP address of the external device correct? Is each Port No. of the local and the external station correct? NO Correct the IP address of the external device. YES Does the communication protocol (TCP/UDP) match with that of the external device? Match the protocol with the communication protocol (TCP/UDP) of the external device. (For details, see Section 5.5.
11 TROUBLESHOOTING MELSEC-F POINT If the external device communicates normally, the following conditions occur. For TCP communication When the external device's open status is complete, LEDs C1, C2, which are in correspondence with connections 1, 2, turn on. For UDP communication When external device communication is possible, LEDs C1, C2, which are in correspondence with connections 1, 2 turn on.
11 TROUBLESHOOTING MELSEC-F 11.5.3 Errors in communication using MC protocol Communication error Check the open status of the connection with the external device. Are the corresponding connection LEDs (C3, C4) lit? NO Execute the open processing of the applicable connection. (For details, see Section 5.6.) NO Send the command to the Ethernet module.
11 TROUBLESHOOTING MELSEC-F 1) Is the IP address of the command correct? NO Correct the IP address and send the command again. YES Are the command formats, such as command type, device designation, and address designation, designated correctly? NO Correct the command format. YES Are there any open errors or initial errors in the error log area? NO Check and fix the faulty part. YES The Ethernet module hardware may be faulty. Consult your nearest dealer with the details of the errors.
11 TROUBLESHOOTING MELSEC-F 11.5.4 Sending errors during e-mail communication Sending error Is "0001H" written to BFM#10333? NO Correct the condition for writing to BFM#10333. YES Is the value of BFM#10334 set to "0001H"? NO YES Are the mail server port numbers set correctly in BFM#24320 and 24388? NO Set the server port numbers correctly. YES Is the SMTP authentication setting used? NO YES When "SMTP-AUTH" is selected, check whether the SMTP login ID and password are set correctly.
APPENDIX MELSEC-F APPENDIX Appendix 1 Processing Time Calculate the minimum processing time for each function using the expressions below. Note that the processing time may become longer depending on the load factor on the network (how congested the line is), the window size of each connected device, the number of connections used concurrently, and how the system is configured.
APPENDIX MELSEC-F (2) Minimum processing time of communication using MC protocol (batch read and batch write) Tfs = Ke + (Kdt Df) + Scr number of scans required for processing + ACK processing time of external device Tfs App : Time from when Ethernet module receives request data from personal computer until it completes processing (unit: ms) *1 *1 Ke, Kdt : Constant (refer to the table below) Df : Number of request data words + number of response data words (Application data part) Scr : Scan time
APPENDIX MELSEC-F [Calculation example 1] Calculate the required time (unit: ms) to complete the processing of a data request from a PC after receiving it, when the Ethernet module and the PC perform TCP/IP communication and read 32 points of ASCII code data from the data register (D) in the PLC using MC protocol communication. • Assume that the scan time of the FX3U-ENET-L installed station is 40 ms: 59.17 + ACK processing time of the external device (ms) 18 + (0.
APPENDIX MELSEC-F Appendix 2 ASCII Code List MSD LSD 0 1 2 3 4 5 6 7 000 001 010 011 100 101 110 111 0 0000 NUL DLE (SP) 0 @ P ` p 1 0001 SOH DC1 ! 1 A Q a q 2 0010 STX DC2 “ 2 B R b r 3 0011 ETX DC3 # 3 C S c s 4 0100 EOT DC4 $ 4 D T d t 5 0101 ENQ NAK % 5 E U e u 6 0110 ACK SYN & 6 F V f v 7 0111 BEL ETB ’ 7 G W g w 8 1000 BS CAN ( 8 H X h x 9 1001 HT EM ) 9 I Y i y A 1010 LF SUB : J
APPENDIX MELSEC-F Appendix 4 Program Examples The program examples presented in this section test the connection between the Ethernet module and an external device (personal computer) that is connected to the same Ethernet. For each program, only the minimum programming that is required to perform the communication test is done. Modify the IP address, port number and other values according to your system configuration. In addition, abnormal handling may be added.
APPENDIX MELSEC-F Appendix 4.1 Program example for communication using MC protocol -1 The following explains a program, its execution environment and the contents of data communication . (1) Execution environment of the program example (a) PLC side 1) Base module of the Ethernet installed station : FX3U/FX3UC 2) Ethernet module No. : No.1 3) Ethernet module IP address : 172.16.56.99 (AC.10.38.
APPENDIX MELSEC-F (3) FX Configurator-EN-L settings Set the PLC parameters as follows. (a) Operation settings Communication data code : ASC II Initial timing : Always wait for OPEN (Communication possible at STOP time) IP address : 172.16.56.99 (AC.10.38.63H) (b) Open settings App - 7 Protocol : TCP Open system : Unpassive (MC) Existence confirmation : No confirm Local station Port No.
APPENDIX MELSEC-F (4) Program on the external device side The program example of the external device shown below accesses the FX3U of the station in which the Ethernet module is installed.
APPENDIX MELSEC-F / ***************************************************************** / ** / / ** / ** ** / Sample program / ** ** / / ** ** / This program is a sample program to conduct a ** / / ** connection test between the Ethernet block and ** / / ** / ** ** / target device. / ** ** / This program accesses the data register (D) of / ** ** / the Base Module installed together with the / ** ** / Ethernet block.
APPENDIX int main() { WORD wVersionRequested=MAKEWORD(1,1); WSADATA wsaData; int length; unsigned char s_buf[BUF_SIZE]; unsigned char r_buf[BUF_SIZE]; int rbuf_idx; int recv_size; struct sck_inf sc; struct sockaddr_in hostdata; struct sockaddr_in FX3UENET_L; void Sockerror(int); unsigned long ulCmdArg ; MELSEC-F // Winsock Ver 1.
APPENDIX MELSEC-F Closeflag=FLAG_ON; // Connection completion flag ON // Go to non-blocking mode ulCmdArg = 1; ioctlsocket(socketno, FIONBIO, &ulCmdArg); // Set to non-blocking mode strcpy(s_buf, "03FF000A4420000000000500112233445566778899AA"); // D0 to D4 batch write request (1E frame) length=(int)strlen(s_buf); if(send(socketno,s_buf,length,0)==SOCKET_ERROR){ // Data sending Sockerror(ERROR_SEND); // Error handling return (SOCK_NG); } printf("\n send data\n%s\n",s_buf); // Perform receiving size check a
APPENDIX MELSEC-F while(1) { length = recv(socketno, &r_buf[rbuf_idx], (BUF_SIZE - rbuf_idx), 0); // Response data receiving if(length == 0) { // Is connection cut off? Sockerror(ERROR_RECIEVE); // Error handling return (SOCK_NG); } if(length == SOCKET_ERROR) { nErrorStatus = WSAGetLastError(); if(nErrorStatus != WSAEWOULDBLOCK) { Sockerror(ERROR_RECIEVE); return (SOCK_NG); } else { continue; } } else { rbuf_idx += length; recv_size += length; if(recv_size >= RECV_ANS_2) break; } } r_buf[rbuf_idx] = '\0'
APPENDIX MELSEC-F case ERROR_BIND: printf("Failed to bind."); break; case ERROR_CONNECT: printf("Failed to establish connection."); break; case ERROR_SEND: printf("Sending failed."); break; case ERROR_RECIEVE: printf("Receiving failed."); break; case ERROR_SHUTDOWN: printf("Failed to shutdown."); break; case ERROR_CLOSE: printf("Failed to close normally."); break; } } printf("Error code is %d.
APPENDIX MELSEC-F Appendix 4.2 Program example for communication using MC protocol -2 This section explains an example of an external device program that reads/writs data from the PLC. A sample program, its execution environment and contents of data communication are shown below. (1) Execution environment of the program example 1) The settings of the PLC side are the same as those of the execution environment described in Section 4.1 (1) (a) and (3) of Appendix.
APPENDIX MELSEC-F (4) Window example (Form 1) (Object name) Start Connect to the Ethernet module and perform communications 1st Output Display data that was read from the Ethernet module (5) Sample program (Form 1) Parts in italic are created automatically by Visual Basic .NET, so no input is required. Only input where written in bold. Option Explicit On Option Strict On Imports System.Net.Sockets Public Class Form1 Inherits System.Windows.Forms.
APPENDIX MELSEC-F Memo: The following procedure is necessary for Windows Form Designer. Change by using Windows Form Designer. Do not use code editor to change. Friend WithEvents Start As System.Windows.Forms.Button Friend WithEvents lstOutput As System.Windows.Forms.ListBox Private Sub InitializeComponent() Me.Start = New System.Windows.Forms.Button Me.lstOutput = New System.Windows.Forms.ListBox Me.SuspendLayout() ' 'Start ' Me.Start.Location = New System.
APPENDIX MELSEC-F Dim RxResponse As String Dim Temp As String Dim j As Integer Dim Dreg(5) As Double Dim DregStr$ Dim SubHeader$ ' IP Address specification IpAddress = "172.16.56.99" ' Port Number specification PortNum = 10000 Client = New TcpClient 'Line connection processing Try Client.Connect(IpAddress, PortNum) Catch ex As Exception MsgBox("Connection with the server failed, and the following code was returned: "& ex.
APPENDIX MELSEC-F End If lstOutput.SelectedIndex = lstOutput.Items.Count - 1 End If ' Line disconnection processing Client.GetStream().Close() Client.
APPENDIX MELSEC-F Appendix 5 Differences between the Ethernet and the IEEE802.3 The following shows the Ethernet header in the data link layer supported by the Ethernet module. Ethernet data link layer header Ethernet module Ethernet frame (V 2.0) specification IEEE802.3 (ISO/IEC8802.3) frame specification (1) Ethernet Destination address Source address Type Data (46 to 1500 bytes) FCS Source address Length Data (46 to 1500 bytes) FCS (2) IEEE802.
APPENDIX MELSEC-F Appendix 7 Setting Value Recording Sheets This section provides setting value recording sheets for parameters set with FX Configurator-EN-L Make copies as needed. Setting value recording sheet No.
APPENDIX MELSEC-F Recording sheet 2 [Block number ] FX Configurator-EN-L setting screen Setting data Data item Timer setting Ethernet Initial settings Setting value TCP ULP Timer initial: 60 (unit: 500 ms) TCP zero window Timer initial: 20 (unit: 500 ms) TCP resend timer initial: 20 (unit: 500 ms) TCP end timer initial: 40 (unit: 500 ms) IP assembly timer initial: 10 (unit: 500 ms) Response monitoring timer initial: 60 (unit: 500 ms) Destination existence confirmation starting interval
APPENDIX MELSEC-F Recording Sheet 3 [Block number ] FX Configurator-EN-L setting screen Setting data Data item Setting value Remark TCP Protocol UDP Active Setting not required if UDP is selected. Unpassive Open system Fullpassive Send Fixed buffer Receive Procedure exist Fixed buffer communication Connection No. No procedure No pairs Paring open Pairs No confirm Existence confirmation Confirm Local station Port No.
APPENDIX MELSEC-F Recording sheet 4 [Block number FX Configurator-EN-L setting screen ] Sub-net mask pattern Setting the Ethernet relay parameter Default router IP address Input format App - 23 Setting data Data item Setting value Remark . . . . . .
APPENDIX MELSEC-F Recording sheet 5 [Block number ] FX Configurator-EN-L setting screen Setting data Data item General settings Setting value Remark Password Mail address SMTP Server name Decimal IP address input format Hexadecimal IP address Adjust to input format . SMTP setting . .
APPENDIX MELSEC-F Appendix 8 Versioin Information Ethernet Module version is shown as "VERSION" on the label attached to the right side of the module as seen from the front.
APPENDIX MELSEC-F MEMO App - 26 App - 26
Warranty Please confirm the following product warranty details before using this product. 1. Gratis Warranty Term and Gratis Warranty Range If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company.
Revised History Date Revision 10/2009 A Description First Edition
FX3U-ENET-L USER’S MANUAL HEAD OFFICE: TOKYO BULDING, 2-7-3 MARUNOUCHI, CHYODA-KU, TOKYO 100-8310, JAPAN HIMEJI WORKS: 840, CHIYODA CHO, HIMEJI, JAPAN MODEL FX3U-ENET-L-U-E MODEL CODE 09R722 JY997D38001A (MEE) Effective Oct. 2009 Specifications are subject to change without notice.