0% found this document useful (0 votes)
205 views140 pages

MICREX-SX SPH Ethernet Interface Module

Uploaded by

Trash For
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
205 views140 pages

MICREX-SX SPH Ethernet Interface Module

Uploaded by

Trash For
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 140

series

USER’S MANUAL

Ethernet Interface Module


Type: NP1L-ET1 (10BASE-T, 100BASE-TX)
NP1L-ET2 (10BASE5)

FEH259f
Preface
Thank you for purchasing Fuji Electric Programmable Controller MICREX-SX Series.
This User’s Manual describes the specifications of the MICREX-SX SPH series Ethernet interface modules (Type: NP1L-ET1
and NP1L-ET2) for connecting to Ethernet.
Read this manual carefully to ensure correct operation. When using modules or peripheral devices, be sure to read the
corresponding user’s manuals listed below.

<Manuals relevant to SX-Programmer Expert (D300win)>

Title Manual No. Contents


User's Manual Instruction, FEH200 Describes the memory, language and system definitions of the
MICREX-SX series MICREX-SX series.
User's Manual Hardware, FEH201 Describes the system configuration, the specifications and
MICREX-SX series SPH operations of modules in the MICREX-SX series.
User's Manual D300winV3 <Reference>, FEH257 Describes the menu and icon of D300winV3 and all of the
MICREX-SX series operations of D300winV3.
User’s Manual D300winV3 FEH257-1 Describes the operations of LD/FBD added to D300winV3.
<LD/FBD Editor Operations>,
MICREX-SX series

<Manuals relevant to SX-Programmer Standard (Standard Loader)>

Title Manual No. Contents


User's Manual Instruction, FEH588 Describes the memory, language and system definitions of the
MICREX-SX series MICREX-SX series.
User's Manual Hardware, FEH201 Describes the system configuration, the specifications and
MICREX-SX series SPH operations of modules in the MICREX-SX series.
User’s Manual FEH598 Describes the functions and the operations of SX-Programmer
SX-Programmer Standard V3 <Reference>, Standard V3.
MICREX-SX series

* This manual is applicable to both SX-programmer Expert (hereinafter referred to as D300win) and SX-programmer Standard
(hereinafter referred to as Standard loader). For the Standard loader, word addresses are expressed by decimal numbers (the
same as for MICREX-F series). When described merely as “loader” in this manual, it applies to both loaders.
* In addition to the above manuals, the following Fuji Electric Co.,Ltd. site offers various manuals and technical documents
associated with MICREX-SX series.
URL http://www.fujielectric.com

Notes
1. This manual may not be reproduced in whole or part in any form without prior written approval by the manufacturer.
2. The contents of this manual (including specifications) are subject to change without prior notice.
3. If you find any ambiguous or incorrect descriptions in this manual, please write them down (along with the manual No.
shown on the cover) and contact FUJI.
Safety Precautions
Be sure to read the “Safety Precautions” thoroughly before using the module.
Here, the safety precautions items are classified into “Warning” and “Caution”.

Warning : Incorrect handling of the device may result in death or serious injury.

Caution : Incorrect handling of the device may result in minor injury or physical damage.

Even some items indicated by "Caution" may result in a serious accident.


Both safety instruction categories provide important information. Be sure to strictly observe these instructions.

Warning

z Never touch any part of charged circuits as terminals and exposed metal portion while the power is turned ON. It may
result in an electric shock to the operator.
z Turn OFF the power before mounting, dismounting, wiring, maintaining or checking, otherwise, electric shock, erratic
operation or troubles might occur.
z Place the emergency stop circuit, interlock circuit or the like for safety outside the PLC. A failure of PLC might break or
cause problems to the machine.
z Do not connect in reverse polarity, charge (except rechargeable ones), disassemble, heat, throw in fire or short-circuit the
batteries, otherwise, they might burst or take fire.
z If batteries have any deformation, spilled fluids, or other abnormality, do not use them. The use of such batteries might
cause explosion or firing.
z Do not open the FG terminal with the LG-FG short circuited. (It must be grounded, otherwise it might cause electric shock.)
Safety Precautions

Caution

z Do not use one found damaged or deformed when unpacked, otherwise, failure or erratic operation might be caused.
z Do not shock the product by dropping or tipping it over, otherwise, it might be damaged or troubled.
z Follow the directions of the operating instructions when mounting the product. If mounting is improper, the product might
drop or develop problems or erratic operations.
z Use the rated voltage and current mentioned in the operating instructions and manual. Use beyond the rated values might
cause fire, erratic operation or failure.
z Operate (keep) in the environment specified in the operating instructions and manual. High temperature, high humidity,
condensation, dust, corrosive gases, oil, organic solvents, excessive vibration or shock might cause electric shock, fire,
erratic operation or failure.
z Select a wire size to suit the applied voltage and carrying current. Tighten the wire terminals to the specified torque.
Inappropriate wiring or tightening might cause fire, malfunction, failure, or might cause the product to drop from its mounting.
z Contaminants, wiring chips, iron powder or other foreign matter must not enter the device when installing it, otherwise,
erratic operation or failure might occur.
z Remove the dust-cover seals of modules after wiring, otherwise, fire, accidents, failure or fault might occur.
z Connect the ground terminal to the ground, otherwise, an erratic operation might occur.
z Periodically make sure the terminal screws and mounting screws are securely tightened.
Operation at a loosened status might cause fire or erratic operation.
z Put the furnished connector covers on unused connectors, otherwise, failure or erratic operation might occur.
z Install the furnished terminal cover on the terminal block, otherwise, electric shock or fire might occur.
z Sufficiently make sure of safety before program change, forced output, starting, stopping or anything else during a run.
The wrong operation might break or cause machine problems.
z Engage the loader connector in a correct orientation, otherwise, an erratic operation might occur.
z Before touching the PLC, discharge any static electricity that may have been collected on your body. To discharge it, touch a
grounded metallic object. Static electricity might cause erratic operation or failure of the module.
z Be sure to install the electrical wiring correctly and securely, observing the operating instructions and manual. Wrong or loose
wiring might cause fire, accidents, or failure.
z When disengaging the plug from the outlet, do not pull the cord, otherwise, break of cable might cause fire or failure.
z Do not attempt to change system configurations (such as installing or removing I/O modules) while the power is ON,
otherwise, failure or erratic operation might occur.
z Do not attempt to repair the module by yourself contact your Fuji Electric agent. When replacing the batteries, correctly and
securely connect the battery connectors, otherwise, fire, accidents or failure might occur.
z Clean this product after power-off using a towel that is moistened with lukewarm water and then wrung tightly. Do not use
thinner or other organic solvents, as the module surface might become deformed or discolored.
z Do not remodel or disassemble the product, otherwise, a failure might occur.
z Follow the regulations of industrial wastes when the device is to be discarded.
z The modules covered in these operating instructions have not been designed or manufactured for use in equipment or
systems which, in the event of failure, can lead to loss of human life.
z If you intend to use the modules covered in these operating instructions for special applications, such as for nuclear energy
control, aerospace, medical, or transportation, please consult your Fuji Electric agent.
z Be sure to provide protective measures when using the module covered in these operating instructions in equipment which,
in the event of failure, may lead to loss of human life or other grave results.
z External power supply (such as 24V DC power supply) which is connected to DC I/O should be strongly isolated from AC
power supply, otherwise, accident or failure might occur. (Use of EN60950 conforming power supply is recommended.)
z Do not use this equipment in a residential environment.
Revision
* The manual No. is printed at the bottom right of the cover of this manual.

Printed on * Manual No. Revision contents

Sep. 2002 FEH259 First edition

Mar. 2004 FEH259a • Errors in writing in “Appendix 1-2 Transmission Data Format of Commands” were corrected.
• Specifications for NP1L-ET2 (of 10BASE5 interface specification) were added.
• Specification for response speed was added.
• Running status information RAS was added.
• The operating method when the Standard program loader is used was added.

Dec. 2019 FEH259f • Widely revised reflecting the contents of the latest Japanese version.
(The version No. of this manual shall be “f” in accordance with the latest Japanese version.)
Contents

Preface

Safety Precautions

Revision

Contents

Section 1 Overview
1-1 Overview of Ethernet Interface Module..........................................................................................1-1

Section 2 Specifications
2-1 General Specifications....................................................................................................................2-1
2-2 Transmission Specifications...........................................................................................................2-2
2-2-1 Transmission specifications............................................................................................................................2-2
2-2-2 Communication ports of the module...............................................................................................................2-3
2-2-3 Communication speed....................................................................................................................................2-4
2-3 Communication Functions..............................................................................................................2-9
2-3-1 General purpose communication mode..........................................................................................................2-9
2-3-2 Fixed buffer communication mode..................................................................................................................2-10
2-3-3 Loader command communication mode.........................................................................................................2-11
2-4 Names and Functions......................................................................................................................2-12
2-4-1 NP1L-ET1.......................................................................................................................................................2-12
2-4-2 NP1L-ET2.......................................................................................................................................................2-13
2-5 Dimensions........................................................................................................................................2-15

Section 3 Mounting Modules


3-1 Mounting on Base Board.................................................................................................................3-1
3-1-1 Mounting position............................................................................................................................................3-1
3-1-2 Number of mountable modules.......................................................................................................................3-2

Section 4 Communication Procedures


4-1 Overview of Communication Procedures......................................................................................4-1
4-1-1 General purpose communication mode / Fixed buffer communication mode.................................................4-1
4-1-2 Loader command communication mode.........................................................................................................4-1
4-2 Module Operation Definition...........................................................................................................4-2
4-3 Communication Procedures...........................................................................................................4-9
4-3-1 Communication in general purpose communication mode.............................................................................4-9
4-3-2 Communication in fixed buffer communication mode.....................................................................................4-13
4-3-3 Communication in loader command communication mode............................................................................4-18
4-4 Communication Program................................................................................................................4-20
4-4-1 FBs used in communication programs............................................................................................................4-20
4-4-2 Open channel (M_OPEN)...............................................................................................................................4-20
4-4-3 Send message (M_SEND)..............................................................................................................................4-29
4-4-4 Receive message (M_RECEIVE)...................................................................................................................4-31
4-4-5 Remote data write (R_WRITE).......................................................................................................................4-34
4-4-6 Remote data read (R_READ).........................................................................................................................4-37

Section 5 Sample Programs


5-1 General Purpose Communication Mode........................................................................................5-1
5-2 Loader Command Communication Mode......................................................................................5-5

Section 6 Failure Diagnosis


6-1 Failure Diagnosis.............................................................................................................................6-1
Contents

Appendix 1 Loader Command


Appendix 1-1 Overview of Loader Commands....................................................................................App.1-1
Appendix 1-2 Transmission Data Format of Commands....................................................................App.1-2
Appendix 1-3 Details of Loader Commands........................................................................................App.1-5
Appendix 1-3-1 Read data.......................................................................................................................................App.1-5
Appendix 1-3-2 Write data........................................................................................................................................App.1-8
Appendix 1-3-3 CPU batch start...............................................................................................................................App.1-9
Appendix 1-3-4 CPU batch initialize and start..........................................................................................................App.1-10
Appendix 1-3-5 CPU batch stop...............................................................................................................................App.1-11
Appendix 1-3-6 CPU batch reset..............................................................................................................................App.1-12
Appendix 1-3-7 CPU individual start........................................................................................................................App.1-13
Appendix 1-3-8 CPU individual initialize and start....................................................................................................App.1-14
Appendix 1-3-9 CPU individual stop.........................................................................................................................App.1-15
Appendix 1-3-10 CPU individual reset.....................................................................................................................App.1-16

Appendix 2 Wiring for Ethernet


Appendix 2-1 Connection Configuration for Ethernet........................................................................App.2-1
Appendix 2-1-1 10BASE-T/100BASE-TX connection configuration.........................................................................App.2-1
Appendix 2-1-2 10BASE5 connection configuration................................................................................................App.2-1
Appendix 2-2 Layout and Wiring for Ethernet.....................................................................................App.2-2

Appendix 3 Receive Data Packet Merging Phenomenon


Appendix 3-1 Receive Data Packet Merging Phenomenon................................................................App.3-1

Appendix 4 Notes on Module Replacement


Appendix 4-1 Memory Data in Module.................................................................................................App.4-1
Appendix 4-1-1 Overview.........................................................................................................................................App.4-1
Appendix 4-1-2 How to transfer Ethernet parameter using a program.....................................................................App.4-2
Appendix 4-1-3 Sample program.............................................................................................................................App.4-4
Appendix 4-2 Aging Time......................................................................................................................App.4-17

Appendix 5 PING Sending Function


Appendix 5-1 PING Sending Function..................................................................................................App.5-1
Appendix 5-1-1 Overview.........................................................................................................................................App.5-1
Appendix 5-1-2 R_READ FB for sending PING.......................................................................................................App.5-2
Section 1 Overview

1-1 Overview of Ethernet Interface Module


The Ethernet interface module (Type: NP1L-ET1/ET2) is mounted on a base board of MICREX-SX series SPH (connected to
the SX bus) to connect the SPH to Ethernet.
* Ethernet interface module is hereinafter abbreviated as "Ethernet module."

Another maker’s Ethernet node

Programming loader for SX

Ethernet

MICREX-SX MICREX-SX

Ethernet interface module Ethernet interface module


(Type: NP1L-ET1) (Type: NP1L-ET2)

<Features>
• NP1L-ET1 supports 10BASE-T as well as 100BASE-TX. The Auto Negotiation function automatically changes over between
10BASE-T and 100BASE-TX.
• NP1L-ET2 supports 10BASE5.

1-1
Section 1 Overview
<Supported versions of CPU and programming loader>
When you use the Ethernet interface module (NP1L-ET1/ET2) for Ethernet communication, use the following version of CPU
and loader.

Name Version
SPH200 V**30 or later (Note 1)
CPU SPH300 V**25 or later (Note 2)
SPH2000/SPH3000 All versions
D300winV2 V2.2.3.1 or later (Note 3)
Loader D300winV3 V3.0.0.0 or later (Note 4)
Standard loader V2.0.3.0 or later (Note 5)

Notes:
1) V**42 or later to use the R_READ or R_WRITE instruction
2) V**58 or later to use the redundant function
3) In V2.2.3.1, select NP1L-ET1 to register NP1L-ET2 in system definition.
4) In V3.0.0.0, select NP1L-ET1 to register NP1L-ET2 in system definition.
SPH2000 is supported by V3.3.0.0 or later. (The supported version differs depending on the type.)
5) SPH2000 is supported by V2.2.0.0 or later. (The supported version differs depending on the type.)

<General notes for Ethernet>


1) Take sufficient safety measures when installing Ethernet.
You are recommended to entrust the installation work to an expert company.
For the installation environment, refer to JIS X5252 (ISO 8802-3).
2) For the cable and other peripheral devices, use commercially available ones that conform to IEEE802.3.

* Ethernet is a registered trademark of U.S. based Xerox Corp.

1-2
Section 2 Specifications

2-1 General Specifications


Item Specification
Physical Operating ambient temperature 0 to +55°C
environmental
Storage temperature -25 to 70°C
conditions
Relative humidity 20 to 95%RH, no condensation
Pollution degree 2, no condensation
Corrosion immunity Free from corrosive gases. Not stained with organic solvents
2000m or less above sea level
Operating altitude
Transport condition: 70kPa (equivalent to 3000m above sea level) or more
Mechanical Vibration Half amplitude: 0.15mm, Constant acceleration: 19.6 m/s2
service
Shock Acceleration peak: 147 m/s2
conditions
Three times in each direction
Electrical Noise immunity 1.5kV, rise time 1ns, pulse width 1μs (noise simulator)
service
Electrostatic discharge Contact discharge: ±6 kV, Aerial discharge: ±8 kV (Class 3 of IEC 61000-4-2)
conditions
Radiated, radio-frequency, 80 to 1000 MHz: 10 V/m (Class 3 of IEC 61000-4-2)
electromagnetic field (Note 1)
Isolation method Pulse transformer
Dielectric strength 500 V AC for 1 minute
between communication wires and external power supply terminals,
between communication wires and frame ground for external power supply
Insulation resistance 10 MΩ or more with 500 V DC megger
between communication wires and external power supply terminals,
between communication wires and frame ground for external power supply
Number of occupied slots 1
Internal current consumption 24 V DC, 140 mA or less (supplied from the power module via the base board)
External power supply 12 V DC, 500 mA or less (guideline: 14.28 to 15.75 V DC (NP1L-ET2 only))
(Note 2)
Installation Structure IP30, Panel-mounted type
conditions
Cooling method Natural cooling
Mass NP1L-ET1: Approx. 140 g, NP1L-ET2: Approx. 140 g
Outside dimensions W35*H105*D87 mm (excl. protrusions)

Notes:
1) Influenced by the noise immunity of the connected transceiver. Fuji Electric conducts test and evaluation under the wiring
and installation environment described in Appendix 2-2.
2) Use an external power supply that meets the specifications for transceiver and transceiver cable (AUI cable).

[Reference]
IEEE 802.3 specifies as follows:
• Transceiver input terminal voltage: 12 V -6% to 15 V +15%
• DC resistance of transceiver cable: 40 Ω/km or less, max. 50 m
• Max. current consumption of transceiver: 500 mA

2-1
Section 2 Specifications

2-2 Transmission Specifications


2-2-1 Transmission specifications
Item Specification
Type NP1L-ET1 NP1L-ET2
Interface 10BASE-T 100BASE-TX 10BASE5
Transmission speed 10 Mbps 100 Mbps 10 Mbps
Medium (physical specification) IEEE802.3 IEEE802.3u IEEE802.3
Interface changeover system Auto negotiation (automatic changeover) (Note 1) -
Transmission medium Twisted pair cable Coaxial cable
Max. segment length 100 m 500 m
Max. number of nodes 1 piece/segment 100 pieces/segment
General Purpose Allows communication between SX_CPU and other nodes using TCP/IP or UDP/IP
Communication mode protocol. Because of free data format, it is possible to communicate with all kinds of nodes.
Communi-
Fixed Buffer
cation Allows communication using the fixed buffer provided by Mitsuibishi PLC.
Communication mode
function
Loader Command Allows communication of dedicated loader commands between MICREX- SX series
Communication mode devices.
Access method CSMA/CD
Transmission protocol TCP/IP, UDP/IP, ICMP, ARP (Note 2)(Note 3)
Max. number of mountable units 4 per configuration (* For details, see "Section 3 Mounting Modules.")
16 stations (ports) / module
Note:
Up to 56 communication ports can simultaneously be opened per resource. When two or
Max. number of simultaneously
more Ethernet modules are used or when other communication modules exist, be careful
communicable nodes
not to exceed 56 ports per resource.
(Number of communication ports)
* The more nodes simultaneously communicate, the slower the response will be.
When performing several communications, reduce the number of nodes that
simultaneously communicate by performing communication by turns, for example.
Transmission code Binary/ASCII code

Ethernet transmission frame


In an Ethernet transmission frame (see the figure below), “Type” or “Length” is entered in the field following the source MAC
address, however, Ethernet module supports only “Type” (DIX Ethernet specification).

Destination MAC address Source MAC address Type/Length IP header •••

6 bytes 6 bytes 2 bytes ••• •••

Notes:
1) Hub setting
Use a HUB (a communication target when directly connected to a LAN cable) in auto negotiation mode (automatic
changeover between 10M and 100M). When fixed at 100M or 10M (full duplex), communication cannot be performed.
2) "URG" flag of TCP header
When the URG flag is ON, receive data is treated differently depending on the firmware version.
V48 or earlier: Receive data of M_RECEIVE is data obtained by subtracting the data for the length specified in "Urgent
pointer" (urgent pointer value) of TCP header from the data part of the communication packet.
If the length of the data part of communication packet is the same as the urgent pointer value, M_RECEIVE
cannot receive the data.
V49 or later: Receive data of M_RECEIVE is all the data in the data part of the communication packet.
* When the URG flag is OFF, receive data is treated in the same manner as in V49 or later regardless of the firmware version.
3) "CWR" and "ECE" flags of TCP header
When the CWR and ECE flags are ON, port open operation is different depending on the firmware version.
V48 or earlier: Port open is not possible.
V49 or later: Port open is possible.
* When either the CWR flag or ECE flag is OFF, port open operation is the same as in V49 or later regardless of the
firmware version.
2-2
Section 2 Specifications

2-2-2 Communication ports of the module


(1) Number of communication ports (client ports)
NP1L-ET1/ET2 has 16 ports for communication with other nodes. These 16 ports are shared by the following communication
functions.

Number of
Connection
Communication type Communication function connections
type
(Note 4)

Message 1) Number of general purpose communication mode connections Max. 16


communication 2) Number of fixed buffer communication mode connections Max. 16 Client
connection
3) Number of loader command communication mode (send)
Max. 4
connections (Note 1)
Loader command
4) Number of loader command communication mode (receive)
communication Server
connections (Note 2) Max. 8
connection
5) Number of loader connections (Note3)

Notes:
1) “Send” means the operation of a node that sends a request by R_WRITE or R_READ.
2) “Receive” means the operation of a node that receives a request of R_WRITE or R_READ sent from a partner node.
3) “Loader connection” means communication performed between a personal computer loader, POD, and personal computer
by loader command communication.
4) Up to 56 connections can be established per CPU, including general purpose communication modules other than
Ethernet modules and communication via the port built in the CPU. Before reaching 56, the number of communication
connections increases by a maximum of 16 ports every time an Ethernet module is added.
However, as the number of connections increases, the communication response time becomes slower.

(2) Control of communication ports


The Ethernet module controls communication ports according to the following rules:
• When the targets are client connections (1), 2) and 3) in the above table)
Ports can be opened until there remains no free communication port in the Ethernet module.
• When the target is server connections (4) and 5) in the above table)
Ports can be opened until the total number of server connections becomes 8 or until there remains no free communication
port in the Ethernet module.

<Using client ports in loader network systems>


When the programming loader is connected via a network, each Ethernet module uses one communication port for relaying
loader commands.
Programming loader for SX

: One communication port is used for


server connection

: One communication port is used for


client connection
Target CPU

2-3
Section 2 Specifications

2-2-3 Communication speed


The following shows how to calculate the communication speed when the send/receive message (M_SEND/M_RECEIVE) or
remote data read/write (R_READ/R_WRITE) is used.

(1) When "send message" (M_SEND) is used


<System configuration example>

Ethernet

Ethernet interface module


MICREX-SX

Remote node

<Elements for communication speed calculation>


Calculate the time from when the send request (REQ) of M_SEND FB turns ON until the send end flag (DONE) of M_SEND FB
turns ON. The elements used for this calculation are as follows:

ON
Set send data and
turn ON the send request
(REQ) of M_SEND

SX message processing
Starts sending the data to the remote node.
1)

Ethernet module
internal processing

2) 3)

ON
Sending operation of
Ethernet module is completed. ON for one scan

Send end (DONE) flag of


M_SEND turns ON.
4)

1) SX message processing time


The time required to pass the send data from the CPU internal memory to the Ethernet module internal buffer. This
processing time differs between SPH300/SPH2000 and SPH200.
• SPH300/SPH2000: Executes at 5-ms intervals (Max. volume of message data processed at a time: 256 words)
• SPH200: Executes at the interval of SX bus tact time (Max. volume of message data processed at a time: 256 words)
* When the data volume exceeds 256 words, the remaining data is processed in the next cycle of SX message processing.
2) Ethernet module internal processing time
The time required to send the send data, which the CPU has passed to the Ethernet module, onto the Ethernet transmission
path.
Ethernet module internal processing time = 4 to 15 ms + (0.008 ms × Number of words to send)
3) Transmission time
The time required to pass the send data from the Ethernet module to the transmission path. This time depends on the
transmission rate and the data volume.
4) Send completion transmission time
The time required to transmit the completion of the sending from the Ethernet module to the M_SEND FB. This transmission
synchronizes with the message processing of the CPU and therefore is performed at 5-ms intervals.

2-4
Section 2 Specifications
<Example of communication speed calculation>
* The calculation conditions are as follows: SPH300 is used and "receipt confirmation" is enabled.
* For the data volume, calculation is made in two cases: 100 words and 1017 words. (“1017 words” is an example that the
operation to pass data from CPU to Ethernet is divided.)
* Transmission time is supposed to be 1 ms (approximate value when transmission speed is 10 Mbps).

Communication speed (Communication speed for 100 words) = 1) x 1 +2) + 3) + 4)


(maximum) =5 + (15 + 0.008 x 100) + 1 +5
= 26.8 ms

(Communication speed for 1017 words) = 1) x 1 + 2) + 3) + 4)


=5 + (15 + 0.008 x 1017 + (5 + 2.5) x 3) + 1 +5
= 5606 ms

Communication speed (Communication speed for 100 words) = 1) x 0 +2) + 3) + 4)


(minimum) =0 + (4 + 0.008 x 100) + 1 +0
= 5.8 ms

(Communication speed for 1017 words) = 1) x 0 + 2) + 3) + 4)


=0 + (4 + 0.008 x 1017 + (5 + 2.5) x 3) + 1 +0
= 35.6 ms

Notes:
1) When the volume of send data exceeds 256 words, 5 ms is added to message processing time 1), and 2.5 ms is added to
Ethernet module internal processing time 2).
2) In the case of communication between Ethernet modules:
If the volume of send data is 730 words or less when receipt confirmation is enabled, 205 ms is added to the above formula
If the volume of send data is 731 words or more when receipt confirmation is enabled, 5 ms is added to the above formula.
In the case of communication with other devices, ACK response time on the target device side is added.

(2) When "receive message" (M_RECEIVE) is used


<System configuration example>

Ethernet

MICREX-SX Ethernet interface module

Remote node

<Elements for communication speed calculation>


Calculate the time from when the Ethernet module receives data from the remote node until the receive end flag (DONE) of
M_RECEIVE FB turns ON. The elements used for this calculation are as follows:

Ethernet module Data is received from the remote node.


internal processing

1) From Ethernet module to CPU internal memory

SX message processing

2)

ON for one scan

M_RECEIVE
Receive end (DONE)

2-5
Section 2 Specifications
1) Ethernet module internal processing time
The time required to pass the data, which the Ethernet module has received from the remote node, to the CPU module.
Ethernet module internal processing time = 4 to 15 ms + (0.008 ms x Number of words)
2) SX message processing time
The time required to pass the receive data from the Ethernet module to the CPU internal memory.
This processing time differs between SPH300/SPH2000 and SPH200.
• SPH300/SPH2000: Executes at 5-ms intervals (The volume of message data processed at a time: Max. 256 words)
• SPH200: Executes at the interval of SX bus tact time (The volume of message data processed at a time: Max. 256 words)
* When the data volume exceeds 256 words, the remaining data is processed in the next cycle of SX message processing.

<Example of communication speed calculation>


* The calculation conditions are as follows: SPH300/SPH2000 is used.
* For the data volume, calculation is made in two cases: 100 words and 1017 words. (“1017 words” is an example that the
operation to pass data from CPU to Ethernet is divided.)

Communication speed (Communication speed for 100 words) = 1) + 2)


(maximum) = (15 + 0.008 x 100) + 5
= 20.8 ms

(Communication speed for 1017 words) = 1) + 2)


= (15 + 0.008 x 1017 + (5 + 2.5) x 3) + 5
= 50.6 ms

Communication speed (Communication speed for 100 words) = 1) + 2)


(minimum) = (4 + 0.008 x 100) +0
= 4.8 ms

(Communication speed for 1017 words) = 1) + 2)


= (4 + 0.008 x 1017 + (5 + 2.5) x 3) +0
= 34.6 ms

Note:
When the volume of send data exceeds 256 words, 5 ms is added to SX message processing time 2), and 2.5 ms is added to
Ethernet module internal processing time 1).

2-6
Section 2 Specifications
(3) When "remote read/remote write" (R_READ/R_WRITE) is used
<System configuration example>
Ethernet

MICREX-SX MICREX-SX

Ethernet interface module

<Elements for communication speed calculation>


Calculate the time from when the communication request (REQ) flag of the R_READ/R_WRITE FB turns ON until the end flag
(DONE) turns ON. The elements used for this calculation are as follows:

ON
R_READ
R_WRITE
request (REQ)
SX message
processing
1)
Ethernet transmission time

Response processing time


on the remote side
2) 3) 4)

Ethernet module
internal processing
Ethernet transmission time

5) SX message processing

Ethernet module 6) 7)
internal processing
ON for one scan

R_READ
R_WRITE
end (DONE)

1), 7) SX message processing time


The time required to pass data between the CPU internal memory and Ethernet module.
This processing time differs between SPH300/SPH2000 and SPH200.
• SPH300/SPH2000: Executes at 5-ms intervals (The volume of message data processed at a time: Max. 256 words)
• SPH200: Executes at the interval of SX bus tact time (The volume of message data processed at a time: Max. 256 words)
* When the data volume exceeds 256 words, the remaining data is processed in the next cycle of SX message processing.
2) Ethernet module internal processing time
The time required to open/close a communication port or send/receive data.
Max. value for R_READ = 15 + 30 ms / Min. value for R_READ = 7.5 + 5 ms
Max. value for R_WRITE = 15 + (0.008 × Number of words to send) + 30 ms
Min. value for R_WRITE = 7.5 + (0.008 × Number of words to send) + 5 ms
3), 5) Transmission time
The time required to pass the send data from the Ethernet module to the transmission path. This time depends on the
transmission rate and the data volume.

2-7
Section 2 Specifications
4) Response processing time on the remote node
The time required for the remote SX system to pass response data to transmission path after receiving request data.
Max. value for R_READ = 7.5 x 2 + (0.008 x Number of words) ms
Min. value for R_READ = 7.5 x 2 + (0.008 x Number of words) ms
Max. value for R_WRITE = 7.5 x 2 + (0.008 x Number of words) ms
Min. value for R_WRITE = 7.5 x 2 + (0.008 x Number of words) ms
6) Ethernet module internal processing time
Max. value for R_READ = 15 + (0.008 x Number of words) ms
Min. value for R_READ = 7.5 + (0.008 x Number of words) ms
Max. value for R_WRITE = 15ms
Min. value for R_WRITE = 7.5ms

<Example of communication speed calculation for R_WRITE>


* The time required from when the write request (REQ) turns ON until the end flag (DONE) turns ON using SPH300/SPH2000 is
calculated.
* For the data volume, calculation is made in two cases: 100 words and 1017 words.
* Transmission time is supposed to be 1 ms (the approximate value when transmission rate is 10 Mbps).

Communication speed (maximum)


(Note)
(100 words) = 1) x 1 + 2) + 3) + 4) + 5) + 6) + 7) + 32.5
=5 + 15 + (0.008 x 100) + 30 +1 + 7.5 x 2 + (0.008 x 100) + 1 + 15 + 5 + 32.5
= 121.1 ms
(Note)
(1017 words) = 1) x 1 + 2) + 3) + 4) + 5) + 6) + 7) + 32.5 x 11
=5 + 15 + (0.008 x 1017) + 30 + 1 + 7.5 x 2 + (0.008 x 1017) + 1 + 15 + 5 + 32.5 x 11
= 460.1 ms

Communication speed (minimum)


(Note)
(100 words) = 1) x 0 +2) + 3) + 4) + 5) + 6) + 7) + 15
=0 + 7.5 + (0.008 x 100) + 5 +1 + 7.5 x 2 + (0.008 x 100) + 1 + 7.5 + 5 + 15
= 5.8 ms
(Note)
(1017 words) = 1) x 0 + 2) + 3) + 4) + 5) + 6) + 7) + 15 x 11
=0 + 7.5 + (0.008 x 1017) + 5 + 1 + 7.5 x 2 + (0.008 x 1017) + 1 + 7.5 + 5 + 15 x 11
= 263.3 ms

Note:
When the data volume exceeds 90 words, +15 to 32.5 ms is added for every additional 90 words (every additional 97 words in
the case of SPH200).

2-8
Section 2 Specifications

2-3 Communication Functions


The Ethernet module enables simultaneous communication with a maximum of 16 stations (such as personal computers and
PLCs). The following three communication modes are available:
• General Purpose Communication mode
• Fixed Buffer Communication mode
• Loader Command Communication mode
Note:
The number of simultaneously communicable stations is 16 in total of the above three communication modes.

2-3-1 General purpose communication mode


"General purpose communication mode" is used to communicate mainly between SX_CPU and other nodes such as PLC
systems of other manufacturers, using TCP/IP or UDP/IP protocol. To send data from SX_CPU to other nodes, use the
M_OPEN FB (open channel) and M_SEND FB (send message). To receive data from other nodes, use the M_OPEN FB (open
channel) and M_RECEIVE FB (receive message).
* For the details of the communication procedure, see “4-3-1 Communication in general purpose communication mode."

<Features of General purpose communication mode>


• Allows communication with all kinds of nodes because of free data format.
• Allows communication with up to 16 stations.
• Sends/Receives up to 730 words at a time when remote node uses TPC division for data communication.
(for example, MICREX-F, FLEX-PC, and personal computer)
Sends/Receives up to 1017 words at a time when remote node uses IP division for data communication.
• Allows broadcast communication of UDP/IP.

MICREX-SX
NP1L-ET1/ET2

Send Receive
buffer buffer

Receive data
TCP/IP or UDP/IP

Send data Another manufacturer’s


PLC

Other nodes

2-9
Section 2 Specifications

2-3-2 Fixed buffer communication mode


"Fixed buffer communication mode" offers a communication protocol equivalent to the fixed buffer communication (with
"Procedure Exist" and "Pairing open") provided by Ethernet interface units from Mitsubishi Electric Corp. (Type: AJ71E71,
QJ71E71-xx, and RJ71EN71).
(The following four end codes are supported: 00H, 50H, 52H and 54H.)
This communication protocol is the same as used in the fixed buffer communication mode of Fuji Electric MICREX-F series
Ethernet interface modules (FFU170B and NC1L-ET1).
This mode sets a subcommand in the data part of a TCP/IP or UDP/IP packet for general purpose communication mode to
enable the communication of command type data, where handshaking is made for the communication between PLC and specific
node.
* For the details of the communication procedure, see "4-3-2 Communication in fixed buffer communication mode."

<Features of fixed buffer communication mode>


• Allows communication with up to 16 stations. (PLC system from Mitsubishi Electric Corp.)
• Sends/Receives up to 1017 words at a time

MICREX-SX NP1L-ET1/ET2

Dedicated buffer 1 Dedicated buffer 8

Send Receive Send Receive


buffer buffer buffer buffer

Receive data / response


TCP/IP or UDP/IP

Send data / response


Mitsubishi PLC

Other nodes

2-10
Section 2 Specifications

2-3-3 Loader command communication mode


"Loader command communication mode" communicates data using the loader commands that are dedicated to MICREX-SX
series. This mode is used to communicate data between nodes of an SX system or between an application program of a
personal computer and SX_CPU.
For communication between SX_CPUs, use the R_READ (remote data read) FB and R_WRITE (remote data write) FB on the
request sending side. No program is necessary on the request receiving side.
For communication between personal computer and SX_CPU, create an application program for sending the request to read or
write on the personal computer side. No application program is necessary on the SX_CPU side.
* For the details of the communication procedure, see “4-3-3 Communication in loader command communication mode."

<Communication conditions>

Communications protocol TCP/IP


Open system Unpassive
Local port No. 251 (loader command server), 253 (loader interface server) (Note)

Note:
There are the following restrictions on the use of 253 (loader interface server).
• Changeover in redundant CPU mode is not supported. Use 251 (loader command server) when it is necessary to perform
changeover in CPU redundant mode during Ethernet communication.
• You cannot read the detail RAS of modules other than CPU0 via Ethernet.
* Actual port No. = Self port standard No. + Self port No. (251 or 253)
(You can set the self port standard No. in the system definition. Default: 256)
Default value is "256 + 251 = 507."
For example, when the self port standard No. is set to 1000, 1251 (1000 + 251) is the port No. for loader command
communication.

<Features of loader command communication mode>


• Allows communication with up to 8 stations. (Port Nos. on the Ethernet module side must be the same.)
• Used mainly for communication with other SX systems that support Ethernet or with personal computers.
No application program for communication is necessary on the local node (SX_CPU that receives loader commands).
• Reads/Writes up to 243 words of data at a time

MICREX-SX <Max. 8 stations>


NP1L-ET1/ET2

Communi- Communi-
cation cation
channel channel
CPU

Request data

Response data
TCP/IP

Request data

Response data MICREX-SX <Max. 4 stations>


NP1L-ET1/ET2
CPU
An application program in Communi- Communi-
the personal computer issues cation cation
"data read" or "data write" Other nodes channel channel
loader commands to SX_CPU.

Data read: R_READ FB


Data write: R_WRITE FB

2-11
Section 2 Specifications

2-4 Names and Functions


2-4-1 NP1L-ET1
(1) Names
1) Status indication LED

ONL 100M LNK T/R


2) 10BASE-T/100BASE-TX connector
ERR RDY CN

Nameplate (on the right side)

3) Version No.

(2) Functions
1) Status indication LED
These LEDs indicate the current status of NP1L-ET1.

ONL 100M LNK T/R

ERR RDY CN

Symbol Color Description


ON: NP1L-ET1 is operating normally.
ONL Green Blink: SX bus is being connected.
OFF: SX bus is abnormal.
ON: NP1L-ET1 is abnormal (module internal hardware error) or the software detects other fatal fault
ERR Red
factors.
ON: Communication is performed using 100BASE-TX
100M Green
OFF: Communication is performed using 10BASE-T.
Indicates the state of Ethernet connection.
LNK Green
ON: Connecting to Ethernet.
Indicates the state of data sending.
T/R Green
ON: A send/receive packet is generated.
RDY Green ON: Initialization of the module is completed normally.
CN Green ON: There is at least one connection that is opened by the SX user application.

2) 10BASE-T/100BASE-TX connector
10BASE-T or 100BASE-TX communication cable is connected to this connector.

3) Version No.
The hardware version and software version of NP1L-ET1 are indicated on the label.

20  Hardware version

30  Firmware version

2-12
Section 2 Specifications

2-4-2 NP1L-ET2
(1) Names
1) Status indication LED

2) 10BASE-5 (AUI) connector

Nameplate (on the right side)

3) 12V DC power supply connector


for 10BASE5

4) Version No.

(2) Functions
1) Status indication LED
These LEDs indicate the current status of NP1L-ET2.

ONL LNK TXD RXD

ERR RDY CN

Symbol Color Description


Indicates the SX bus online status.
ON: NP1L-ET2 is operating normally.
ONL Green
Blink: SX bus is being connected.
OFF: SX bus is abnormal.
Indicates the module fault status.
ERR Red ON: NP1L-ET2 is abnormal (module internal hardware error) or the software detects other fatal fault
factors.
LNK Green Reserved
Indicates the state of data sending.
TXD Green
ON: A send packet is generated.
Indicates the state of data receiving.
RXD Green
ON: A receive packet is generated.
RDY Green ON: Initialization of the module is completed normally.
Indicates the connection status.
CN Green
ON: There is at least one connection that is opened by the SX user application.

2-13
Section 2 Specifications
2) 10BASE5 connector
10BASE5 communication cable is connected to this connector.

3) 12V DC power supply connector for 10BASE5


12 V DC power (12 V DC, Max. 500 mA) is supplied through this connector. Use the connector (HNC2-2.5S-3 from Hirose)
supplied with the product. For the power supply specification, see “2-1 General Specifications."

AUI cable

Power connector for 10BASE5


(HNC2-2.5S-3 from Hirose)

White Black

Red

DC+ 0 V DC
Grounding
DC power supply

* The DC power supply is not included.


Prepare it separately.
* Though NP1L-ET2 is equipped with the reverse-current preventive circuit for
12 V DC power supply for 10BASE5, be careful when wiring the DC power supply.

3) Version No.
The hardware version and software version of NP1L-ET2 are indicated on the label.

20  Hardware version

30  Firmware version

2-14
Section 2 Specifications

2-5 Dimensions
NP1L-ET1

Unit: mm

35 (Note) 90

UTP
105

NP1L-ET2

35 (Note) 90

AUI cable
105

Power cable for


12 V DC

Notes:
Consider the bending radius of the cable to be used when installing the module and wiring.

2-15
Section 3 Mounting Modules

3-1 Mounting on Base Board


3-1-1 Mounting position
To use the NP1L-ET1/ET2 module, connect the module to the SX bus of MICREX-SX series CPU. You can mount it at any
location on a base board that is directly connected to the SX bus, but not on a base board of group-type remote I/O such as
OPCN-1, DeviceNet, and T-link.

<8/11/13-slot base board>


You can mount the NP1L-ET1/ET2 module on any slot except those for the power supply module (the two slots from the left on
the base board).

Mountable slots

<3/6-slot base board>

Mountable slots

Note:
NP1L-ET1/ET2 cannot be mounted on a base board of remote I/O such as T-link, OPCN-1, and DeviceNet.

T-link interfce module

CPU
Power Power
supply supply

T-link master module

3-1
Section 3 Mounting Modules

3-1-2 Number of mountable modules


Up to four NP1L-ET1/ET2 modules can be connected in one configuration (including the case where a PC card interface
module is used for Ethernet communication). However, when the following modules are used in the same configuration, the total
number of such modules and NP1L-ET1/ET2 modules must be 16 or less.

Name Type
P-link module NP1L-PL1
PE-link module NP1L-PE1
FL-net module NP1L-FL1/FL2/FL3
LE-net module NP1L-LE1
LE-net loop module NP1L-LL1
LE-net loop2 module NP1L-LL2
General purpose communication module NP1L-RS1/RS2/RS3/RS4/RS5
PC card interface module NP1F-PC2
Memory card interface module NP1F-MM1
ADS-net module NP1L-AD1
WEB module NP1L-WE1
LONWORKS interface module NP1L-LW1
POD directly connected to SX bus -

The modules listed above are controlled by “Circuit No.” that is set from the "Module insert" or "Module properties" dialog box.
When the modules listed above are registered, circuit numbers from 8 to 23 are automatically assigned to them so that 17
or more modules cannot be registered to one system.

3-2
Section 4 Communication Procedures

4-1 Overview of Communication Procedures


Communication with other nodes is performed basically in the following manner.

4-1-1 General purpose communication mode / Fixed buffer communication mode

When the system is turned on, the Ethernet module is * For the setting of the Ethernet module, see
1) Initialization initialized according to the setting of Ethernet module "4-2 Module Operation Definition."
properties in the system definition.

2) Opening Using M_OPEN FB, make the system ready for * For the details of M_OPEN FB, see
communication communicating with the remote node (open the port to "4-4-2 Open channel (M_OPEN)."
channel establish connection).

3) Communication * For the details of communication FBs, see


with remote Send or receive data using M_SEND FB or M_RECEIVE FB. "4-4-3 Send message (M_SEND)" and
mode "4-4-4 Receive message (M_RECEIVE)."

4) Closing Turn on the open request flag (a variable connected to the


communication EN_C terminal) of M_OPEN FB to close the port and
channel disconnect the communication line with the remote node.

4-1-2 Loader command communication mode

1) Initialization
When the system is turned on, two ports are automatically
and opening
opened to enable the communication with up to 8 stations
communication
using loader commands.
channel

For communication between nodes of SX series devices, * For the details of communication FBs, see
R_READ FB and/or R_WRITE FB are used. When the "4-4-5 Remote data write (R_WRITE)" and
2) Communication "4-4-6 Remote data read (R_READ)."
corresponding remote node is a personal computer, loader
with remote For the details of the loader commands that are
commands (data read request and data write request)
mode used to issue commands from the personal
are issued from an application program of the personal
computer. computer, see "Appendix 1 Loader Command."

3) Closing
No application program is necessary for this. The ports are
communication
automatically closed.
channel

4-1
Section 4 Communication Procedures
To communicate with other nodes, set module operation definition (set module parameters) and prepare a communication
program.

4-2 Module Operation Definition


Set operation specifications of the Ethernet module in the "Ethernet parameter setting" of NP1L-ET1/ET2 in the system definition
of the loader. The following table shows the setting items.

Item Description Default


IP address 192.168.0.1
IP address
Subnet mask 255.255.255.0
Gateway Default gateway Not set
TCP sending timeout value: 0 to 300 (in 0.1-second steps) 300
Maximum TCP end timer value: 0 to 600 (in 0.1-second steps) 0
Response watch timer value: 0 to 300 (in 0.1-second steps) 300
Server FTP command watch timer value (in 0.1-second steps) 3000
Client FTP data connection watch timer value (in 0.1-second steps)
30
(This setting is disabled.)
Detail setting
Ethernet communication trace (This setting is disabled.) Not trace
Close process during TCP sending timeout (This setting is disabled.) Not close channel
Close process during response receiving timeout Not close channel
Self port standard No. 256
Communication target port standard No. 256
Redirect Function ON

1) IP address
Set an IP address for the Ethernet module (determined by the network administrator). An IP address identifies each node on
Ethernet. It consists of 32-bit binary data and is defined as a combination of an IP network address and an IP host address. An
IP network address identifies the network; An IP host address is the ID for identifying the host (node) in a network.

2) Subnet mask
Controlling many nodes connected to one network is hard. To divide one network into multiple subnets (groups), set the subnet
mask value. A subnet uses a part of the host address, masking the bits for the IP network address part and subnetwork part with
“1” and the IP host address part with “0.” When no subnet exists, set “0.0.0.0.”
Example 1) When a class B network is divided into 16 subnets, set as follows.
“255.255.240.0” (FFFFF000)
Example 2) When a class B network is divided into 256 subnets, set as follows.
“255.255.255.0” (FFFFFF00)

4-2
Section 4 Communication Procedures
3) Gateway
An IP router (gateway) allows connection to other IP network segments. When networks are connected by an IP router, they can
communicate with each other via the router. Set the gateway to enable communication with another network. Set the IP address
of the gateway here. When no gateway is used, set to "0.0.0.0" (or do not specify anything).
Example) When three routers are used as shown below, the Ethernet module can only access the network of the router A (set
as the default gateway).
However, if the routers support the "ICMP redirect function," information is automatically exchanged among the routers and the
Ethernet module. Then, the Ethernet module can access the networks of the router B and router C.

Network address: 172.21.0.0

Network address: 172.20.0.0 Network address: 172.22.0.0

172.16.0.22 172.21.0.22 172.22.0.22

Router A Router B Router C

172.16.0.22 172.16.0.23 172.16.0.24


Network address: 172.16.0.0

Local node 172.16.0.1

The following screen shows a setting example when the router A is set as the default gateway in the above configuration.

* In old versions of loaders, the "Gateway" tab window includes the following setting items: "New gateway" and "Installed
gateway." However, these settings are actually disabled, therefore, deleted in the new version of loaders.

4-3
Section 4 Communication Procedures
4) TCP sending timeout value (setting range: 0 to 300, in 0.1-second steps)
Set a value for communication error monitoring timer when TCP connection is opened and data is sent.
If opening of a connection or data sending fails (no ACK is returned from the remote node) during TCP/IP communication,
Ethernet automatically retries it. The retry interval increases exponentially, like 3 seconds, 6 seconds, 12 seconds, ......
1) If open processing has started but cannot end normally although Ethernet repeatedly retries it, the open processing ends
abnormally after the set timeout time elapses .
2) If data sending has started but cannot end normally although Ethernet repeatedly retries it, the sending ends abnormally
when the timing of retry is reached after the set timeout time elapses.
For example, when TCP send timeout value is set to 15 seconds and 30 seconds, the internal operation before error detection is
as follows.

15 s 30 s
Total time

3s 6s 12 s
t

Retry Retry Retry

Send error Send timeout Send timeout


occurs. (when set to 15 s) (when set to 30 s)

<Operation when a timeout occurs>


■ When an open timeout occurs
An error occurs in M_OPEN (STATUS: 193).
"VALID" remains off.
Leave "EN_C" of M_OPEN ON. The FB automatically starts connection open operation..

■ When a send timeout occurs


An error occurs in M_SEND (STATUS: 195).
In this case, the communication port on the network is automatically closed.
However, "VALID" of M_OPEN remains on.
To open the communication port again, turn off "EN" of M_OPEN once by an application program, and then turn it on again
after confirming that VALID turns OFF.
When the communication port to the remote node is opened again, "VALID" turns on and the Ethernet module becomes
ready for communication (data sending/receiving).

5) Maximum TCP end timer value (setting range: 0 to 600, in 0.1-second steps)
Set the waiting time to keep the socket for a specified time after the local station performs processing for closing TCP connection
and completes it normally. The maximum waiting time until the processing for closing the remote station is completed normally
when the local station performs processing for closing TCP connection station is twice the set TCP send timeout value.
If the processing for closing the remote station cannot be completed normally (when no FIN is received), RST is sent to the
remote node to forcibly close the connection. 0 means no waiting time.

6) Response watch timer value (setting range: 0 to 300, in 0.1-second steps)


In fixed buffer communication mode, set the waiting time from when a command is sent until a response is returned.

7) Server FTP command watch timer value (setting range: 0 to 3000, in 0.1-second steps)
Set the time to automatically disconnect the connection when a port is opened from the remote node in loader command mode,
however, no command is sent from the node for a given period of time.
Set this item to “0” not to disconnect the connection even when no command is sent from the remote node, for example, when
the loader is connected via the Ethernet module.

8) Client FTP data connection watch timer value (setting range: 0 to 30, in 0.1-second steps)
Currently, this item is not used.

4-4
Section 4 Communication Procedures
9) Close process during TCP sending timeout
TCP sending timeout occurs if no ACK is returned even if sending is retried specified times during communication under TCP/IP
protocol. Select whether to close the connection under this condition.
Note:
This item is disabled. If a TCP sending timeout occurs, the connection is forcibly closed.

10) Close process during response receiving timeout


Select whether to close the connection when a response receiving timeout occurs.

11) Self port standard No. (setting range: 0 to 65280)


Set the self port standard No. for TCP/IP or UDP/IP communication. The actual port No. is determined by adding the set self port
standard No. to the local port No. (SPORT_NO) specified in the M_OPEN FB (user application).
The following shows an example of how to determine the actual port No.
When the settings on the parameter setting screen of the Ethernet module are
Self port standard No. = 256
Communication target port standard No. = 256
and the settings of M_OPEN FB are
RPORT_NO = 1
SPORT_NO = 2,
the actual port No. of the Ethernet module is 258 obtained by the self port standard No. + SPORT_NO.
The actual port No. of the communication partner (personal computer) is 257 obtained by the communication target port
standard No. + RPORT_NO.

12) Communication target port standard No. (setting range: 0 to 65280)


Set the communication target port standard No. for TCP/IP or UDP/IP communication. The actual port No. is determined by
adding the set target port standard No. to the remote port No. (RPORT_NO) specified in the M_OPEN FB (user application).
However, when RPORT_NO is equal to or greater than 257, the standard No. is not added.
(FYI: In the case of Ethernet built in SPH2000, the actual port No. of the communication partner is determined by adding the
set target port standard No. to RPORT_NO regardless of the value set for RPORT_NO.)
When RPORT_NO <= 256:
The actual port No. of the communication partner = Communication target port standard No. + RPORT_NO
When RPORT_NO >= 257:
The actual port No. of the communication partner = RPORT_NO
Notes:
1) To perform communication between MICREX-SX systems using R_READ and R_WRITE, both the self port standard No.
and communication target port standard No. must be “256.”
2) The actual port No. must be equal to or greater than 256 on both the Ethernet module and communication partner sides.

13) Redirect Function (setting range: ON/OFF)


Set the operation when an ICMP redirect message is received. (This function is supported by the firmware version V47 or later.)
The supported version of loaders are as follows.
Expert: V3.6.11 or later
Standard: V3.0.17 or later
ICMP redirect message is a function to notify that the gateway is switched to another gateway.
Set whether to discard ICMP redirect messages.
Enabled (ON): ICMP redirect messages are not discarded.
Disabled (OFF): ICMP redirect messages are discarded.

4-5
Section 4 Communication Procedures
<Operating procedure>
1) Open the "Module properties" dialog box for the Ethernet module and click the [Parameter...] button. The "Ethernet parameter
setting" dialog box opens.

2) On the "IP Address" tab window, set the IP address and subnet mask.

Enter IP address by a decimal number


delimited by periods into 4 blocks.

Enter subnet mask by a decimal number


delimited by periods into 4 blocks.

4-6
Section 4 Communication Procedures
3) On the "Gateway" tab window, set the address of the gateway if necessary.

Enter the address by a decimal number


delimited by periods into 4 blocks.

3) Click the [Detail Setting] tab to display the "Detail Setting" tab window. (Usually, keep the default settings.)

4) After setting all necessary items, click the [OK] button to complete the setting.

4-7
Section 4 Communication Procedures
<Downloading module driver>
The module driver, which stores various parameter settings (IP address, gateway and detail settings), is written into the ROM in
the Ethernet module via the CPU module.
Note that the setting contents are not stored in the memory of the CPU module. The contents of the module driver (IP address,
gateway and detail settings) cannot read even if you upload the program from the CPU by the loader. Each parameter setting (IP
address, gateway and detail settings) in the uploaded data is restored to its default value.
With V36 or later version of Ethernet modules, you can check the setting contents by using the diagnosis function of the loader.
For the details, see "(5) Initializing information."
The only way to download the module driver is to directly download it to the CPU from the loader. Even if you store a program
(including system definitions) in a user ROM, insert it into the CPU module, and then turn the CPU module off and then on
again, the program and system definitions are downloaded, but not the module driver.

When you use an Ethernet module for the first time, the CPU module must recognize it before downloading the module driver.
Follow the steps below to download the module driver.

1) Check "Program" and "System definition," and then download the program. (Do not check "Module driver.")

2) Reset the CPU.


3) Check "Module driver," and then download it.

4-8
Section 4 Communication Procedures

4-3 Communication Procedures


4-3-1 Communication in general purpose communication mode
(1) Data sending
To send data to the remote node, establish connection by M_OPEN, and then send data by M_SEND.

SX_CPU

M_OPEN FB
Open request
(EN_C)
1) 6)
M_OPEN FB
Open enable
(VALID)
M_SEND FB
Send data Set send data.
(SD)
2)
M_SEND FB
Send request
(REQ)
M_SEND FB
Send end 5)
(DONE) 3)

NP1L-ET1/ET2 * When communication protocol is


TCP/IP and receipt confirmation
Send buffer is enabled, the completion of
sending is notified to SX_CPU
after NP1L-ET1/ET2 receives
ACK from the remote node.
4)
ACK

Remote node

1) Open a communication channel by the M_OPEN FB first. Set ON the open request (EN_C) to establish a connection with the
remote node according to the setting of M_OPEN. The open enable flag (VALID) turns ON.
2) Set data to be sent in the send data (SD) of the M_SEND FB, and then set ON the send request (REQ).
3) The data is sent to the send buffer in the Ethernet module at the rising edge of the send request (REQ)
4) The Ethernet module adds a header part necessary for communication to the data and then sends it to the remote node.
5) When the Ethernet module completes sending data, the send end (DONE) of the M_SEND FB turns ON for one scan. When
the communication protocol is TCP/IP and receipt confirmation is enabled, the send end flag (DONE) turns ON for one scan
after the Ethernet module receives data reception signal (ACK) from the remote node.
Note:
If the data sending is not completed normally, the send error (ERROR) turns ON for one scan. In this case, set the send
request OFF, and then re-execute processing for sending data (from the step 3).
6) To break the communication channel when communication ends, set OFF the open request (EN_C) of the M_OPEN FB.
VALID turns OFF when the close processing is completed.

4-9
Section 4 Communication Procedures
(2) Data receiving
To receive data from the remote node, establish a connection by M_OPEN, and then receive data by M_RECEIVE.

Remote node

3)
NP1L-ET1/ET2

Receive buffer

2) Receive enable

SX_CPU

M_OPEN FB
Open request
(EN_C)
1) 5)
M_OPEN FB
Open enable
(VALID)
M_RECEIVE FB
Receive enable
(REQ)

M_RECEIVE FB
Receive data Receive data
(RD)
4)
M_RECEIVE FB
Receive end
(NDR)

1) Open a communication channel by the M_OPEN FB first. Set ON the open request (EN_C) to establish a connection with the
remote node according to the setting of the M_OPEN FB. The open enable flag (VALID) turns ON.
2) Set ON the receive enable (EN_R) of the M_RECEIVE FB to make the Ethernet module ready for receiving data.
3) The Ethernet module receives data from the remote node and stores it in the receive buffer.
4) The received data that is stored in the receive buffer in the Ethernet module is stored in the receive data (RD) of the
M_RECEIVE FB, and then the receive end (NDR) turns ON for one scan.
Note:
If abnormal data is received, the receive end (NDR) does not turn ON and the received data is not stored in the receive buffer.
5) To break the communication channel when communication ends, set OFF the open request (EN_C) of the M_OPEN FB.
VALID turns OFF when the close processing is completed.

4-10
Section 4 Communication Procedures
(3) Data format
Data sent to or received from the remote node.

Header part of Data part of


TCP/IP or or UDP/IP TCP/IP or UDP/IP

Max. 2034 bytes (binary code)


Max. 4068 bytes (ASCII code)

1) Header part
The header part is a header for Ethernet TCP/IP or UDP/IP. When data is sent to the remote node by an application program,
the Ethernet module automatically adds a header to the data before sending it to the remote node. When data is received from
the remote node, the Ethernet module removes the header part from the received data, and sends only the data part to the FB.
2) Data part
The data part is data for Ethernet TCP/IP or UDP/IP. When data is sent to the remote node by M_SEND, data that is transferred
to the send buffer in the Ethernet module is set in the data part of Ethernet TCP/IP or UDP/IP, and then sent. When data in
binary code is set in the send buffer, it is sent without change. When data in ASCII code is set in the send buffer, it is sent after
converted into ASCII characters.
When data is received from the remote node, data of the data part of TCP/IP or UDP/IP is stored in the receive buffer in the
Ethernet module. When data in binary code is received, it is stored in the receive buffer without change. When data in ASCII
code is received, it is stored in the receive buffer after converted into binary code.

<Binary code (without data swap)>

Same length as data length


Packet of
TCP/IP or UDP/IP (Max. 2034 bytes)

Send/receive buffer
Header part D1L D1H D2L D2H D3L D3H ··· DnL
of NP1L-ET1/ET2

1 D1H D1L
2 D2H D2L
3 D3H D3L

n DnL

The data length shows the number of bytes of data stored in the send/receive buffer in decimal (Max. 2034 bytes).
If the data length is an odd number, data up to the low byte of the last word is effective.

<Binary code (with data swap)>

Same length as data length


Packet of
(Max. 2034 bytes)
TCP/IP or UDP/IP

Send/receive buffer
Header part D1H D1L D2H D2L D3H D3L ··· DnH
of NP1L-ET1/ET2

1 D1H D1L
2 D2H D2L
3 D3H D3L

n DnH

The data length shows the number of bytes of data stored in the send/receive buffer in decimal (Max. 2034 bytes).
If the data length is an odd number, data up to the high byte of the last word is effective.

4-11
Section 4 Communication Procedures
<ASCII code>

Packet of
TCP/IP or UDP/IP Twice the data length (Max. 4068 bytes)

Send/receive buffer Header part D1H D1L D2H D2L DnH


of NP1L-ET1/ET2

1 D1H D1L
2 D2H D2L Converted
into
ASCII
n DnH

The data length shows the number of bytes of data stored in the send/receive buffer in decimal (Max. 2034 bytes).
If the data length is an odd number, data up to the high byte of the last word is effective.

4-12
Section 4 Communication Procedures

4-3-2 Communication in fixed buffer communication mode


(1) Data sending
To send data to the remote node, establish a connection by M_OPEN, and then send data by M_SEND.

SX_CPU

M_OPEN FB
Open request
(EN_C)
1) 6)
M_OPEN FB
Open enable
(VALID)
M_SEND FB
Send data Set send data.
(SD)
2)
M_SEND FB
Send request
(REQ)
M_SEND FB
Send end 5)
(DONE) 3)

NP1L-ET1/ET2

Send buffer

4)
Response

Remote node

1) Open a communication channel by the M_OPEN FB first. Set ON the open request (EN_C) to establish a connection with
the remote node according to the setting of the M_OPEN FB. The open enable flag (VALID) turns ON.
2) Set data to be sent in the send data (SD) of the M_SEND FB, and then set ON the send request (REQ).
3) The data is sent to the send buffer in the Ethernet module at the rising edge of the send request (REQ)
4) The Ethernet module adds a header part necessary for communication to the data and then sends it to the remote node.
5) When the Ethernet module completes sending data and receives a response from the remote node, the send end (DONE) of
the M_SEND FB turns ON for one scan.
Note:
If the data sending is not completed normally (no response is returned from the remote node or the end code of the response
is a value other than “00”), the send error (ERROR) turns ON for one scan. In this case, turn OFF the send request, and then
re-execute processing for sending data (from the step 3).
6) To break the communication channel when communication ends, set OFF the open request (EN_C) of the M_OPEN FB.
VALID turns OFF when the close processing is completed.

* When fixed buffer communication mode is used, set separate ports for sending and receiving.

4-13
Section 4 Communication Procedures
(2) Data receiving
To receive data from the remote node, establish a connection by M_OPEN, and then receive data by M_RECEIVE.

Remote node

3)
NP1L-ET1/ET2 Response

Receive buffer

2) Receive enable

SX_CPU

M_OPEN FB
Open request
(EN_C)
1) 5)
M_OPEN FB
Open enable
(VALID)
M_RECEIVE FB
Receive enable
(REQ)

M_RECEIVE FB
Receive data Receive data
(RD) 4)
M_RECEIVE FB
Receive end
(NDR)

1) Open a communication channel by the M_OPEN FB first. Set ON the open request (EN_C) to establish a connection with the
remote node according to the setting of the M_OPEN FB. The open enable flag (VALID) turns ON.
2) Set ON the receive enable (EN_R) of the M_RECEIVE FB to make the Ethernet module ready for receiving data.
3) The Ethernet module receives data from the remote node and stores it in the receive buffer.
4) The received data that is stored in the receive buffer in the Ethernet module is stored in the receive data (RD) of the
M_RECEIVE FB, and then the receive end (NDR) turns ON for one scan. When the receive end turns ON, the Ethernet
module returns a response to the remote node. During reception processing, the data length to receive and the size of
received data part are checked. The Ethernet module continues receiving until all the remaining data is received. Receiving is
completed when all the data is received.
If the size of received data is greater than the data length to receive, the Ethernet module returns “E052 (h)” as a response
(E052: Abnormal number of data words). In this case, the receive error (ERROR) does not turn ON in M_RECEIVE, and the
received data is discarded.
Note:
If abnormal data is received, the receive end (NDR) does not turn ON and the received data is not stored in the receive buffer.
5) To break the communication channel when communication ends, set OFF the open request (EN_C) of the M_OPEN FB.
VALID turns OFF when the close processing is completed.

* When fixed buffer communication mode is used, set separate ports for sending and receiving.

4-14
Section 4 Communication Procedures
(3) Data format

Header part of Data part of


TCP/IP or UDP/IP TCP/IP or UDP/IP

Command/response

Max. 2038 bytes (binary code)


Max. 4076 bytes (ASCII code)

1) Header part
The header part is a header of Ethernet TCP/IP or UDP/IP. When data is sent to the remote node by an application program, the
Ethernet module automatically adds a header to the data before sending it to the remote node. When data is received from the
remote node, the Ethernet module removes the header part from the received data, and sends only the data part to the FB.
2) Data part
The data part is data for Ethernet TCP/IP or UDP/IP. When data is sent to the remote node by M_SEND, a sub-header is added
to the data that is transferred to the send buffer in the Ethernet module. The data with the sub-header is set in the data part of
TCP/IP or UDP/IP, and then sent. When data in binary code is set in the send buffer, it is sent without change. When data in
ASCII code is set in the send buffer, it is sent after converted into ASCII characters.
When data is received from the remote node, the data is stored in the receive buffer in the Ethernet module after the sub-header
is removed from the data part of TCP/IP or UDP/IP. When data in binary code is received, it is stored in the receive buffer without
change. When data in ASCII code received, it is stored in the receive buffer after converted into binary code.

<Command format>

Communication by binary code

Sub-header Data length Data

2 bytes 2 bytes Variable length (Max. 2034 bytes)

Communication by ASCII code

Sub-header Data length Data

4 bytes 4 bytes Variable length (Max. 4068 bytes)

<Response format>

Communication by binary code

Sub-header

2 bytes

Communication by ASCII code

Sub-header

4 bytes

4-15
Section 4 Communication Procedures
<Sub-header>

XXh

7 6 5 4 3 2 1 0

* 1 1 0 0 0 0 0

Command/response type
(The figure shows the state in fixed buffer communication mode)
Command/response flag
0: Command
1: Response

Command Response

Binary code 60h 00h E0h End code

36h 30h 30h 30h 45h 30h End code


ASCII code
"6" "0" "0" "0" "E" "0"

End code

Binary code ASCII code Meaning Description


00h 30h 30h Normal end
50h 35h 30h Command/response An unspecified code is set for the type of command/
type definition error response in sub-header.
52h 35h 32h Abnormal number of Data length exceeds the specified value.
data words
- 35h 34h ASCII conversion error During communication in ASCII code, an ASCII code
that cannot be converted into a binary code was sent
from the remote node.

<Data Binary code (without data swap)>

Packet of
Data for the number of data specified in
TCP/IP or UDP/IP data length (Max. 2034 bytes)

60h 00h nL nH D1L D1H D2L D2H D3L D3H DnL DnH

Send/receive buffer Sub-header Data length


of NP1L-ET1/ET2
Automatically set
0 D1H D1L
1 D2H D2L
2 D3H D3L

n DnH DnL

* Data length indicates the number of bytes of the data that is stored in the send or receive buffer (maximum 1017 words).

4-16
Section 4 Communication Procedures
<Data Binary code (with data swap)>

Packet of
Data for the number of data specified in
TCP/IP or UDP/IP data length (Max. 2034 bytes)

60h 00h nL nH D1L D1H D2L D2H D3L D3H DnL DnH

Send/receive buffer Sub-header Data length


of NP1L-ET1/ET2
Automatically set
0 D1H D1L
1 D2H D2L
2 D3H D3L

n DnH DnL

<Data ASCII code>

Data for the number of data specified


Packet of
in data length (Max. 4068 bytes)
TCP/IP or UDP/IP

36h 30h 30h 30h nL nH D1H D1L D2H D2L DnH DnL

Sub-header Data length

Automatically set

Send/receive buffer
of NP1L-ET1/ET2

0 D1H D1L
1 D2H D2L

n DnH DnL

4-17
Section 4 Communication Procedures

4-3-3 Communication in loader command communication mode


(1) Data writing
To write data to a remote SX node (memory in SX_CPU), use R_WRITE.
R_WRITE automatically opens a communication channel and writes data in a remote node (SX system).

SX_CPU

R_WRITE FB
Write data Set send data.
1)
R_WRITE FB
Write request
(REQ)
R_WRITE FB
Write end 4)
(DONE) 2)

NP1L-ET1/ET2

3)

Response

Remote node
MICREX-SX

1) Set data to be sent in the send data (SD) of the R_WRITE FB and set ON the write request (REQ).
2) When the write request (REQ) of the R_WRITE FB turns ON, the FB automatically opens a communication channel to the
Ethernet module.
3) When a connection is established, data is written into the remote SX node via Ethernet by the loader command.
4) The remote SX node (SX_CPU) executes the write command issued by R_WRITE and sends the processing result (response)
to the Ethernet module. When the Ethernet module receives a normal end signal, the write end (DONE) turns ON for one
scan.
Note:
If the data writing is not completed normally (no response is returned from the remote node or the end code of the response is
a value other than “0”), the write error (ERROR) turns ON for one scan. In this case, turn OFF the write request once, and then
re-issue it.
No application program for communication is required in the remote node.

4-18
Section 4 Communication Procedures
(2) Data reading
To read data from a remote SX node (memory in CPU), use R_READ.
R_READ automatically opens a communication channel and reads data from a remote node (SX system).

SX_CPU

R_READ FB
Read request
(REQ)
1)
R_READ FB
Read end
(DONE)

Set read data.

NP1L-ET1/ET2

3) Response
2)
(read data)

Remote node
MICREX-SX

1) When the read request (REQ) of the R_READ FB turns ON, the FB automatically opens a communication channel to the
Ethernet module.
2) When a connection is established, a request to read the memory in an SX_CPU is issued to the remote SX node (SX_CPU)
via Ethernet by the loader command.
3) The remote SX node (SX_CPU) executes the read command issued by R_READ and returns the processing result (read
data and status). When the Ethernet module receives a normal end signal and read data, the read end (DONE) turns ON for
one scan.
Note:
If the data reading is not completed normally (no response is returned from the remote node or the end code of the response is
a value other than “0”), the read error (ERROR) turns ON for one scan. In this case, set OFF the read request once, and then
re-issue it.
No application program for communication is required in the remote node.

4-19
Section 4 Communication Procedures

4-4 Communication Program


4-4-1 FBs used in communication programs
Ethernet communication programs use the following FBs.

Communication mode Used FB Purpose


Enables the CPU to open a local port and establish a connection to the Ethernet
General purpose M_OPEN
interface module.
communication mode
Fixed buffer M_SEND Enables an SX_CPU (SX system) to send data to another node.
communication mode
M_RECEIVE Enables an SX_CPU to receive data sent from another node.
Enables an SX_CPU (SX system) to write data into an Ethernet node in
R_WRITE
another SX system. No application program is necessary on the written side
Loader command
communication mode Enables an SX_CPU (SX system) to read data from an Ethernet node in another
R_READ SX system. No application program is necessary on the side that receives the read
request.

Note:
Loader command communication mode requires no program to open a communication port since a communication port
is automatically opened when the Ethernet interface module starts up.

4-4-2 Open channel (M_OPEN)


The open channel FB (M_OPEN) enables the CPU to open a local port to the Ethernet module and establish a connection for
communication between the CPU and other nodes connected to the Ethernet module. (Up to 16 ports can be simultaneously
opened.)
When the open processing is completed normally, the FB outputs a connection No. to prove that the connection is established.
After this, the M_SEND and M_RECEIVE FBs perform communication using this connection No.

(1) Operation of the instruction


1) At the rising edge of “EN_C,” the FB performs port open processing to the Ethernet module specified in "MODULE_NO" port
(The open processing does not end within one scan.)
2) When the open processing is completed normally, “VALID” turns ON, and “CON_NO” outputs a connection No.
Then, the M_SEND and M_RECEIVE FBs become available.
3) If the open processing is not completed normally, “ERROR” turns ON for one scan and “STATUS” outputs an error code.
4) When “EN_C” is set to "0", close processing starts. (The close processing does not end within one scan.)
5) When the close processing is completed, “VALID” is set to "0." (Close processing is always completed normally.)

Notes:
1) There are two modes to open a port: “Passive mode” for receiving data and “Active mode” for sending data.
To send data, the destination node must be ready for receiving data. Therefore, open processing in “passive mode” for
receiving data needs to be completed in advance.
2) If the same port (the same self port and same communication target port) is attempted to be reopened, the connection is
established during the retry that is performed three seconds later because it takes one second to open the socket.

4-20
Section 4 Communication Procedures
(2) FB format
1) For D300win

FB No. (instance name)

Data type M_OPEN_ Data type

M_OPEN

BOOL EN_C VARID BOOL

UINT MODULE_NO ERROR BOOL

UINT CHANNEL_NO STATUS INT

UDINT STATION_NO CON_NO UINT

UINT MODULE_TYPE

UINT MODE

UINT SUB_MODE

UINT RPORT_NO

UINT SPORT_NO

2) For Standard loader

4-21
Section 4 Communication Procedures
(3) Description of terminals

Terminal function Terminal name Data


I/O Description
name (parameter) type
Open request EN_C BOOL IN ON: Port open processing starts at the rising edge of this signal.
OFF: Port close processing starts at the falling edge of this signal.
Communication MODULE_NO UINT IN Specify the SX bus station No. of the target Ethernet interface module.
module No. (FYI: For the Ethernet built in SPH2000, specify the SX bus station
No. of the CPU module.)
Communication CHANNEL_NO UINT IN Fixed to "0" for the Ethernet module.
channel No. (FYI: Fixed to "524" for the Ethernet built in SPH2000.)
Remote station No. STATION_NO UDINT IN Specify the IP address of the communication partner node.
*1
Module type MODULE_TYPE UINT IN Set the network type of the Ethernet module.
Fixed to “1”.
Communication MODE UINT IN Set the communication conditions for the port to be opened.
mode *2
Communication SUB_MODE UINT IN Set whether to enable/disable the receipt confirmation.
submode *3 0: Disable, 1: Enable
Remote port No. RPORT_NO UINT IN Specify the port No. of the communication partner node.
(1 to 65535)
Local port No. SPORT_NO UINT IN Specify the port No. of the local module.
(Setting range: 1 to 127).
Open enable VALID BOOL OUT Turns ON when the open processing is completed normally and the
Ethernet module becomes ready for communication.
Turns OFF when the close processing is performed (when EN_C turns
OFF).
Error ERROR BOOL OUT Turns ON for one scan if the open processing ends abnormally.
Status *4 STATUS INT OUT Outputs the result of the open processing by a status code.
Connection No. CON_NO UINT OUT A connection No. is assigned when the open processing is completed.
The M_SEND and M_RECEIVE FBs use this No.

* The data type is used to create a program with D300win.


* The local port No. and remote port No. are not actual port Nos. on the network. For the details of the actual port Nos., see the
description of “Self port standard No.” and “Communication target port standard No.” in "4-2 Module Operation Definition.”

*1 Remote station No.


Set the IP address in the following manner. The following shows an example when the IP address is “172.16.0.1”.
172 16 0 1
Representation in D300win UDINT#16#AC100001
ACh 10h 00h 01h
Representation in the Standard loader HAC100001

* When UDP/IP protocol is used, broadcast transmission is available by specifying “255.255.255.255” and partial broadcast
transmission is available by specifying “***.***.***.255.”
Broadcast reception is not available.

4-22
Section 4 Communication Procedures
*2 Communication mode
Set communication conditions for the connection where a channel is to be opened in the following format.

15 (F) 8 7 0
Representation in D300win: UINT#16#****
Representation in Standard loader: H****

Receive data length storage


0: Disable
1: Enable
Open mode Communication mode
00: Active Destination 000: Fixed Buffer Communication mode
11: Fullpassive Addition mode 001: General Purpose Communication mode
10. Unpassive 0: Disable
1: Enable Automatic reopen
0: Disable
Passive open mode 1: Automatic reopen mode
0: Open completed without
confirming the establishment Data swap
of the connection 0: Disable
1: Open completed at the Send data length selection
1: Enable
establishment of the 0000: Word
connection 0001: Byte Transmission code
0: Binary
1: ASCII

Communication protocol
0: TCP/IP
1: UDP/IP

4-23
Section 4 Communication Procedures
<Open mode>
For TCP/IP communication, perform Fullpassive/Unpassive open processing before performing active open processing.

CPU NP1L-ET1/ET2 NP1L-ET1/ET2 Communication


Open partner node
1) Fullpassive/
Unpassive request
open 2) Waits for Connection Open
open request established request
3) Active open
Open from Active open
completed node
4) Open completed

5) Open completed

1) Active open mode


Active open processing is performed to a node that is waiting for an open request (in Fullpassive/Unpassive open mode).
The node that issues an open request (in Active open mode) is equivalent to a client in the relation between a server and a
client.
Open processing can also be performed by setting both the local node and remote node in Active open mode. In this case, a
node that receives an open request automatically performs passive open processing. If both nodes are set in Fullpassive or
Unpassive open mode, the connection cannot be established.
2) Fullpassive open mode
When in Fullpassive open mode, the local node receives an open request only from a node that has the IP and port No.
specified in M_OPEN. (The IP address and port No. of the communication partner node are checked.)
3) Unpassive open mode
When in Unpassive open mode, the local node receives an open request from any node. (The IP address and port No. of the
communication partner node specified in M_OPEN are ignored.)
The node that receives an open request (in Fullpassive/Unpassive open mode) is equivalent to a server in the relation between
a server and a client.

UDP/IP
UDP/IP provides connectionless communication without the concept of open. However, the operation differs depending on the
selected open mode as follows.
1) Active open mode
The local node communicates only with a node that has the IP and port No. specified in M_OPEN.
Open processing can also be performed by setting both the local node and remote node in Active open mode. If both nodes
are set in passive open mode, the connection cannot be established.
2) Fullpassive open mode
The operation in Fullpassive open mode is the same as in Active open mode.
3) Unpassive open mode
The local node can communicate with any node. (The IP address and port No. of the communication partner node specified in
M_OPEN are ignored.) After setting ON the open request ("EN_C" of M_OPEN), the local node waits to receive data from the
communication partner node. It cannot send data before receiving the first data. Once data communication is performed, the
local node stores the information on the partner node and thereafter communicates only with it.
Set OFF the open request ("EN_C" of M_OPEN) to reset the stored information and make the local node ready for being
accessed from any node again.

<Passive open mode>


Passive open mode is supported by V34 or later version of Ethernet interface modules.
This mode is enabled only for TCP/IP communication. If “open completed at the establishment of the connection” is selected,
"VALID" of M_OPEN turns ON when Ethernet connection is established.
If the connection is not established for 30 seconds after M_OPEN request is issued, an open error occurs (Status: 193).

4-24
Section 4 Communication Procedures
<Destination Addition mode>
Destination Addition mode is supported by V34 or later version of Ethernet interface modules. This setting is only enabled in
"general purpose communication mode."
(For Ethernet built in SPH2000, this setting is also enabled in “fixed buffer communication mode.”)
When Destination Addition mode is enabled, the first four words of data are used as a destination information area.
When communicating with an arbitrary node in Unpassive open mode of TCP/IP communication or in UDP/IP communication,
enable this mode to obtain the IP address and port No. of the communication partner node.
An application program on the PLC side uses data shown below.
Information on the first four bytes of the data is not sent to the communication partner. (Only send/receive data part is
exchanged.)

• TCP/IP
Sending Receiving

Reserved Receive data length (number of bytes)

IP address of
Reserved
communication partner (L)
IP address of
Reserved
communication partner (H)
Max. Max.
1021 words Port No. of 1021 words
Reserved
communication partner

Send data Receive data

Max. 1017 words Max. 1017 words

• UDP/IP
Sending Receiving

Reserved Receive data length (number of bytes)

IP address of IP address of
communication partner (L) communication partner (L)
IP address of IP address of
communication partner (H) communication partner (H)
Max. Max.
Port No. of 1021 words Port No. of 1021 words
communication partner communication partner

Send data Receive data

Max. 1017 words Max. 1017 words

• An IP address and a port No. are stored in hexadecimal.


• In UDP/IP communication, data is sent to the station set in the above. The user sets it by the application.
• Data set in the reserved area is ignored.
• Enter the actual port No. for “Port No. of communication partner.” (See "12) Communication target port standard No.)

4-25
Section 4 Communication Procedures
<Send data length selection>
"Send data length selection" is supported by V37 or later version of Ethernet interface modules. This setting is only enabled in
"general purpose communication mode."
When “Word” is selected, data is sent in units of words (the same operation as V36 or earlier versions) The FB sends the
specified number of words (SIZE) from the beginning of the data that is set in the send area ("SD" of M_SEND). (Range of the
number of words: 1 to 1017 words)
When “Byte” is selected, data is sent in units of bytes (this setting has been newly added to V37). In the first word of the data
that is set in the send area, enter the number of bytes in hexadecimal that you would like to send to the Ethernet communication
channel. In the second and the following words, set data to be practically sent. Data set in the second and the following words
are sent to the channel. (Range of the number of bytes: 1 to 2034 bytes)
* When “Byte” is selected, “Destination Addition mode” cannot be used together. If “Byte” is selected with Destination Addition
mode enabled, the setting is ignored and the operation is the same as when “Word” is selected.

Send data length (Number of bytes)

Send data "SIZE" of M_SEND


Max. 1018 words
Max. 1017 words
(2034 bytes)

When the number of bytes is an odd number, the last one byte of the data becomes as follows according to the data swap
setting.
• When data swap is disabled
The last one byte is entered on the low-order side.

Packet of
TCP/IP or UDP/IP

Header D1L D1H D2L D2H D3L D3H DnL


Send buffer of
NP1L-ET1/ET2

Send byte
length
D1H D1L
D2H D2L
D3H D3L

DnL

• When data swap is enabled


The last one byte is entered on the high-order side.

Packet of
TCP/IP or UDP/IP

Header D1H D1L D2H D2L D3H D3L DnH


Send buffer of
NP1L-ET1/ET2

Send byte
length
D1H D1L
D2H D2L
D3H D3L

DnH

<Data swap>
When the transmission code is set to binary, the treatment of high bytes and low bytes of transmission data are reversed.
When the transmission code is set to ASCII, disable the data swap.
4-26
Section 4 Communication Procedures
<Automatic reopen>
If Automatic Reopen mode is enabled in “Fullpassive” or “Unpassive” open mode, the Ethernet module automatically performs
close processing when it receives a close request from the remote node after the connection is established, and then
automatically starts waiting for an open request.

<Receive data length storage>


"Receive data length storage" is supported by V34 or later version of Ethernet interface modules. This setting is enabled only in
“general purpose communication mode."
When “Receive data length storage” is enabled, the length of received data is stored in the first word of the receive buffer as
shown below.

Receive data length (Number of bytes)

Receive data Max. 1018 words

Max. 1017 words

*3 Communication submode
“Communication submode” specifies whether or not to enable receipt confirmation when data is sent using TCP/IP protocol.
1) Operation when receipt confirmation is disabled (SUB_MODE = 0 [UINT#0])

CPU NP1L-ET1/ET2 Remote node


Send
M_SEND request
REQ → ON Data
sending

Sneding
M_SEND completed
DONE → ON

ACK

SX bus Ethernet

* Data sending is completed when the data is sent onto Ethernet without waiting for ACK from the remote node.

2) Operation when receipt confirmation is enabled (SUB_MODE = 1 [UINT#1])...Recommended

CPU NP1L-ET1/ET2 Remote node


Send
M_SEND request
REQ → ON Data
sending

Sneding ACK
M_SEND completed
DONE → ON

SX bus Ethernet

* Data sending is completed after the Ethernet module receives ACK from the remote node.

4-27
Section 4 Communication Procedures
<Notes on when “receipt confirmation” is disabled in communication submode>
When “receipt confirmation" is disabled, the Ethernet module retries sending for five minutes if a communication error occurs
(for example, power interruption or LAN cable disconnection in the partner device). No error occurs in the M_OPEN or M_SEND
FB during and after retry, therefore, it is necessary to detect the error by an application program using a timer instructions, for
example, after M_SEND starts up.
In addition, another M_OPEN or M_SEND FB cannot be executed during retry operation. In other words, if a communication
error occurs, the port becomes unavailable for five minutes.
If a communication error occurs when “receipt confirmation" is enabled, "ERROR" of M_SEND turns ON for one scan after the
period of time specified in “TCP sending and receiving timeout value (30 seconds by default)” has elapsed, and "STATUS"
outputs an error code 195. In this mode, another M_OPEN or M_SEND FB can be executed after an error is detected. (No
need to wait for five minutes.)
Usually, enable receipt confirmation.

*4 Status
The table below shows errors that occur during open processing.

Error code Cause


Message destination setting error
160
• No module exists at the SX bus station No. that is specified in "MODULE_NO".
No response
162
• The Ethernet module returns no response to the M_OPEN request sent from the CPU.
Parameter error
177 • An out-of-range value was input.
(The value of "MODULE_NO" exceeds the range of 1 to 254 or the value of "MODULE_TYPE" is out of range.)
Channel open error
• An abnormal value is specified for the station No.
• An abnormal value is specified for the communication mode.
• "Active” is set for open mode (on the sender side), however, the station No. (IP address) of the remote node
and RPORT_NO cannot be found on the network.
193
* When UDP/IP is selected for communication protocol, no communication is performed while opening a channel,
therefore, no error occurs even if the station No. (IP address) of the remote node cannot be found on the
network. In addition, no connection is established while opening a channel in UDP/IP communication.
The Ethernet module regards a connection as being established when it receives data from the remote node.
• Connection is not established.
Port setting error
• The code specified in "SPORT_NO" is out of the range of 1 to 127.
200
• The same value is already specified for "SPORT_NO" in the resource (in the CPU).
• The same combination of "SPORT_NO" and "RPORT_NO" is already registered in one communication module.
Connection No./Client port full
• 57 or more ports were simultaneously attempted to be opened in the resource.
201 • Ports exceeding the specified number were attempted to be opened in one communication module.
(The number of ports that can be simultaneously opened differs depending on the module.
Max. 16 ports for NP1L-ET1/ET2)
Network type mismatch
202
• The code specified for the module type does not match the network of the communication module.

4-28
Section 4 Communication Procedures

4-4-3 Send message (M_SEND)


Send message (M_SEND) FB is used to send data to the remote node to which SX_CPU opens a communication channel to
enable communication in general purpose communication mode or fixed buffer communication mode.

(1) Operation of the instruction


1) At the rising edge of "REQ," the FB sends a message to the station that has the connection No. set in “CON_NO.”
2) When the message sending is completed normally, “DONE” turns ON for one scan.
3) If the message sending is not completed normally, “ERROR” turns ON for one scan, and "STATUS" outputs a corresponding
error code.
Notes:
1) Up to 1017 words of data can be sent at a time.
2) Additional “REQ” command (OFF to ON) is disabled during message sending (until “DONE” or “ERROR” turns ON after the
rising edge of “REQ.”)
3) Do not change “SD” during message sending. Otherwise, the send data cannot be guaranteed.
4) If the number of data specified in “SIZE” exceeds the variable size specified in “SD,” the data for the excess part becomes
undefined. Be sure to enter the specified variable size for “SIZE.”
5) The send request “REQ” must be programmed to be turned ON after “VALID” of M_OPEN turns ON.

(2) FB format
1) For D300win
FB No. (instance name)

M_SEND_
Data type Data type

M_SEND

BOOL REQ DONE BOOL

UINT CON_NO ERROR BOOL

STATUS INT

ANY SD SD ANY

UINT SIZE

2) For Standard loader

4-29
Section 4 Communication Procedures
(3) Description of terminals
Terminal function Terminal name Data
I/O Description
name (parameter) type
Send request REQ BOOL IN Data set in “SD” is sent at the rising edge of this signal.
Connection No. CON_NO UINT IN Set the connection No. that is opened by M_OPEN.
Connect the “CON_NO” terminal of M_OPEN to this terminal.
Send data size *1, 2 SIZE UINT IN Set the size of data to be sent in units of words.
Send data *3, 4 SD ANY IN-OUT Connect a variable where data to be sent is stored.
Send end DONE BOOL OUT Turns ON for one scan when the message sending is
completed normally.
Send error ERROR BOOL OUT Turns ON for one scan when the message sending ends
abnormally.
Status *5 STATUS INT OUT Outputs the result of the message sending by a status code.

*1 When “Destination Addition mode” is enabled, four words of destination information are added to the send buffer.
The send data size "SIZE" must be the send data size plus four words.
*2 When “byte” is selected for “send data length selection,” the first one word of the send buffer is the data size.
The send data size "SIZE" must be the send data size plus one word.
*3 When “Destination Addition mode” is enabled, four words of destination information are added to the send buffer.
The send data “SD” must be the send data size plus four words.
*4 When “byte” is selected for “send data length selection,” one word of send size information is added to the send buffer.
The send data “SD” must be the send data size plus one word.
*5 Status

Error code Cause


Message sending delay
164 • Message communication is delayed on the SX bus. (Multiple message communications may be simultaneously
started up.)
Message receiving busy
• No message can be sent because the message transmission line of the SX bus is busy. (After waiting for a
165
while, re-execute the FB. If this error frequently occurs, the message transmission load of the remote node
may be too high.)
Parameter error
177 • 0 was entered in the SIZE terminal.
• The variable that stores send data exceeds the specified memory area.
Message sending error (communication error between the Ethernet module and other nodes)
• No data can be sent to the target communication module.
195 • No response is returned from the target communication module (sending is completed, however, no ACK is
returned).
• Other transmission errors on the network
Channel forcible close (communication error between the Ethernet module and other nodes)
• The Ethernet module received a close request from the remote node.
199 Note:
If the Ethernet module receives this code, close the corresponding port once, and then re-execute the open
processing.
Buffer over
• The number of send data exceeds 1017 words.
206
• When sending data via a communication module, the number of send data exceeds the number that the
communication module can send.
Connection No. error
• A connection No. that is not yet opened is used.
207
• A currently used connection No. is used.
(When two M_SEND FBs are used in parallel for one connection)

4-30
Section 4 Communication Procedures

4-4-4 Receive message (M_RECEIVE)


Receive message (M_RECEIVE) FB is used to receive data from the remote node to which SX_CPU opens a communication
channel to enable communication in general purpose communication mode or fixed buffer communication mode.

(1) Operation of the instruction


1) At the rising edge of “EN_R,” the FB receives a message from the station that has the connection No. set in “CON_NO.”
(The receiving processing is not completed within one scan.)
2) When the message receiving is completed normally, “NDR” turns ON for one scan.
3) If the message receiving is not completed normally, “ERROR” turns ON for one scan, and "STATUS" outputs the
corresponding error code.

Notes:
1) Up to 1017 words of data can be received at a time.
2) During message receiving (until “NDR” or “ERROR” turns ON after the rising edge of “EN_R”), keep “EN_R” ON.
Turning OFF “EN_R” halts message receiving.
3) Turning ON “EN_R” again resumes message receiving after being halted. Even if “CON_NO,” “SD,” or “SIZE” has been
changed, the receiving is resumed using the values set before being halted. The change is not reflected to the message
receiving processing
4) If “EN_R” remains ON in the next scan after the message receiving is completed, new message receiving processing starts.
5) Do not change “RD” during message receiving. Otherwise, the receive data cannot be guaranteed.
6) If the number of data specified in “SIZE” exceeds the variable size specified in “RD,” the data for the excess part becomes
undefined. Be sure to enter the specified variable size for “SIZE.”
7) The receive request “EN_R” must be programmed to be turned ON after “VALID” of M_OPEN turns ON.

(2) FB format
1) For D300win
FB No. (instance name)

Data type M_RECEIVE_ Data type

M_RECEIVE

BOOL EN_R NDR BOOL

UINT CON_NO ERROR BOOL

STATUS INT

ANY RD RD ANY

UINT SIZE

2) For Standard loader

4-31
Section 4 Communication Procedures
(3) Description of terminals

Terminal function Terminal name Data


I/O Description
name (parameter) type
Receive enable ENR BOOL IN When this signal is ON, receiving is enabled and the Ethernet
module is ready for receiving a message.
Connection No. CON_NO UINT IN Set the connection No. that is opened by M_OPEN.
Connect the “CON_NO” terminal of M_OPEN to this terminal.
Receive data size SIZE UINT IN Set the size of data to be received (the size of the variable
*1, 2 connected to RD) in units of words.
Receive data *3, 4 RD ANY IN-OUT Connect a variable in which received data is stored.
Receive end NDR BOOL OUT Turns ON for one scan when the message receiving is
completed normally.
Receive error ERROR BOOL OUT Turns ON for one scan when the message receiving ends abnormally.
Status *5 STATUS INT OUT Outputs the result of the message receiving by a status code.

*1 When “Destination Addition mode” is enabled, four words of destination information are added to the receive buffer.
The receive data size "SIZE" must be the receive data size plus four words.
*2 When “Receive data length storage” is enabled,” one word of receive data length is added to the top of the receive buffer.
The receive data size "SIZE" must be the receive data size plus one word.
*3 When “Destination Addition mode” is enabled, four words of destination information are added to the receive buffer.
The receive data “RD” must be the receive data size plus four words.
*4 When “Receive data length storage” is enabled,” one word of receive data length is added to the top of the receive buffer.
The receive data “RD” must be the receive data size plus one word.
*5 Status

Error code Cause


Message sending BUSY
165 • No message can be sent because the message transmission line of the SX bus is busy. (After waiting for a
(Note) while, re-execute the FB. If this error frequently occurs, the message transmission load of the remote node
may be too high.)
Parameter error
177 • 0 was entered in the SIZE terminal.
• The variable that stores send data exceeds the specified memory area.
196 Message receiving error (communication error between the Ethernet module and other nodes)
Channel forcible close (communication error between the Ethernet module and other nodes)
• The Ethernet module received a close request from the remote node.
199 Note:
If the Ethernet module receives this code, close the corresponding port once, and then re-execute the open
processing.
Buffer over
206
• Data was received exceeding the specified receive data size.
Connection No. error
• A connection No. that is not yet opened is used.
• "EN_R" (receive enable) is ON when "EN_C" (open request) of M_OPEN is OFF.
207 * An application program must be created such that "receive enable" also turns OFF when the open request of
M_OPEN turns OFF.
• A currently used connection No. is used.
(When two M_RECEIVE FBs are used in parallel for one connection)

Note:
According to the “working information” of detail RAS, check the following items:
• SMC send 16 collision (offset address: 00000020)
• SMC send memory allocation incomplete (TASK) (offset address: 00000028)
• SMC send memory allocation (INT) (offset address: 00000030)
• SMC receive overrun (offset address: 00000090)
• SMC receive USNET buffer full (offset address: 000000A0)
If any of these counters is up, the load of the network line may be too heavy. Reduce the load of the network line.

4-32
Section 4 Communication Procedures
<Notes on using M_SEND and M_RECEIVE>
1) In general purpose communication mode using UDP/IP protocol, neither receipt confirmation nor flow control is performed.
If the processing on the receiver side is too slow, the receive buffer becomes full and the data sent thereafter is discarded.
As a result, mismatch occurs between the number of data sent from the sender and the number of data received by the
receiver.
Since it takes approximately 10 seconds to release the buffer that becomes full, data receive processing may be halted
in the interim.
2) In Full Passive open mode, if the FB receives an open request from a remote node whose IP address and/or port No. do not
match, the connection is established first, and then Full Passive side issues a close request to the Active side.
As a result, on the Active side, “channel forcible close” error (error code 199) occurs after port open processing is completed
normally and data is sent.
3) If the port No. on the sender side does not match that on the receiver side, a send error occurs and the sender side forcibly
closes the port. As a result, “channel forcible close” error (error code 199) occurs.
4) During communication between MICREX-SX devices, if one-word sending operation is performed consecutively, the receiver
side may receive two words by linking the first received one word with the second received one word depending on the
timing of M_RECEIVE. When one-word data is sent, the buffer area for two words must be secured on the receiver side.
When two or more words are sent, the buffer area for the same number of words as that of send data must be secured on
the receiver side.
5) When data is sent after converted into ASCII code in general purpose communication mode using UDP/IP protocol, if the
number of bytes of send data exceeds 1017, the sender side divides the data into two pieces and performs the send
processing twice to send them separately. Therefore, the receiver side needs to receive a receive request twice. In addition,
the buffer area of the receiver side must be greater than the send data.

<Status 206 of M_RECEIVE>


This error occurs if the size of data that the Ethernet module receives (receive data size in the Ethernet module) exceeds the
size specified in "SIZE" of the FB.
For example, if data packet that the communication partner sends is larger than the size specified in "SIZE", or if a receive data
packet merging phenomenon occurs in the Ethernet module and the merged data size exceeds the size specified in "SIZE," this
error occurs.

<Status 207 of M_RECEIVE>


This error does not occur in the following conditions:
• When the output "VALID" of M_OPEN is directly connected to "EN_R" of M_RECEIVE
• When the output "CON_NO" of M_OPEN is directly connected to "CON_NO" of M_RECEIVE
Once a channel is opened (the input "EN_C" of M_OPEN turns ON and then the output "VALID" turns ON), use the FB in a data
receive waiting state (keep the input "EN_R" of M_RECEIVE ON) in the case of message receiving. While "EN_R" is ON, the
application program continues to set a receive request to the internal system of the CPU module. After this, when a channel
is closed (the input "EN_C" of M_OPEN turns OFF, the output "VALID" turns OFF, and then the input "EN_R" of M_RECEIVE
turns OFF), and then opened again (the input "EN_C" of M_OPEN turns ON and then the output "VALID" turns ON), "STATUS"
of M_RECEIVE outputs the error 207. This is because a receive request remains in the internal system of the CPU module. No
receive error occurs in Ethernet. When the FB receives data from a communication partner, the error 207 is eliminated. ("STATUS"
is set to 0.)

4-33
Section 4 Communication Procedures

4-4-5 Remote data write (R_WRITE)


Remote data write FB (R_WRITE) is used in loader command communication mode to write data directly to the internal
memory in a CPU of a MICREX-SX system via Ethernet from an SX_CPU. This FB can be used only when the remote node is
an SX system.

(1) Operation of the instruction


1) At the rising edge of "REQ," data set in “SD” is written into the area that is specified in “MODULE_NO,” “CHANNEL_NO,”
“STATION_NO,” and “REMOTE_VAR.” (This processing is not completed within one scan.)
2) When the writing is completed normally, “DONE” turns ON for one scan.
3) If the writing is not completed normally, “ERROR” turns ON for one scan and “STATUS” outputs the corresponding error
code.

Notes:
1) “REQ” is enabled at its rising edge, however, additional “REQ” command is disabled during data writing (until “DONE” or
“ERROR” turns ON after the rising edge of “REQ.”)
2) Do not change “SD” during data writing. Otherwise, the write data cannot be guaranteed.
3) When “VAR_TYPE” is set to 0, “SIZE” is not limited. When set to a value other than 0, “SIZE” is limited by the
communication module through which data is written.
4) If the number of data specified in “SIZE” exceeds the variable size specified in “SD,” the data for the excess part becomes
undefined. Be sure to enter the specified variable size for “SIZE.”
5) To execute “R_WRITE” consecutively, set the default maximum TCP end timer value to 0.
6) To execute “R_READ and/or “R_WRITE,” set the self port standard No. and communication target port standard No. to the
default values (256).

(2) FB format
1) For D300win

FB No. (instance name)

Data type R_WRITE_ Data type

R_WRITE

BOOL REQ DONE BOOL

UINT MODULE_NO ERROR BOOL

UINT CHANNEL_NO STATUS INT

UDINT STATION_NO

UINT VAR_TYPE

ANY REMOTE_VAR REMOTE_VAR ANY

UINT SIZE

ANY SD SD ANY

4-34
Section 4 Communication Procedures
2) For Standard loader

(3) Description of terminals

Terminal function Terminal name Data


I/O Description
name (parameter) type
Write request REQ BOOL IN At the rising of this signal, the FB executes the writing.
Communication MODULE_NO UINT IN Specify the SX bus station No. of the communication target
module No. Ethernet module (self module).
Communication CHANNEL_NO UINT IN Fixed to 0 for the Ethernet module
channel No.
Remote station No. STATION_NO UDINT IN Specify the IP address of the remote node.
Variable specification VAR_TYPE UINT IN Set the method for specifying variables.
method Fixed to 0 for the Ethernet module
Target variable to REMOTE_VAR ANY IN-OUT Specify the destination SX_CPU (first address) where data is
access *1 written.
Write data size SIZE UINT IN Set the size of data to be written in units of words.
Write data SD ANY IN-OUT Connect a variable where data to be written is stored.
Write end DONE BOOL OUT Turns ON for one scan when the writing is completed normally.
Write error ERROR BOOL OUT Turns ON for one scan when the writing fails.
Status *2 STATUS INT OUT Outputs the result of the writing by a status code.

4-35
Section 4 Communication Procedures
*1 Target variable to access (REMOTE_VAR)
Specify the destination memory in the SX_CPU in the following format:

<For D300win>
15 0
CPU No.
UINT type array Memory type
with data of 4 elements
Low byte of address

High byte of address

Standard memory: UINT#1


Retain memory: UINT#3
System memory: UINT#10
Note:
No other values are allowed for the memory type.

<For Standard loader>


15 (F) 0
CPU No.

Consecutive Memory type


data areas
Low byte of address

High byte of address

Standard memory: 1 (H1)


Retain memory: 3 (H3)
System memory: 10 (HA)
Note:
No other values are allowed for the memory type.

*2 Status

Error code Cause


Transmission interlock error
35
• The target CPU is performing some operation such as downloading.
Memory address setting error
68
• The address specified in REMOTE_VAR is wrong.
Memory size over
69
• The address specified in REMOTE_VAR + SIZE exceeds the effective address range of the target CPU.
Message send destination setting error
160 • No module exists at the SX bus station No. specified in MODULE_NO.
• The CPU No. for the communication partner set by REMOTE_VAR does not exist.
Internal resources depleted
171 • If five or more R_READ/R_WRITE FBs are simultaneously executed in one CPU, internal resources may be
depleted and this error occurs.
Parameter error
• 0 was entered in the SIZE terminal.
177
• An out-of range values is entered in VAR_TYPE.
• No module exists at the station No. specified in MODULE_NO.
Channel open error
193
• An abnormal value is set for the station No.
Client port full
201 • Ports exceeding the specified number were attempted to be opened in one communication module.
(Up to 16 ports can be opened for the Ethernet module in total of all the communication modes.)

4-36
Section 4 Communication Procedures

4-4-6 Remote data read (R_READ)


Remote data read FB (R_READ) is used to directly read data in the CPU internal memory of a MICREX-SX system from a
SX_CPU via Ethernet.

(1) Operation of the instruction


1) At the rising edge of "REQ," data specified in “MODULE_NO,” “CHANNEL_NO,” “STATION_NO,” and “REMOTE_VAR” is
read to the variable area specified in “RD.” (This processing is not completed within one scan.)
2) When the reading is completed normally, “DONE” turns ON for one scan.
3) If the reading is not completed normally, “ERROR” turns ON for one scan and “STATUS” outputs the corresponding error
code.

Notes:
1) additional “REQ” command is disabled during data reading (until “DONE” or “ERROR” turns ON after the rising edge of
“REQ").
2) Do not change “RD” during data reading. Otherwise, the read data cannot be guaranteed.
3) When “VAR_TYPE” is set to 0, “SIZE” is not limited. When set to a value other than 0, “SIZE” is limited by the
communication module through which data is read.
4) If the number of data specified in “SIZE” exceeds the variable size specified in “RD,” another variable area is rewritten. Be
sure to enter the specified variable size in “SIZE”.
5) To execute “R_READ” consecutively, set the default maximum TCP end timer value to 0.

(2) FB format
1) For D300win

FB No. (instance name)

Data type R_READ_ Data type

R_READ

BOOL REQ DONE BOOL

UINT MODULE_NO ERROR BOOL

UINT CHANNEL_NO STATUS INT

UDINT STATION_NO

UINT VAR_TYPE

ANY REMOTE_VAR REMOTE_VAR ANY

UINT SIZE

ANY RD RD ANY

4-37
Section 4 Communication Procedures
2) For Standard loader

(3) Description of terminals

Terminal function Terminal name Data


I/O Description
name (parameter) type
Read request REQ BOOL IN At the rising of this signal, the FB executes the reading.
Communication MODULE_NO UINT IN Specify the SX bus station No. of the communication target
module No. Ethernet module (self module).
Communication CHANNEL_NO UINT IN Fixed to 0 for the Ethernet module
channel No.
Remote station No. STATION_NO UDINT IN Specify the IP address of the remote node.
Variable specification VAR_TYPE UINT IN Set the method for specifying variables.
method Fixed to 0 for the Ethernet module
Target variable to REMOTE_VAR ANY IN-OUT Specify the destination SX_CPU (first address) where data is read.
access *1
Read data size SIZE UINT IN Set the size of data to be read in units of words.
Read data SD ANY IN-OUT Connect a variable where data to be read is stored.
Read end DONE BOOL OUT Turns ON for one scan when the reading is completed normally.
Read error ERROR BOOL OUT Turns ON for one scan when the reading fails.
Status *2 STATUS INT OUT Outputs the result of the reading by a status code.

4-38
Section 4 Communication Procedures
*1 Target variable to access (REMOTE_VAR)
Specify the destination memory in the SX_CPU in the following format:

<For D300win>
15 0
CPU No.
UINT type array Memory type
with data of 4 elements
Low byte of address

High byte of address

Standard memory: UINT#1


Retain memory: UINT#3
System memory: UINT#10
Note:
No other values are allowed for the memory type.

<For Standard loader>


15 (F) 0
CPU No.

Consecutive Memory type


data areas
Low byte of address

High byte of address

Standard memory: 1 (H1)


Retain memory: 3 (H3)
System memory: 10 (HA)
Note:
No other values are allowed for the memory type.

*2 Status

Error code Cause


Transmission interlock error
35
• The target CPU is performing some operation such as downloading.
Memory address setting error
68
• The address specified in REMOTE_VAR is wrong.
Memory size over
69
• The address specified in REMOTE_VAR + SIZE exceeds the effective address range of the target CPU.
Message send destination setting error
160 • No module exists at the SX bus station No. specified in MODULE_NO.
• The CPU No. for the communication partner set by REMOTE_VAR does not exist.
Internal resources depleted
171 • If five or more R_READ/R_WRITE FBs are simultaneously executed in one CPU, internal resources may be
depleted and this error occurs.
Parameter error
• 0 was entered in the SIZE terminal.
177
• An out-of range values is entered in VAR_TYPE.
• No module exists at the station No. specified in MODULE_NO.
Channel open error
193
• An abnormal value is set for the station No.
Client port full
201 • Ports exceeding the specified number were attempted to be opened in one communication module.
(Up to 16 ports can be opened for the Ethernet module in total of all the communication modes.)

4-39
Section 5 Sample Programs
This section introduces sample programs for D300win loader. When you use Standard loader, create sample programs using
the following examples as a reference.

5-1 General Purpose Communication Mode


This subsection shows a sample program to send data from the configuration A to the configuration B in general purpose
communication mode under the following system configuration.

<System configuration>

Hub

Configuration A Configuration B
(sender side) (receiver side)

MICREX-SX MICREX-SX
Ethernet interface module A Ethernet interface module A
SX bus station No.: 1 SX bus station No.: 3
IP address: 192.0.0.7 IP address: 192.0.0.8

<Operation of the sample program>


The sample program sends 5 words of word type data from the memory (variable) of the CPU in the configuration A to the
memory (variable) of the CPU in the configuration B.

<Execution sequence of the communication program>


1) Executes M_OPEN in the configuration B (receiver side) to open a port on the receiver side.
2) Executes M_RECEIVE in the configuration B (receiver side) to make the module ready for receiving data.
3) Executes M_OPEN in the configuration A (sender side) to open a port on the sender side.
4) Executes M_SEND In the configuration A (sender side) to send data.

5-1
Section 5 Sample Programs
(1) Project tree
The sample program shown above has the following project tree configuration.

Declaration of data type

POU for data receiving side Variable worksheet for


data receiving side

Code worksheet for


POU for data sending side data receiving side

Variable worksheet for


data sending side

Code worksheet for


data sending side

Configuration A
Data sending side
Assigned to the default task

Global worksheet for


configuration A
Configuration B
Data receiving side
Assigned to the default task

Global worksheet for


configuration B

(2) Declaration of data type


Declare the data type of word type array of 5 words to communicate 5 words of data.

* In this example, the name "WORD_1_5" is given so that the starting and end element Nos. of array and the data type of
elements can be known.

(3) Data sending program (configuration A side)


1) Global variable worksheet

5-2
Section 5 Sample Programs
2) Local variable worksheet

3) Code worksheet

Repeats the sending because the inverted


signal of send end flag "S_OK” is used as
the trigger for starting the sending.

Always fixed to 0 

Always fixed to 1

Receipt confirmation
is enabled

Remote port No.

Local port No.

15 8 7 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0

Communication mode
001: General Purpose Communication mode
Open mode Automatic reopen
00: Active 0: Disabled (Always fixed to 0 on the active side)

5-3
Section 5 Sample Programs
(4) Data receiving program (configuration B side)
1) Global variable worksheet

2) Local variable worksheet

3) Code worksheet

Repeats the receiving while the port is open.

SX bus station No. of ET1 

Always fixed to 0 

Always fixed to 0 

Receipt confirmation
is enabled

Remote port No.

Local port No.

15 8 7 0
1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0

Communication mode
001: General Purpose Communication mode
Open mode Automatic reopen
10: Unpassive 1: Enabled

5-4
Section 5 Sample Programs

5-2 Loader Command Communication Mode


This subsection shows a sample program to write data into the CPU in the configuration B from the configuration A and to read
data from the CPU in the configuration B in loader command communication mode under the following system configuration.

<System configuration>

Hub

Configuration A Configuration B
(read/write requesting side) (loader command responding side)

MICREX-SX MICREX-SX
Ethernet interface module A Ethernet interface module A
SX bus station No.: 1 SX bus station No.: 3
IP address: 192.0.0.7 IP address: 192.0.0.8

<Operation of the sample program>


The sample program writes data from the CPU in the configuration A to the memory (variable) of the CPU in the configuration
B (data writing program) or reads data from the memory (variable) of the CPU in the configuration B to the CPU in the
configuration A (data reading program).
* In the case of this sample program, no communication program is necessary on the configuration B side.

<Execution sequence of the communication program: Data writing>


1) Executes R_WRITE in the configuration A (which issues a data write request).

<Execution sequence of the communication program: Data reading>


1) Executes R_READ in the configuration A (which issues a data read request).

5-5
Section 5 Sample Programs
(1) Project tree
The sample program shown above has the following project tree configuration.

Declaration of data type

POU for data writing Variable worksheet

Code worksheet
POU for data reading

Variable worksheet

Code worksheet

Assigned to the default task

(2) Declaration of data type


Declare the data type of word type array of 5 words to write or read 5 words of data.
In addition, declare the data type of UINT type array of 4 words to specify the memory of the CPU in the destination node
(configuration B).

* In this example, the names "WORD_1_5" and "UINT_1_4" are given so that the starting and end element Nos. of array
and the data type of elements can be known.

5-6
Section 5 Sample Programs
(3) Data writing program
1) Local variable worksheet

2) Code worksheet

(* Top address of destination memory area %MW1.2048 *)

 Remote SX_CPU No.


 Memory type (1: standard memory %MW1.*)
 Low byte of address
 High byte of address

Start to write 

SX bus station No. of ET1 

Always fixed to 0 
IP address of

remote node
Always fixed to 0 

Number of words of write data →

Write data →

5-7
Section 5 Sample Programs
(4) Data reading program
1) Local variable worksheet

2) Code worksheet

(* Top address of destination memory area %MW1.0 *)


 Remote SX_CPU No.
 Memory type (1: standard memory %MW1.*)
 Low byte of address
 High byte of address

Start to read 

SX bus station No. of local ET1 

Always fixed to 0 
IP address of

remote node
Always fixed to 0 

Number of words of read data 

Read data 

5-8
Section 6 Failure Diagnosis

6-1 Failure Diagnosis


To diagnose NP1L-ET1/ET2, use the failure diagnosis function of the loader. On the "Failure Diagnosis" screen, select the
Ethernet module to display various information related to the module. This section describes the information related to the
Ethernet module. (The screen layout differs depending on the loader version. This section describes the failure diagnosis screen
when using D300win Version 3 and the Standard loader.)

<Content of system RAS>


Click the [System RAS] tab to display the following information.

(1a) Type information


Displays model, type and software version of the Ethernet module.

(1b) Module intensive status information


Displays intensive status information for the Ethernet module.

<List of displayed messages>

Class Displayed message Description


Normal Module valid running Initialization is completed and module is running normally.
Module fatal fault: WDT up error This is a hardware fault. Replace the module.
Module fatal fault: CPU error This is a hardware fault. Replace the module.
Module fatal fault: ROM error This is a hardware fault. Replace the module.
Fatal fault
Module fatal fault: RAM error This is a hardware fault. Replace the module.
Module fatal fault: SX bus error This is a hardware fault. Replace the module.
Module fatal fault: ROM write error This is a hardware fault. Replace the module.
Nonfatal fault Module nonfatal fault: Setting error Initialization error

6-1
Section 6 Failure Diagnosis
<Content of bus transmission>
Click the [Bus transmission] tab to display the following information.

(2) SX bus transmission information


The [Bus transmission] tab window displays error information related to SX bus transmission that the Ethernet module detected.
This information is counted up when the transmission waveform of the SX bus is disturbed by noise or other causes.

<List of SX bus transmission statuses>

SX bus transmission status Description


CRC error detected counter (Valid stamp) Counted up if a CRC error is detected but stamp is valid.
Symbol error detected counter Counted up if a symbol error is detected.
Frame length error detected counter Counted up if a frame length error is detected.
Counted up if disconnection is detected (if transmission is stopped for 130 ms or
Disconnection detected counter
longer time.)
CRC error detected counter Counted up if a CRC error is detected.
Frame error detected counter Counted up if frame receiving is stopped during the frame receiving
Counted up if SD (the code indicating the top of a frame) is received during the
SD detected counter
frame receiving.
Counted up if END is not at the specified position during the 1st cycle of total
TF1 END position detected counter
frame receiving.
Counted up if END is not at the specified position during the 2nd cycle of total
TF2 END position detected counter
frame receiving.
Counted up if an error is found in a received frame during the 2nd cycle of total
TF2 stamp error detected counter
frame receiving.
Counted up if buffer full is detected during total frame receiving or multicast
Buffer full 1 detected counter
frame receiving.
Buffer full 2 detected counter Counted up if buffer full is detected during message, ACK or NAK receiving.
Buffer full 3 detected counter Counted up if buffer full is detected during token frame receiving.

6-2
Section 6 Failure Diagnosis
<Content of dump list>
Click the [Dump list] tab to display the following information.

(3) Error logging function


This function stores the error information detected during Ethernet communication. Error logs are stored in ring files.
Using 2 words for one information, maximum 119 error information can be stored.

Maximum
number of data
Pointer to newest data
Pointer to the top of data part Data size
Reserved

0000:0008 0077 0002 00F4 0000 0000 0000 0000


0008:0000 0000 0000 0000 0000 0000 0000 0000 Error code

00E8:0000 0000 0000 0000 0000 0000 0000 0000


00F0:0000 0000 0000 0000 0000 0000

+00h Pointer to the top of data part  Fixed to 8

+01h Maximum number of data  Fixed to 119

+02h Data size  Fixed to 2

+03h Pointer to newest data

+04h
Reserved

+08h Error code * For the error codes, see (9) Error code.

+F5h
6-3
Section 6 Failure Diagnosis
(4) SX bus message communication count information
This function stores the total number of SX bus message communication operations.

(L) (H) (L) (H) (L) (H) (L) (H)


0000: 0000 0000 0000 0000 00D2 0000 0000 0000
Total number of Total number of Total number of Total number
successfully successfully abnormally of NACK
completed completed ended sending received
sending receiving operations operations
operations operations

6-4
Section 6 Failure Diagnosis
(5) Initializing information
The "Initializing information" area displays information such as the Ethernet address, IP address, and gateway setting of the
Ethernet module.

Initializing information consists of top address and data part, as shown below.

Top address Data


0000: Item 0 Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Item 7
0008: Item 8 Item 9 Item A Item B Item C Item D Item E Item F
0010: Item 10 Item 11 Item 12 Item 13 Item 14 Item 15 Item 16 Item 17
0018: Item 18 Item 19 Item 1A Item 1B Item 1C Item 1D Item 1E Item 1F
0020: Item 20 Item 21

6-5
Section 6 Failure Diagnosis
The tables below show the contents of the data part.
This information includes network parameter setting of the Ethernet module that is downloaded from the loader.
Although the setting in the loader is made in decimal, it is stored in hexadecimal in the initializing information.

Note:
Item No. 16 and the following items are supported by the following version of loader and Ethernet module.
• NP1L-ET1/ET2 firmware version: V36 or later
• D300win: V3.1.2.0 or later version, or
Standard loader: V2.0.0.0 or later version

Item No. Description Item No. Description


0 Ethernet address for local station (L) 10 IP address for default gateway (L)
1 Ethernet address for local station (M) 11 IP address for default gateway (H)
2 Ethernet address for local station (H) 12 Gateway 1 - Network address (L)
3 IP address for local station (L) 13 Gateway 1 - Network address (H)
4 IP address for local station (H) 14 Gateway 1 - IP address (L)
5 Sub-net mask (L) 15 Gateway 1 - IP address (H)
6 Sub-net mask (H) 16 Gateway 2 - Network address (L)
7 TCP send time-out value 17 Gateway 2 - Network address (H)
8 Maximum TCP end timer value 18 Gateway 2 - IP address (L)
9 Response monitoring timer value 19 Gateway 2 - IP address (H)
A Server FTP command monitoring timer value 1A Gateway 3 - Network address (L)
B Client FTP connection monitoring timer value 1B Gateway 3 - Network address (H)
C Fixed to 0001 1C Gateway 3 - IP address (L)
D Self port standard No. 1D Gateway 3 - IP address (H)
E Communication target port standard No. 1E Gateway 4 - Network address (L)
F Fixed to 0000 1F Gateway 4 - Network address (H)
20 Gateway 4 - IP address (L)
21 Gateway 4 - IP address (H)

An example of how to read the initializing information is shown below.

Ethernet address IP address

0000: 104A 1A12 0040 0007 C000 0000 0000 0000


0008: 0000 0000 0000 0000 0000 0000 0000 0000
Unused

104A  Ethernet address (L) Ethernet address is


1A12  Ethernet address (M)
00041A12104A
0040  Ethernet address (H)
IP address is
0007  IP address (L)
C0 00 00 07 192.0.0.7
C000  IP address (H)
192 0 0 7

6-6
Section 6 Failure Diagnosis
(6) Communication channel information
The communication channel information area displays information at the time when communication channels specified by the
client port number of the Ethernet module opened (for 16 channels at the maximum). The displayed information includes the
communication mode, port No. of local module and the port No. of remote node.

0000:0000 0000 0000 0000 0000 0000 0000 0000


0008:0000 0000 0000 0000 0000 0000 0000 0000 Server port

0028:0000 0000 0000 0000 0000 0000 0000 0000


0030:0002 0101 0008 C000 0102 0000 0000 0000 Client port
(channel information 1)
0038:0000 0000 0000 0000 0000 0000 0000 0000
0040:0000 0000 0000 0000 0000 0000 0000 0000
0048:0000 0000 0000 0000 0000 0000 0000 0000 Client port
0050:0000 0000 0000 0000 0000 0000 0000 0000 (channel information 2)
0058:0000 0000 0000 0000 0000 0000 0000 0000

0198:0000 0000 0000 0000 0000 0000 0000 0000 Client port
01A0:0000 0000 0000 0000 0000 0000 0000 0000 (channel information 16)
01A8:0000 0000 0000 0000 0000 0000 0000 0000

+00h
Server port Server port
+29h
+30h Communication mode
* For the details of the communication mode,
see "4-4-2 Open channel (M_OPEN)."
+31h Port No. of local module
+32h IP address (L) of remote node
Client port
+33h IP address (H) of remote node (channel information 1)
+34h Port No. of remote node
+34h
Not used
(Fixed to 0)
+47h

Client port
+1AFh (channel information 16)

6-7
Section 6 Failure Diagnosis
(7) Channel communication state information
"Channel communication state information" area displays the information when individual communication channels specified by
client port No. of the Ethernet module open (for 16 channels at the maximum). The first 48 words indicate the communication
status of the server port.

0000:0000 0000 0000 0000 0000 0000 0000 0000


0008:0000 0000 0000 0000 0000 0000 0000 0000 Server port

0028:0000 0000 0000 0000 0000 0000 0000 0000


0030:0000 0000 0000 0000 0000 0000 0000 0000 Client port
(communication status of channel 1)
0038:0000 0000 0000 0000 0000 0000 0000 0000
0040:0000 0000 0000 0000 0000 0000 0000 0000
0048:0000 0000 0000 0000 0000 0000 0000 0000 Client port
(communication status of channel 2)
0050:0000 0000 0000 0000 0000 0000 0000 0000
0058:0000 0000 0000 0000 0000 0000 0000 0000

Client port
0198:0000 0000 0000 0000 0000 0000 0000 0000
(communication status of channel 16)
01A0:0000 0000 0000 0000 0000 0000 0000 0000
01A8:0000 0000 0000 0000 0000 0000 0000 0000

+00h Open status code +08h Status of fixed buffer overwrite +10h Send count
Open error code Number of receive data Send error count
Send status code Sending processing time (max.) Receive count
Send error code Sending processing time (min.) Receive error count
Fixed buffer communication mode response code Sending processing time (latest) Not used
Number of send data Receiving processing time (max.) Not used
Receive status code Receiving processing time (min.) Not used

+07h Receive error code +0Fh Receiving processing time (latest) +17h Not used

6-8
Section 6 Failure Diagnosis
1) Open status code
Indicates the open status of a channel. 0: Not open, 1: Opening, 2: Already open, 3: Closing, 8xh: Forcible close
2) Open error code
Stores a binary value for the error code that occurred while opening a channel.
For the details of open error codes, see "(9) Error code."
* The error code is cleared when the next open processing is normally completed or communication is started.
3) Send status code
Indicates the sending status. 0: No send request or sending completed, 1: Sending
4) Send error code
Stores a binary value for the error code that occurred while sending data.
For the details of open error codes, see "(9) Error code."
* The error code is cleared when the next open processing is normally completed, communication is started, or the sending is
normally completed.
5) Fixed buffer communication mode response code
Stores a binary value for the end code of the response that is returned when sending data in fixed buffer communication. For the
details of the end code of a response, see “4-3-2 Communication in fixed buffer communication mode."
* The error code is cleared when the next open processing is normally completed or communication is started.
6) Number of send data
Stores a binary value for the number of send data specified when send request is issued. If no send request has been issued, 0
is stored.
* The error code is cleared when the next open processing is normally completed or communication is started.
7) Receive status code
Indicates the receiving status. 0: No receive request or receiving completed, 1: Receiving, 2: Receive data exists (when there is
no receive request)
8) Receive error code
Stores a binary value for the error code that occurred while receiving data.
For the details of open error codes, see "(9) Error code."
* The error code is cleared when the next open processing is normally completed, communication is started, or the receiving is
normally completed.
9) Status of fixed buffer overwrite
Indicates whether or not the Ethernet module received data again (whether or not overwriting occurred) from when it receives
data from the remote node until it sends a response in fixed buffer communication mode.
0: Fixed buffer overwriting not occurred, 1: Fixed buffer overwriting occurred
* Fixed buffer overwriting status is cleared when the next open processing is normally completed or communication is started.
10) Number of receive data
Stores a binary value for the number of bytes of receive data that is transferred to the receive data storage area during receipt
confirmation after a data receive request is issued.
11) Sending processing time
Stores the maximum, minimum and current values of the sending processing time in each communication.
(a) Stores processing time as a binary value in steps of 10 ms.
(b) Stores the time from when the Ethernet module starts sending data onto the line until it notifies the CPU module of the
completion of the sending.
* This data is cleared when the next open processing is normally completed or communication is started.
12) Receiving processing time
Stores the maximum, minimum and current values of the receiving processing time in each communication.
(a) Stores processing time as a binary value in steps of 10 ms.
(b) Stores the time from when the Ethernet module starts receiving data from the line until it notifies the CPU module of the
completion of the receiving.

6-9
Section 6 Failure Diagnosis
13) Send count
Stores the total number of successfully completed operations for sending data to another node.
(a) Counted when the communication of command and response is normally completed.
(b) Counted when any of the following communications is normally completed.
• Sending data to another node in fixed buffer communication mode
• Sending data to another node in general purpose communication mode
• Transferring files to another node during server FTP/TFTP communication
• Transferring files to another node during client FTP/TFTP communication
* This data is cleared when the next open processing is normally completed or communication is started.
14) Send error count
Stores the total number of communication errors that occurred while sending data to another node (when the communication of
command and response ended abnormally).
* This data is cleared when the next open processing is normally completed or communication is started.
15) Receive count
Stores the total number of successfully completed operations for receiving data from another node.
(a) Counted when the communication of command and response is normally completed.
(b) Counted when any of the following communications is normally completed.
• Receiving data from another node in fixed buffer communication mode
• Receiving data from another node in general purpose communication mode
• Transferring files from another node during server FTP/TFTP communication
• Transferring files from another node during client FTP/TFTP communication
* This data is cleared when the next open processing is normally completed or communication is started.
16) Receive error count
Stores the total number of communication errors that occurred while receiving data from another node (when the communication
of command and response ended abnormally).
* This data is cleared when the next open processing is normally completed or communication is started.

6-10
Section 6 Failure Diagnosis
(8) Node connect information
Node connect information area displays the intensive information on the communication status of the individual communication
channels specified by the client port No. of the Ethernet module (for 16 channels at the maximum).

0000:0001 0001 0000 0000 0000 0000 0000 0000


0008:0000 0000 0000 0000 0000 0000 0000 0000 Connection status
0010:0000 0000 0000 0000 0000 0000 0000 0000
0018:0000 0000 0000 0000 0000 0000 0000 0000
0020:0000 0000 0000 0000 0000 0000 0000 0000
0028:0000 0000 0000 0000 0000 0000 0000 0000 Error code
0030:0000 0000 0000 0000 0000 0000 0000 0000
0038:0000 0000 0000 0000 0000 0000 0000 0000

+00h Connection status (Server port 1) 1) Connection status


Indicates the channel open status.
Connection status (Server port 2)
0: Not open
Connection status (Channel 1) 1: Opening
Connection status (Channel 2) 2: Already open
3: Closing
: 8x: Forcible close
:
2) Error code
+11h Connection status (Channel 16)
Stores a binary value for the error code that occurred when opening a
+12h
channel, sending data or receiving data.
:
:
Not used For the details of the error codes, see “(9) Error code."
+1Fh * This data is cleared when the next open processing is normally
completed or communication is started.
+20h Error code (Server port 1)
Error code (Server port 2)
Error code (Channel 1)
Error code (Channel 2)
:
:
+31h Error code (Channel 16)
+32h
:
Not used
:
+3Fh

6-11
Section 6 Failure Diagnosis
(9) Error code
The error codes and contents that are stored in the “error logging information”, “Channel communication state information” or “node
connect information” areas are described below.

15 8 7 0
1st word

Detail error code


Error detected channel No.
Error type 00h: Cannot pinpoint channel No.
0001: Parameter error 01h: Server port 1
0010: Sequence error 02h: Server port 2
0011: Communication error in upper layer 03h: Channel No. 1
0100: Communication error between physical
layer and transport layer
12h: Channel No. 16

Detail error code (only for error logging information)


15 8 7 0
2nd word

ICMP type ICMP code

6-12
Section 6 Failure Diagnosis
<Detailed error codes of each error type>
1) Parameter error

Code Description Timing of occurrence


01h The local module does not yet complete the processing for starting communication. During initialization
The number of bits of subnet mask is smaller than the number of bits of netmask that is
03h During initialization
obtained from the IP address of the Ethernet module.
The setting of IP address of default gateway or the gateway contains any of the following
errors:
04h • The IP address of the default gateway is set to "255.255.255.255". During initialization
• The network IP address of the gateway is set to "255.255.255.255".
• The IP address of the gateway is set to "0.0.0.0" or "255.255.255.255".
The IP address of the remote node is set to the same IP address as the local module,
10h During channel open
"0.0.0.0" or "255.255.255.255".
11h The port No. of the local module is set to a number from 0 to 255. During channel open
The same combination of "port No. of local module" and "port No. of other node" as that for
13h During channel open
already opened connection is set.
The IP address of the remote node is set to an IP address of another network that the local
15h During channel open
node cannot communicate with.
16h The communication mode setting is wrong. During channel open
20h The send data length exceeds the specified range (1017 words). During channel open
22h The receive data storage area is smaller than the receive data length. During channel open

2) Sequence error

Code Description Timing of occurrence


During channel open,
01h Local module does not yet complete the processing for starting communication.
sending or receiving
02h The open processing for the corresponding channel is not yet completed. During sending/receiving
03h Data was sent or received during channel close processing. During sending/receiving

3) Communication error in upper layer

Code Description Timing of occurrence


The end code of the response returned from the remote node was not 00h (normal end)
01h During sending/receiving
in fixed buffer communication mode.
02h No response was returned within the set response monitoring timer value. During sending/receiving
• The volume of data specified in the data length could not be received within the set
response monitoring timer value.
03h • The volume of actual data is smaller than the value specified in the data length. During sending/receiving
• The remaining part of the data divided at TCP/IP level could not be received within the
set response monitoring timer value.

6-13
Section 6 Failure Diagnosis
4) Communication error between physical layer and transport layer

Code Description Timing of occurrence


02h Connection could not be established during open processing for TCP communication. During channel open
03h A checksum error was found in the receive data during TCP communication.
04h A checksum error was found in the receive data during UDP communication.
• A TCP send timeout occurred during TCP/IP communication. During channel open, or
05h
• No ACK was returned from the remote node during TCP/IP communication. sending/receiving
An invalid IP address (network No.) is used.
06h (When the IP address of the IP packet sent to the remote node was different, an ICMP
error packet was received.) ICMP TYPE = 3, CODE = 0
An invalid IP address (host No.) is used.
07h (When the IP address of the IP packet sent to the remote node was the same, an ICMP
error packet was received.) ICMP TYPE = 3, CODE = 1
An invalid port No. is used.
08h (When the port No. of the IP packet sent to the remote node was not registered in the
remote node, an ICMP error packet was received.) ICMP TYPE = 3, CODE = 2, 3
When an IP packet was destroyed due to increased traffic, an ICMP error packet was
09h
received.) ICMP TYPE = 4
When assembly timeout occurred at the remote node, an ICMP error packet was
0Ah
received. ICMP TYPE = 11
An ICMP error packet not supported by the system was received.
0Bh The type and code of the received ICMP error packet are stored in the detail error code
area.
• No Ethernet address that corresponds to the specified IP address exists.
0Ch During channel open
• An invalid IP address (network No., host No.) or invalid port No. is used.
0Eh The head checksum of the received IP packet is abnormal.
0Fh A channel cannot be opened because the internal buffer for open processing is full. During channel open
10h A send error occurred. During sending/receiving
11h No send buffer could be secured. During sending/receiving
• During TCP/IP communication, a TCP timeout occurred.
12h During sending/receiving
• Data cannot be sent due to too small window size of the remote node.
13h Other errors related to the socket interface During sending/receiving

6-14
Section 6 Failure Diagnosis
(10) Working information
"Working information" consists of counter information and supplementary information. The counter information indicates the
number of occurrences of an event. The supplementary information is updated to the latest information every time an event
occurs.
This RAS information is supported by D300win the version of which is V3.1.0.0 or later, or V2.2.4.0 or later, and the Ethernet
module the software version of which is V34 or later.
The working information is classified into the following 5 groups:

Offset address (hex) Description


From 00000000 Related to Ethernet communication SMC91C111 (LANC)
From 000000C0 Related to Ethernet communication SMC91C111 (Physical)
From 00000100 Related to USNET socket I/F
From 00000150 Related to SBM communication
From 000001B0 Related to APP communication and PING sending

<Related to Ethernet communication SMC91C111 (LANC)>

Offset address (hex) Description


00000000 Counter: SMC initialization error
00000002 Supplementary information: None
00000004 Counter: SMC send delay collision
00000006 Supplementary information: None
00000008 Counter: SMC send carrier lost
0000000A Supplementary information: None
0000000C Counter: SMC send under run
0000000E Supplementary information: None
00000010 Counter: SMC send 16 collision
00000012 Supplementary information: None
00000014 Counter: SMC send memory allocation incomplete (TASK)
00000016 Supplementary information: None
00000018 Counter: SMC send memory allocation incomplete (INT)
0000001A Supplementary information: None
0000001C Counter: SMC send queuing
0000001E Supplementary information: None
00000020 Counter: SMC send queue full
00000022 Supplementary information: None
00000024 Counter: SMC send buffer no request source
00000026 Supplementary information: None
00000028 Counter: SMC send request (TASK)
0000002A Supplementary information: None
0000002C Counter: SMC send request (INT)
0000002E Supplementary information: None
00000030 Counter: SMC send completion
00000032 Supplementary information: None
00000034 Counter: SMC receive alignment error
00000036 Supplementary information: None
00000038 Counter: SMC receive CRC error
0000003A Supplementary information: None
0000003C Counter: SMC receive long packet
0000003E Supplementary information: None

6-15
Section 6 Failure Diagnosis

Offset address (hex) Description


00000040 Counter: SMC receive short packet
00000042 Supplementary information: None
00000044 Counter: SMC receive data size over
00000046 Supplementary information: None
00000048 Counter: SMC receive overrun
0000004A Supplementary information: None
0000004C Counter: SMC receive completion
0000004E Supplementary information: None
00000050 Counter: SMC receive USNET queue full
00000052 Supplementary information: None
00000054 Counter: SMC receive USNET buffer full
00000056 Supplementary information: None
00000058 Counter: SMC memory reset
0000005A Supplementary information: None
0000005C Counter: SMC restart
0000005E Supplementary information: None

<Related to Ethernet communication SMC91C111 (Physical)>

Offset address (hex) Description


00000060 Counter: Illegal 4B5B code detected in PHY receive data
00000062 Supplementary information: None
00000064 Counter: No starting point of stream delimiter found in PHY receive data
00000066 Supplementary information: None
00000068 Counter: No end point of stream delimiter found in PHY receive data
0000006A Supplementary information: None
0000006C Counter: PHY Jabber detected
0000006E Supplementary information: None
00000070 Counter: PHY changed over to full duplex
00000072 Supplementary information: None
00000074 Counter: PHY changed over to half duplex
00000076 Supplementary information: None
00000078 Counter: Reserved
0000007A Supplementary information:
0000007C Counter: Reserved
0000007E Supplementary information:

6-16
Section 6 Failure Diagnosis
<Related to USNET socket I/F>

Offset address (hex) Description


00000080 Counter: USN socket error
00000082 Supplementary information: Error code
00000084 Counter: USN bind error
00000086 Supplementary information: Error code
00000088 Counter: USN connect error
0000008A Supplementary information: Error code
0000008C Counter: USN listen error
0000008E Supplementary information: Error code
00000090 Counter: USN accept error
00000092 Supplementary information: Error code
00000094 Counter: USN send error
00000096 Supplementary information: Error code
00000098 Counter: USN sentto error
0000009A Supplementary information: Error code
0000009C Counter: USN recv error
0000009E Supplementary information: Error code
000000A0 Counter: USN recvfrom error
000000A2 Supplementary information: Error code
000000A4 Counter: USN closesocket error
000000A6 Supplementary information: Error code

<Related to SBM communication>

Offset address (hex) Description


000000A8 Counter: Abnormal end of sending NACK to SBM
000000AA Supplementary information: None
000000AC Counter: Abnormal end of other than sending NACK to SBM
000000AE Supplementary information: None
000000B0 Counter: Timeout of sending to SBM
000000B2 Supplementary information: Number of times of consecutively occurred PHY register data mismatch
000000B4 Counter: Retry over of sending to SBM
000000B6 Supplementary information: None
000000B8 Counter: Buffer full for receiving from SBM (FULL)
000000BA Supplementary information: None
000000BC Counter: Buffer full for receiving from SBM (NEARFULL)
000000BE Supplementary information: None
000000C0 Counter: Send request to SBM
000000C2 Supplementary information: None
000000C4 Counter: Normal end of sending to SBM
000000C6 Supplementary information: Test data
000000C8 Counter: Completion of receiving from SBM
000000CA Supplementary information: None
000000CC Counter: Reserved
000000CE Supplementary information:
000000D0 Counter: Reserved
000000D2 Supplementary information:
000000D4 Counter: Reserved
000000D6 Supplementary information:

6-17
Section 6 Failure Diagnosis
<Related to the processing of APP part>

Offset address (hex) Description


000000D8 Counter: Abnormal end of APP communication initialization
000000DA Supplementary information: None
000000DC Counter: Abnormal end of APP channel open
000000DE Supplementary information: None
000000E0 Counter: Abnormal end of APP channel open port specification
000000E2 Supplementary information: None
000000E4 Counter: APP channel open client port full
000000E6 Supplementary information: None
000000E8 Counter: APP channel open type error (other than Ethernet)
000000EA Supplementary information: None
000000EC Counter: APP channel open LDC server re-open
000000EE Supplementary information: None
000000F0 Counter: Abnormal end of APP channel close
000000F2 Supplementary information: None
000000F4 Counter: APP channel close unopened port
000000F6 Supplementary information: None
000000F8 Counter: APP channel close SA, SP mismatch
000000FA Supplementary information: None
000000FC Counter: APP channel close specified data count over
000000FE Supplementary information: None
00000100 Counter: APP connection server undefined command
00000102 Supplementary information: None
00000104 Counter: APP connection server split parameter error
00000106 Supplementary information: None
00000108 Counter: APP connection server communication command header error
0000010A Supplementary information: None
0000010C Counter: APP connection server forcible close
0000010E Supplementary information: None
00000110 Counter: Abnormal end of APP message send
00000112 Supplementary information: None
00000114 Counter: Abnormal end of APP message receive
00000116 Supplementary information: None
00000118 Counter: APP auto communication Error other than channel close error
0000011A Supplementary information: None
0000011C Counter: APP auto communication Channel close error
0000011E Supplementary information: None
00000120 to Counter: Related to PING sending (See the next page.)
0000013A
0000013C System time (H)
0000013E System time (L)

6-18
Section 6 Failure Diagnosis
<Related to PING sending>

Offset address (hex) Description


00000120 Counter: PING response normal receive and send/receive data match
00000122 Supplementary information: PING communication partner IP address
00000124 Counter: PING response normal receive and send/receive data mismatch
00000126 Supplementary information: PING communication partner IP address
00000128 Counter: PING send timeout
0000012A Supplementary information: PING communication partner IP address
0000012C Counter: PING send error
0000012E Supplementary information: BSD Socket Error Code
00000130 Counter: PING receive timeout
00000132 Supplementary information: PING communication partner IP address
00000134 Counter: PING receive error
00000136 Supplementary information: BSD Socket Error Code
00000138 Counter: PING request double issue
0000013A Supplementary information: PING communication partner IP address

* The "Communication channel information," "Channel communication state information," and "Node connect information" areas
do not output information related to PING communication.

6-19
Section 6 Failure Diagnosis
[Running status information occurrence conditions]
<Related to Ethernet communication SMC91C111 (LANC)>

Offset address (hex) Cause, conditions and timing of occurrence


SMC initialization error
00000000
During the initialization of LAN controller
SMC send delay collision
00000004 Collision that occurred out of collision detection time during half duplex communication at 10 Mbps
(illegal operation)
SMC send carrier lost
00000008
Occurs due to a disconnected cable or an unstable line during send operation.
SMC send under run
0000000C
Occurs when send FIFO of LANC is full.
SMC 16 collision
00000010
Occurs when collision occurs 16 times during half duplex communication at 10 Mbps. (Line load)
SMC send memory allocation incomplete (TASK)
00000014
LANC send buffer cannot be acquired. (Occurs under slightly heavy load.)
SMC send memory allocation incomplete (INT)
00000018
LANC send buffer cannot be acquired. (Occurs under slightly high load.)
SMC send queuing
0000001C
Operation counter when allocation is incomplete
SMC send queue full
00000020
When send queues (64 pieces) are all full (LANC cannot send or has failed.)
SMC send buffer no request source
00000024
Occurs according to the comparison with USNET definition.
SMC send request (TASK)
00000028
LANC send operation times (no send delay)
SMC send request (INT)
0000002C
Number of times to send the queued send buffer data
SMV send completion
00000030
Number of times of send completion interruption

00000034 SMC receive alignment error Fraction bit received (LANC)

SMC receive CRC error


00000038
Receive frame check error (LANC)
SMC receive long packet
0000003C
1514-byte or longer packet was received (except FCS).
SMC receive short packet
00000040
60-byte or shorter packet was received (except FCS).
SMC receive data size over
00000044
Long packer check error on LANC driver
SMC receive overrun
00000048
Occurs when there is no LANC receive buffer remained. (Line load)
SMC receive completion
0000004C
Number of receive completion times
SMC receive USNET queue full
00000050 USNET receive queues (64 pieces) are full. (LANC received data exceeding the performance of this
module.)
SMC receive USNET buffer full
00000054
USNET receive buffers (200 pieces) are full.
SMC memory reset
00000058
Occurs when send queues are full. Clear LANC receive buffer.
SMC restart
0000005C
Occurs if time out occurs while waiting for the completion of memory reset operation. (Reset the chip.)

6-20
Section 6 Failure Diagnosis
<Related to Ethernet communication SMC91C111 (Physical)>

Offset address (hex) Description


00000060 Illegal 4B5B code detected in PHY receive data Receive error on physical layer
00000064 No starting point of stream delimiter found in PHY receive data Receive error on physical layer
00000068 No end point of stream delimiter found in PHY receive data Receive error on physical layer
PHY Jabber detected
0000006C
Receive error on physical layer
PHY changed over to full duplex
00000070
Number of times to change over from half duplex to full duplex
PHY changed over to half duplex
00000074
Number of times to change over from half duplex to full duplex
00000078 Reserved
0000007C Reserved

<Related to USNET socket I/F>

Offset address (hex) Description


USN socket error
00000080
Failed to acquire a socket, etc.
USN bind error
00000084
Failed to set local port number, etc.
USN connect error
00000088
Error during active open. This error also occurs due to timeout.
USN listen error
0000008C
Error during passive open
USN accept error
00000090
Error during passive open. This error also occurs due to timeout.
Counter: USN send error
00000094
TCP/IP send error. Connection not established. This error also occurs due to timeout, etc.
Counter: USN sentto error
00000098
UDP/IP send error
Counter: USN recv error
0000009C
TCP/IP receive error. Connection not established. This error also occurs due to timeout, etc.
Counter: USN recvfrom error
000000A0
UDP/IP receive error
Counter: USN closesocket error
000000A4
Error while returning a socket

6-21
Section 6 Failure Diagnosis
<Related to SBM communication>

Offset address (hex) Description


000000A8 Abnormal end of sending NACK to SBM
000000AC Abnormal end of other than sending NACK to SBM
000000B0 Timeout of sending to SBM
Retry over of sending to SBM
000000B4
After retried 3 times.
Buffer full for receiving from SBM (FULL)
000000B8
No receive buffer remained
Buffer full for receiving from SBM (NEARFULL)
000000BC
Only one receive buffer is remained.
000000C0 Send request to SBM
000000C4 Normal end of sending to SBM
000000C8 Completion of receiving from SBM
000000CC Reserved
000000D0 Reserved
000000D4 Reserved

<Related to the processing of APP part>

Offset address (hex) Description


Abnormal end of APP communication initialization
000000D8
Number of times to notify FB error response
Abnormal end of APP channel open
000000DC
Number of times to notify FB error response (including the detection of duplicated open)
Abnormal end of APP channel open port specification
000000E0
Number of times to notify FB error response
APP channel open client port full
000000E4
Number of times to notify FB error response
APP channel open type error (other than Ethernet)
000000E8
Number of times to notify FB error response
APP channel open LDC server re-open
000000EC
Number of times to notify FB error response
Abnormal end of APP channel close
000000F0
Number of times to notify FB error response
APP channel close unopened port
000000F4
Number of times to notify FB error response
APP channel close SA, SP mismatch
000000F8
Number of times to notify FB error response
APP channel close specified data count over
000000FC
Number of times to notify FB error response
APP connection server undefined command
00000100
Number of times to notify FB error response
APP connection server split parameter error
00000104
Number of times to notify FB error response
APP connection server communication command header error
00000108
Number of times to notify FB error response

6-22
Section 6 Failure Diagnosis

Offset address (hex) Description


APP connection server forcible close
0000010C
Number of times to notify FB error response
Abnormal end of APP message send
00000110
Number of times to notify FB error response
Abnormal end of APP message receive
00000114
Number of times to notify FB error response
APP auto communication Error other than channel close error
00000118
Number of times to notify FB error response
APP auto communication Channel close error
0000011C
Number of times to notify FB error response
00000120 to Information on PING sending
0000013A
0000013C System time (H)
0000013E System time (L)

6-23
Appendix 1 Loader Command

Appendix 1-1 Overview of Loader Commands


To access data in the memory of a MICREX-SX series CPU module from an intelligent device such as a personal computer via
the Ethernet module, issue a "request command" from the personal computer. No application program for data sending/receiving
is necessary in the CPU module. Up to 486 bytes (234 words) of data can be read or written at a time. The following table shows
10 commands available.
(FYI: The commands are the same as those in Ethernet built in SPH2000.)

Function Command name Command Mode Overview


Read Read data 00h 00h Reads data from the specified data memory.
Write Write data 01h 00h Writes data into the specified data memory.
PLC CPU batch start 04h 00h Starts all the CPUs existing in a configuration in a batch.
control
CPU batch initialize and start 01h Initializes and starts all the CPUs existing in a configuration
in a batch.
CPU batch stop 02h Stops all the CPUs existing in a configuration in a batch.
CPU batch reset 03h Resets all the CPUs existing in a configuration in a batch.
CPU individual start 04h Starts a specified CPU separately.
CPU individual initialize and start 05h Initializes and starts a specified CPU separately.
CPU individual stop 06h Stops a specified CPU separately.
CPU individual reset 07h Resets a specified CPU separately.

Note:
The "CPU batch initialize and start" and "CPU individual initialize and start" commands start the CPUs after clearing the retain
memory.

<Data access image>


Create a request command in an application program on the personal computer, and then send it to the CPU module via the
Ethernet module. The CPU which receives it returns a response command.
No data communication program is required for an application program in the CPU module.

Personal computer

Request command
Ethernet

Response command
MICREX-SX

SX_CPU Ethernet interface module

* The response monitoring time on the personal computer side must be 3 seconds or more.

<Notes on access to high-speed memory>


To access a high-speed memory using a loader command requires 81 tacts. (It takes long to access a high-speed memory
compared with access to other memories.) Therefore, it is not recommended to access a high-speed memory using a loader
command.
In addition, access across the boundary between high-speed and standard memories is not allowed.

App.1-1
Appendix 1 Loader Command

Appendix 1-2 Transmission Data Format of Commands


The transmission data consist of the “TCP/IP header part”, “protocol header part," and "command part (request commands and
response commands). Both request commands and response commands have the same format. All data are transmitted as
binary codes (Not ASCII codes).
Usually, the user needs to pay attention to “protocol header part," and "command part" when sending or receiving data." Since
the Ethernet communication driver automatically attaches "TCP/IP header part," the user does not need to pay attention to it.

TCP/IP header part

DP (Fixed to FBh)

Protocol header part SP (Fixed to 80h)


(4 bytes)
Transaction (Fixed to 80h)
Transmission status (Fixed to 00h)
Operation status
Connection mode
Connection ID (L)

Command part Connection ID (H)


Command header (16 bytes)
(Fixed to 11h)
+
Data part (Fixed to 00h)
(Fixed to 00h)
(Fixed to 00h)
(Fixed to 00h)
(Fixed to 00h)
(Fixed to 00h)
(01h fixed)
Command
Mode
(Fixed to 00h)
(Fixed to 01h)
Number of bytes in data part (L)
Number of bytes in data part (H)

Data part
(Max. 492 bytes)

App.1-2
Appendix 1 Loader Command
<Detail description of transmission data>
1) TCP/IP header part
For request commands, the personal computer adds this part at the top of the transmission data part of a loader command.
For response commands, the Ethernet module adds this part at the top of the transmission data part when returning response
data. Normally, the Ethernet communication driver automatically adds this part, therefore, the user do not need to pay attention
to it.

2) DP (Destination Port)
For request (PC to PLC)
DP is a destination port No. on the destination module (not TCP/IP port No.). This is specified by the requester.
* Usually, 251 (FBh), which is the loader interface server port on CPU0, is specified.
* To access CPU0, 253 (FDh), which is the loader command server port, can be specified.
* The positions of DP and SP are replaced in response data.
For response (PLC to PC)
The same DP as the one sent by the sender is returned.

3) SP (Source Port)
SP is a requester port No. on the source module. This is specified by the requester and fixed to 128 (80h).
For request (PC to PLC)
Fixed to 80h.
* The positions of DP and SP are replaced in response data.
For response (PLC to PC)
SP is any number from 80 to 87h. (The PLC automatically determines an arbitrary No.)

4) Transaction
“Transaction" specifies Yes or No of transaction, request or response, and a transaction ID.
Set Yes or No of transaction on the requester side (PC). Dynamically assign the transaction ID on the PC side when issuing a
request. The Ethernet module sets the response bit when returning a response.
* The requester (PC) side must set the transaction ID and also perform transaction ID collation of response data.

7 0

Yes/No of transaction (0: No, 1: Yes)


Request/Response (0: Request, 1: Response)
Transaction ID (0 to 63)

5) Transmission status
"Transmission status" indicates the result of transmission via SX bus or network
* Fixed to 00h for request commands.
* For response commands, any value other than 00h means abnormal end. The meaning of each codes is the same as that of
“operation status."

App.1-3
Appendix 1 Loader Command
6) Operation status
"Operation status" indicates the result of operations requested by a loader command. Check the operation status in response
commands on the personal computer side. Set FFh (fixed) to issue a request command.

<Status list>

Code Status Description


00h Normal end Command processing is completed normally.
10h CPU error Command cannot be executed because an error occurred in the CPU.
11h CPU running Command cannot be executed because the CPU is running.
12h Command execution not possible Command cannot be executed due to the key switch condition of the CPU.
20h Undefined command CPU received an undefined command or mode.
22h Parameter error Setting error was found in the command header part.
23h Transmission interlocked Transmission is interlocked by a command from another device.
Requested command cannot be executed because another command is now
28h Command processing in progress
being executed.
Requested command cannot be executed because the loader is now
2Bh Other loader processing in progress
performing another processing (such as program change).
Requested command cannot be executed because the system is now being
2Fh Initialization not completed
initialized.
40h Data setting error Invalid data type or number was specified.
41h Specified data not found Specified data cannot be found.
44h Memory address setting error Specified address exceeds the valid range.
45h Memory size exceeded “Address + the number of read/write words” exceed the valid range.
A0h Command send destination setting error No module exists at specified destination station No.
A2h No response to command No response data is returned from the destination module.
A4h SX bus send error Command cannot be communicated because an error occurred in the SX bus.
Command cannot be communicated because NAK occurred while sending
A5h SX bus send NAK
data via SX bus.
FFh Request command Set the "Operation status" to FF to issue a request command.

7) Connection mode, Connection ID


"Connection mode" and "Connection ID" specify the destination module (destination of the command).

Destination module Connection mode Connection ID (L) Connection ID (H)


CPU0 to CPU7 7Bh SX bus station No. of the destination CPU (FEh to F7h) 00h
P/PE link FL-net 7Bh SX bus station No. of the destination module (F6h to EFh) 00h

* In cases other than redundant mode, you can also access CPU0 by setting the connection mode to “7Ah” and the connection
ID to “00h.”

8) Command, Mode
Command: Indicates the major classification code of the command
Mode: Indicates the detail code of the command
For the details of commands and modes, see “Appendix 1-3 Details of Loader Commands.”

9) Number of bytes in data part


"Number of bytes in data part" indicates the number of bytes in the data part as a four-digit hexadecimal value.
Max. 492 bytes = 01ECh.
Since the data part includes information such as a memory type, maximum 486 bytes (234 words) can be actually treated.

App.1-4
Appendix 1 Loader Command

Appendix 1-3 Details of Loader Commands


Appendix 1-3-1 Read data
This command reads the specified number of words from the specified address of the specified data memory. If the requested
number of words to read exceeds the range of the specified memory, up to the end of the specified memory is read.

1) Command/mode code
Command: 00h, Mode: 00h

2) Data format of request command / response command

Request data Response data


Memory type Memory type
Memory address (L) Memory address (L)
Memory address (M) Memory address (M)
Memory address (H) Memory address (H)
Number of read words (L) Number of read words (L)
Number of read words (H) Number of read words (H)

Read data
.
.
.

* Set the memory address and number of words of read data in hexadecimal.

3) Arrangement of read data


The read data is arranged as shown below.

MICREX-SX module Personal computer


15 0
12 34 34
56 78 12
78
56

App.1-5
Appendix 1 Loader Command
4) Example of data read command
[For D300win]
The table below shows the command part for reading 2-word data beginning with %MW1.1000 of the standard memory in the
CPU module (CPU station No. 0). (Data in the case of %MW1.1000 = WORD#16#1234 and %MW1.1001 = WORD#16#5678)
[For Standard loader]
The table below shows the command part for reading 2-word data beginning with WM1000 of the standard memory in the CPU
module (CPU station No. 0). (Data in the case of WM1000 = H1234 and WM1001 = H5678.)

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FE FE
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 00 00
Mode 00 00
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 06 0A
Number of bytes in data part (H) 00 00
Memory type 02 02
Memory address (L) E8 E8
Memory address (M) 03 03
Memory address (H) 00 00
Number of read words (L) 02 02
Number of read words (H) 00 00
- 34
- 12
Read data
- 78
- 56

App.1-6
Appendix 1 Loader Command
<Memory type code>
The table below shows the memory type codes for individual MICREX-SX internal memories.

Target module Memory type Area name Remark


CPU module 02h Standard memory (%MW1/WM*)
04h Retain memory (%MW3/WL*)
08h System memory (%MW10/WSM*)
PE-link module FFh Broadcast area (%MWo.1/WMo.*) (Note 1)
P-link module FFh Broadcast area (%MWo.1/WMo.*) (Note 2)
FL-net module FFh Common memory, etc. (%MWo.1/WMo.*)

Notes:
1) When accessing the broadcast area of the PE-link module by a command, the address does not begin with 0.
See the following address correspondence table.
2) When accessing the broadcast area of the P-link module by a command, the high-speed bit area, high-speed word area,
and low-speed word area are not consecutive. See the following address correspondence table.

<Address correspondence table of PE-link>

Access from loader command


Access from application
H M L
%MWo.1.0/WMo.0 00 1E 00
High-speed 1 area
| | | |
(high-speed bit area)
%MWo.1.511/WMo.511 00 1F FF
%MWo.1.512/WMo.512 00 20 00
High-speed 2 area | | | |
%MWo.1.8703/WMo.8703 00 3F FF
%MWo.1.8704/WMo.8704 00 40 00
Low-speed 1 area | | | |
%MWo.1.12799/WMo.127999 00 4F FF
%MWo.1.12800/WMo.12800 00 50 00
Low-speed 2 area | | | |
%MWo.1.25087/WMo.25087 00 7F FF

<Address correspondence table of P-link>

Access from loader command


Access from application
H M L
%MWo.1.0/WMo.0 00 00 00
High-speed 1 area
| | | |
(high-speed bit area)
%MWo.1.511/WMo.511 00 01 FF
%MWo.1.512/WMo.512 00 02 00
High-speed 2 area | | | |
%MWo.1.1663/WMo.1663 00 06 7F
%MWo.1.1664/WMo.1664 00 08 00
Low-speed 1 area | | | |
%MWo.1.4735/WMo.4735 00 13 FF
%MWo.1.4736/WMo.4736 00 14 00
Low-speed 2 area | | | |
%MWo.1.7807/WMo.7807 00 1F FF

App.1-7
Appendix 1 Loader Command

Appendix 1-3-2 Write data


This command writes the specified number of words to the specified address of the specified data memory.

1) Command/mode code
Command: 01h, Mode: 00h

2) Data format of request command / response command

Request data Response data


Memory type Memory type
Memory address (L) Memory address (L)
Memory address (M) Memory address (M)
Memory address (H) Memory address (H)
Number of write words (L) Number of write words (L)
Number of write words (H) Number of write words (H)
Write data
.
.
.

* Set the memory address and number of words of


write data in hexadecimal.
Request Response
command command
3) Arrangement of write data
The write data is arranged as shown below. Operation status FF 00
Connection mode 7B 7B
MICREX-SX module Personal computer
15 0 Connection ID (L) FE FE

12 34 34 Connection ID (H) 00 00
56 78 12 Fixed to 11h 11 11
78 Fixed to 00h 00 00
56 Fixed to 00h 00 00
Fixed to 00h 00 00
4) Example of write data command Fixed to 00h 00 00
[For D300win]
Fixed to 00h 00 00
When writing 1-word data to the retain memory
%MW3.1 of the CPU module (CPU station No. 0), Command 01 01
the command part will be as shown in the right table.
Mode 00 00
(Write data: WORD#16#1234)
Fixed to 00h 00 00
[For Standard loader] Fixed to 01h 01 01
When writing 1-word data to the retain memory WL1
of the CPU module (CPU station No. 0), the command Number of bytes in data part (L) 08 06
part will be as shown in the right table. Number of bytes in data part (H) 00 00
(Write data: H1234)
Memory type 04 04
Memory address (L) 01 01
Memory address (M) 00 00
Memory address (H) 00 00
Number of write words (L) 01 01
Number of write words (H) 00 00
34 -
Read data
12 -

App.1-8
Appendix 1 Loader Command

Appendix 1-3-3 CPU batch start


This command starts all the CPUs in the configuration at one time. Each CPU cold-starts or warm-starts depending on its
condition. CPUs that have already started or CPUs whose key switches are set at “RUN” do not perform any processing.
However, a response is returned normally without error.

1) Command/mode code
Command: 04h, Mode: 00h

2) Data format of request command / response command


None

3) Batch start command


The command part for batch start is as follows:

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FE FE
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 00 00
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-9
Appendix 1 Loader Command

Appendix 1-3-4 CPU batch initialize and start


This command initializes and starts all the CPUs in the configuration at one time. Each CPU cold-starts. CPUs that have already
started or CPUs whose key switches are set at “RUN” do not perform any processing. However, a response is returned normally
without error.

1) Command/mode code
Command: 04h, Mode: 01h

2) Data format of request command / response command


None

3) Batch initialize and start command


The command part for batch initialize and start is as follows:

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FE FE
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 01 01
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-10
Appendix 1 Loader Command

Appendix 1-3-5 CPU batch stop


This command stops all the CPUs in the configuration at one time.
CPUs that have already stopped or CPUs whose key switches are set at “RUN” do not perform any processing. However, a
response is returned normally without error.

1) Command/mode code
Command: 04h, Mode: 02h

2) Data format of request command / response command


None

3) Batch stop command


The command part for batch stop is as follows:

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FE FE
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 02 02
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-11
Appendix 1 Loader Command

Appendix 1-3-6 CPU batch reset


This command resets all the CPUs in the configuration at one time. This command is executed regardless of the key switch
position of the CPU.

1) Command/mode code
Command: 04h, Mode: 03h

2) Data format of request command / response command


None

3) Batch reset command


The command part for batch reset is as follows:

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FE FE
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 03 03
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-12
Appendix 1 Loader Command

Appendix 1-3-7 CPU individual start


This command starts a specified CPU in the configuration separately. The CPU cold-starts or warm-starts depending on
its condition. If the specified CPU has already started, an error occurs. To specify the CPU, set the connection mode and
connection ID.

1) Command/mode code
Command: 04h, Mode: 04h

2) Data format of request command / response command


None

3) Example of individual start command


The command part for individual start is as follows (Example for starting CPU1 of a multi-CPU system):

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FD FD
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 04 04
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-13
Appendix 1 Loader Command

Appendix 1-3-8 CPU individual initialize and start


This command Initializes and starts a specified CPU in the configuration separately.
The CPU cold-starts. If the specified CPU has already started or the key switch is set at “RUN”/”STOP”, an error occurs. To
specify the CPU, set the connection mode and connection ID.

1) Command/mode code
Command: 04h, Mode: 05h

2) Data format of request command / response command


None

3) Example of individual initialize and start command


The command part for individual initialize and start is as follows (example for initializing and starting CPU1 of a multi-CPU
system):

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FD FD
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 05 05
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-14
Appendix 1 Loader Command

Appendix 1-3-9 CPU individual stop


This command stops a specified CPU in the configuration separately.
If the specified CPU has already stopped or the key switch is set at “RUN”/”STOP,” an error occurs. To specify the CPU, set the
connection mode and connection ID.

1) Command/mode code
Command: 04h, Mode: 06h

2) Data format of request command / response command


None

3) Example of individual stop command


The command part for individual stop is as follows (Example for stopping CPU1 of a multi-CPU system):

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FD FD
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 06 06
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-15
Appendix 1 Loader Command

Appendix 1-3-10 CPU individual reset


This command resets a specified CPU in the configuration separately.
If the key switch is set to “RUN”/”STOP,” an error occurs. To specify the CPU, set the connection mode and connection ID.

1) Command/mode code
Command: 04h, Mode: 07h

2) Data format of request command / response command


None

3) Example of individual reset command


The command part for individual reset is as follows (Example for resetting CPU1 of a multi-CPU system):

Request command Response command


Operation status FF 00
Connection mode 7B 7B
Connection ID (L) FD FD
Connection ID (H) 00 00
Fixed to 11h 11 11
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Fixed to 00h 00 00
Command 04 04
Mode 07 07
Fixed to 00h 00 00
Fixed to 01h 01 01
Number of bytes in data part (L) 00 00
Number of bytes in data part (H) 00 00

App.1-16
Appendix 2 Wiring for Ethernet

Appendix 2-1 Connection Configuration for Ethernet


Appendix 2-1-1 10BASE-T/100BASE-TX connection configuration
Hub Hub

Max. 100 m

NP1L-ET1 NP1L-ET1

Ethernet node Ethernet node Ethernet node

Appendix 2-1-2 10BASE5 connection configuration


Segment length: Max. 500 m

Coaxial cable (for 10BASE5)


Terminator Terminator
(Terminating resistor) Transceiver Transceiver (Terminating resistor)

Multi-port transceiver

Max. 50 m

AUI cable
NP1L-ET2 NP1L-ET2

Ethernet node Ethernet node Ethernet node

App.2-1
Appendix 2 Wiring for Ethernet

Appendix 2-2 Layout and Wiring for Ethernet


When Ethernet system is used under a noise environment, the following layout and wiring are necessary.

Metal duct Metal box

Transceiver

Metal duct

Control panel

Ferrite core

12 VDC
power supply

Note:
The above wiring and layout may not be able to completely remove noise. Therefore, for TCP sending, be sure to set a
proper timeout value for sending operation, taking retry into consideration. For UDP/IP communication, be sure to execute
retransmission by user application program.

App.2-2
Appendix 3 Receive Data Packet Merging Phenomenon

Appendix 3-1 Receive Data Packet Merging Phenomenon


<Overview>
When an Ethernet module (Type: NP1L-ET1/ET2) receives data, the send data length of an external device may not match the
receive data length of the PLC depending on the usage. This subsection describes how this phenomenon occurs and how to
handle it.
This phenomenon occurs only in “general purpose communication mode”, not in “fixed buffer communication mode” or
“Loader Command mode.”

<Normal data receiving operation>


When the Ethernet module (Type: NP1L-ET1/ET2) is set in "General purpose communication mode" to receive data, the data
flow is as follows.
1) Receive data from an external device is stored in the internal memory (Memory A) of the Ethernet module once.
2) The data in Memory A is moved to another internal memory (Memory B) of the Ethernet module at a constant cycle (10 ms).
3) The data stored in Memory B is read to the CPU memory (Memory C), when the M_RECEIVE FB is executed in the CPU
module.

Enternal device Ethernet module CPU module

Memory A Memory B Memory C

1) 2) 3)
Data Data Data Data

<Receive data packet merging phenomenon>


If an external device frequently sends data, before the data are moved from Memory A to Memory B, the data received next are
stored in Memory A. In this case, data received at two different times are stored in Memory A. The data are merged when moved
to Memory B. This phenomenon is called "receive data packet merging phenomenon."
If a receive data packet merging phenomenon occurs, the data received at two different times remain merged when read to the
CPU memory by the M_RECEIVE FB.

Enternal device Ethernet module CPU module

Memory A Memory B Memory C

Data 1 Data 1 Data 1 Data 1


Data 2 Data 2
Data 2
Data 2

App.3-1
Appendix 3 Receive Data Packet Merging Phenomenon
<Conditions for causing receive data packet merging phenomenons>
Under the following conditions, receive data packet merging phenomenons are more likely to occur.
1) When data are frequently sent from an external device
The received data are moved from Memory A to Memory B every 10 ms. If data are sent more frequently, a data packet
merging phenomenon occurs.

2) When two or more "M_SEND/M_RECEIVE" FBs are executed by using two or more communication modules
(Also when two or more "M_SEND/M_RECEIVE" FBs are executed by using two or more ports by one Ethernet module)
When data are stored in Memory B, M_RECEIVE is executed to read them. Processing of M_RECEIVE ends within a
maximum of 100 ms (for 1017 words), however, the processing time is increased if other M_SEND/M_RECEIVE FBs are
executed (increased by 15 ms for one M_SEND/M_RECEIVE FB). Use the following formula to calculate the approximate
processing time.
Processing time (T) = 100 ms +15 ms × (Total number of M_SEND/M_RECEIVE FBs being executed - 1)
If the Ethernet module receives data from an external device during processing of M_RECEIVE, data movement from
Memory A to Memory B is temporarily suspended and a data packet merging phenomenon occurs in Memory A.
To prevent this phenomenon, the external device must send data at intervals longer than the above processing time (T).
If the external device needs to send data more frequently, take measures described on the next page on both the external
device and Ethernet module.

App.3-2
Appendix 3 Receive Data Packet Merging Phenomenon
<Measures against data packet merging phenomenons>
In a system where data packet merging phenomenons occur, divide data on both the external device and CPU as needed.
Example measures are described below.

■ Measure on the external device


On the external device, set the data length at the top (first word) of send data to clarify size of sent data block. (A data block is
called a packet.)

Send data of external device

Data length Data

■ Measure on the PLC


1) Read the data into the CPU by M_RECEIVE. According to the data of the first word (data length), read the data for the first
received data part.
2) The first word of the following data indicates the data length of the second received data. According to the data length, read
the data for the second received data part.

1) Reading the first received data. 2) Reading the second received data.

Data length First received


data

Data read to the CPU


by M_RECEIVE
Data length

Thereafter, repeat the same processing until no data exists.

App.3-3
Appendix 3 Receive Data Packet Merging Phenomenon
<When merged data length exceeds 1017 words>
When the length of data received from an external device is long, a data dividing phenomenon may occur besides data packet
merging phenomenons. Operation of a data dividing phenomenon is described below.

■ Operation example
The following describes an operation example where the Ethernet module receives 600 words of data twice in a row and a data
merging phenomenon occurs.
1) Data 1 (600 words) and Data 2 (600 words) are merged and stored in Memory A (1200 words in total).
2) When data in Memory A are moved to Memory B, data for the buffer size of Memory B (1017 words) are moved.
Concretely, all of Data 1 and the first 417 words of Data 2 (1017 words in total) are moved to Memory B.
The remaining 183 words of Data 2 remain in Memory A.
3) Executing the M_RECEIVE FB reads 1017 words of data to memory C. (Memory B is released.)

Enternal device Ethernet module CPU module

Data 1 Memory A Memory B Memory C

1) 2) 3)
Data 1 Data 1 Data 1
+ +
Part of Part of
Data 2 Data 2
Data 2

Data 2

Buffer size:
1017 words

4) When Memory B is released, the remaining part of Data 2 (183 words) still in Memory A is moved to Memory B.
5) Executing the M_RECEIVE FB reads 183 words of data to Memory C.
In Memory C, the specified memory is overwritten every time M_RECEIVE is executed. Therefore, copy the data to another
memory using an application program every time M_RECEIVE is completed (when NDR turns ON).

Memory A Memory B Memory C

4) 5)
Remaining Remaining Remaining
part of Data 2 part of Data 2 part of Data 2

* You can download a sample program to handle data merging phenomenons (Program No.: Etehr001) from Fuji Electric website
(Fe Library).

App.3-4
Appendix 4 Notes on Module Replacement

Appendix 4-1 Memory Data in Module


Appendix 4-1-1 Overview
Ethernet modules have an internal flash memory, which stores an IP address, gateway, and setting data such as timeout values
(Ethernet parameter).

Therefore, after you replace an Ethernet module, you need to write (download) such data to the replaced module. Usually, select
"Module driver" on the "Download loader -> CPU" dialog box in the loader, and then write the data.
Note that if you download a user program to a user ROM and then turns the PLC off and on again with the user ROM inserted in
the CPU, the "program" and "system definition" are automatically downloaded to the CPU, but not the "module driver."
(Module driver can not be updated by the user ROM.)

* You cannot upload these data (from the Ethernet module to the loader). Management of original data is important. With V36 or
later version of Ethernet modules, you can check them using the failure diagnosis function of the loader.
For the details, see "(5) Initializing information."

To transfer "Ethernet parameter" to the Ethernet module, perform either of the following operations.
1) Transfer it using a loader. (Download the module driver.)
2) Transfer it using a user program.
For how to transfer using a user program, see "Appendix 4-1-2 How to transfer Ethernet parameter using a program."

App.4-1
Appendix 4 Notes on Module Replacement

Appendix 4-1-2 How to transfer Ethernet parameter using a program


To transfer the Ethernet parameter using a user program (from CPU to Ethernet module), prepare the Ethernet parameter as a
48-word array, and then write it to the file named "D:\PCTCP1.INI" (the filename is fixed) using the F_WRITE FB.
After the F_WRITE FB writes the data, turn the PLC off and then on again to make the Ethernet module recognize the written
data.

* The Ethernet parameter is written into the internal flash memory of the Ethernet module. The maximum number of
rewrite times of the flash memory is 100,000 times in general.
Avoid frequently rewriting the internal flash by the F_WRITE FB.

App.4-2
Appendix 4 Notes on Module Replacement
<Data arrangement of Ethernet parameter>
The table below shows the data arrangement of the Ethernet parameter. The data size is fixed to 48 words. (Be sure to write all
of 48 words of data in a batch.)

Offset Factory default


Setting content Remark
address setting
+0 Local module IP address (L) 0001h
Default: 192.168.0.1
+1 Local module IP address (H) C0A8h
+2 TCP sending timeout value 012Ch Default: 30 seconds
+3 Maximum TCP end timer value 0000h Default: 0 (No waiting time)
+4 Response watch timer value 012Ch Default: 30 seconds
+5 Server FTP command watch timer value 0BB8h Default: 300 seconds
+6 Client FTP data connection watch timer value 001Eh This setting is disabled.
+7 Communication condition 0000h See *1.
+8 Subnet mask (L) FF00h
Default: 255.255.255.0
+9 Subnet mask (H) FFFFh
+10 Default gateway IP address (L) 0000h
Default: 0.0.0.0 (no gateway)
+11 Default gateway IP address (H) 0000h
+12 Self port standard No. 0100h Default: 256
+13 Communication target port standard No. 0100h Default: 256
Redirect function
+14 0000h 0: Enable (ON), 1: Disable (OFF)
(Firmware version V47 or later)
+15 Not used (Reserved) 0000h
+16 Gateway 1 Network IP address (L) 0000h
+17 Gateway 1 Network IP address (H) 0000h
+18 Gateway 1 Gateway IP address (L) 0000h
+19 Gateway 1 Gateway IP address (H) 0000h
+20 Gateway 2 Network IP address (L) 0000h
+21 Gateway 2 Network IP address (H) 0000h
+22 Gateway 2 Gateway IP address (L) 0000h
+23 Gateway 2 Gateway IP address (H) 0000h
These settings are disabled.
+24 Gateway 3 Network IP address (L) 0000h
+25 Gateway 3 Network IP address (H) 0000h
+26 Gateway 3 Gateway IP address (L) 0000h
+27 Gateway 3 Gateway IP address (H) 0000h
+28 Gateway 4 Network IP address (L) 0000h
+29 Gateway 4 Network IP address (H) 0000h
+30 Gateway 4 Gateway IP address (L) 0000h
+31 Gateway 4 Gateway IP address (H) 0000h
+32 to +47 Not used (Reserved) 0000h

*1
0000 0000 0000 00**
Close process during TCP sending timeout
This setting is disabled.
Regardless of the setting, this bit is set ON in the module.

Close process during response receiving timeout


OFF: Channel not closed
ON: Channel closed
This bit is set OFF (channel not closed) by default.

App.4-3
Appendix 4 Notes on Module Replacement

Appendix 4-1-3 Sample program


(1) For D300win
<Array declaration>

<Variable declaration>

<Program>

App.4-4
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

App.4-5
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

Specify the SX bus station


No. of the Ethernet module.
("1" in this example)

<Description of the program>


The Ethernet parameter is transferred to "Ethernet_parameter" [0] to [47] of the 48-word array.
Since the filename is character string data, convert it into a Shift JIS code (equivalent to ASCII code) by the STR_TO_SJ
instruction and store the converted filename in the "FILE_NAME" [0] to [6] of 7-word array. Then, connect it to the "FILE_NAME"
terminal of the F_WRITE FB.
Turning ON the "Write_request" variable of the F_WRITE FB writes the data into the Ethernet module (SX bus station No.1 in
this example).
When the writing is completed normally, the "Normal_end " turns ON for one scan. To check if the "Normal_end" turns ON,
a Set coil is used.

App.4-6
Appendix 4 Notes on Module Replacement
(2)-1 For Standard V2 loader
<Initial Data List>
On the "Initial Data List" dialog box, define the character string "D:\PCTCP1.INI" in WM50 to WM63.

App.4-7
Appendix 4 Notes on Module Replacement
<Program>

App.4-8
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

App.4-9
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

App.4-10
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

Specify the SX bus station


No. of the Ethernet module.
("1" in this example)

<Description of the program>


The Ethernet parameter is transferred to 48 words from WM0 to WM47.
Since the filename is character string data, register it in WM50 to WM63 on the "Initial Data List" dialog box. Then, convert it into
a Shift JIS code (equivalent to ASCII code) by the STR_TO_SJ instruction and store it in the area from WM70 to WM76.
Turning ON the "Write_request" (M800) of the F_WRITE FB writes the data into the Ethernet module (SX bus station No.1 in this
example).
When the writing is completed normally, M801 turns ON for one scan. To check if M801 turns ON, the Set coil M803 is used.

App.4-11
Appendix 4 Notes on Module Replacement
(2)-2 For Standard V3
Click the "Device" icon on the project view to open the device window. Then, select "WM" from the dropdown list.
Enter ASCII codes corresponding to the character string "D:\PCTCP1.INI" in the "Initial Value" boxes from WM50 to WM63.

App.4-12
Appendix 4 Notes on Module Replacement
<Program>

App.4-13
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

App.4-14
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

App.4-15
Appendix 4 Notes on Module Replacement
<Program (Continued from preceding page)>

Specify the SX bus station


No. of the Ethernet module.
("1" in this example)

<Description of the program>


The Ethernet parameter is transferred to 48 words from WM0 to WM47.
Since the filename is character string data, register it in WM50 to WM63 as initial values. Then, convert it into a Shift JIS code
(equivalent to ASCII code) by the STR_TO_SJ instruction and store it in the area from WM70 to WM76.
Turning ON the "Write_request" (M800) of the F_WRITE FB writes the data into the Ethernet module (SX bus station No.1 in this
example).
When the writing is completed normally, M801 turns ON for one scan. To check if M801 turns ON, the Set coil M803 is used.

App.4-16
Appendix 4 Notes on Module Replacement

Appendix 4-2 Aging Time


Some Ethernet devices (hub, router, and target device) store the MAC address of a communication partner once communication
starts. (Each Ethernet device has a different MAC addresses, which is like a serial number.)
If a device (hub or router) that has such a specification is connected between the Ethernet module and the target device, or the
target device has such a specification, communication may be failed when the Fuji Ethernet module is replaced (MAC address
is changed) after starting normal operation.

The reason is that the Ethernet device (or a hub or router connected in-between) stores the MAC address of the communication
partner (learning function). Since it is held for a certain period of time even after the communication partner stops communication
or does not exist, communication with a different MAC address is failed. This period is referred to as “Aging Time.”
This condition occurs when Fuji Ethernet module is in passive open mode (Unpassive/Fullpassive) in TCP/IP communication or
communication begins with receiving operation in UDP/IP communication. In these cases, the communication partner performs
sending (or opening) operation first. Therefore, if the Ethernet module is replaced and the MAC address is changed,
communication is failed.
When the Ethernet module is in active open mode in TCP/IP communication or communication begins with sending operation
in UDP/IP communication, the local station performs sending (or opening) operation first to rewrite the MAC address that is
stored in the communication partner. Therefore, communication can be performed.
The above uncommunicable state is eliminated after “Aging Time” passes or by turning the power of the target device (or a hub
or router connected in-between) off and then on again.

<FYI>
The aging time of the Fuji Ethernet module is one minute (fixed). For information on the aging time of the target device, contact
the maker. The aging time of hubs is generally set to approximately 5 minutes.

App.4-17
Appendix 5 PING Sending Function

Appendix 5-1 PING Sending Function


Appendix 5-1-1 Overview
The PING function is used to check the network condition. The Ethernet module sends a PING command to the target node to
check if it returns a response.
This function is supported by V44 or later version of Ethernet modules. (The PING receiving function, which returns a response
to a PING command from the target node, is supported by all versions.)
Use the R_READ FB to send a PING command.
The Ethernet module sends an ICMP "Echo Request" packet only once by a single execution of the FB and checks if the target
node returns a response within the specified time. A function to set the number of PINGs to send and a function to measure the
response time, which Windows personal computers support, are not supported.

PING sending

PING response Ethernet

Ethernet interface module


MICREX-SX

Target node

<Ports used by PING>


The Ethernet module has 16 communication ports (see "2-2-2 Communication ports of the module.") The PING function does
not use any of these ports, although it performs Ethernet communication by using the R_READ FB. The Ethernet module
separately has a port for PING.
However, it is included in 4, the number of connections for loader command communication mode (send). Therefore, the number
of the R_READ/R_WRITE FBs that can be executed in one CPU is 4 including one for PING.

App.5-1
Appendix 5 PING Sending Function

Appendix 5-1-2 R_READ FB for sending PING


Use the R_READ FB to send a PING command to check if the target node returns a response.

(1) Operation of the instruction


1) At the rising edge of "REQ," the FB sends a PING to a node that has the IP specified in “STATION_NO” from an Ethernet
module specified in “MODULE_NO” only once. (This processing is not completed within one scan.)
2) When the Ethernet module receives a PING response within the specified time, “DONE” turns ON for one scan. "RD" outputs
the result of verification between the send data and receive data as a substatus.
3) If the Ethernet module cannot receive a PING response within the specified time or no PING response is returned, “ERROR”
turns ON for one scan and “STATUS” outputs the error code (195).

Note:
1) Additional “REQ” command is disabled during PING processing (until “DONE” or “ERROR” turns ON after the rising edge of
“REQ").

(2) FB format
1) For D300win
FB No. (instance name)

Data type R_READ_ Data type

R_READ

BOOL REQ DONE BOOL

UINT MODULE_NO ERROR BOOL

UINT CHANNEL_NO STATUS INT

UDINT STATION_NO

UINT VAR_TYPE

ANY REMOTE_VAR REMOTE_VAR ANY

UINT SIZE

ANY RD RD ANY

App.5-2
Appendix 5 PING Sending Function
1) For Standard loader

(3) Description of terminals

Terminal function Terminal name Data


I/O Description
name (parameter) type
PING send request REQ BOOL IN At the rising of this signal, the FB sends a PING.
Communication MODULE_NO UINT IN Specify the SX bus station No. of the Ethernet module (self
module No. module).
Communication CHANNEL_NO UINT IN Fixed to 0 for the Ethernet module
channel No.
Target station No. STATION_NO UDINT IN Specify the IP address of the target node.
Variable specification VAR_TYPE UINT IN Set the method for specifying variables.
method Fixed to 2 when used for sending PING
PING monitoring REMOTE_VAR ANY IN-OUT Set the monitoring time of PING responses.
time *1
Size SIZE UINT IN Fixed to 1 when used for sending PING
Substatus RD ANY IN-OUT Stores a response substatus (1-word data).
Turns ON for one scan when the Ethernet module receives a PING
PING end DONE BOOL OUT
response within the specified time.
Turns ON for one scan if the Ethernet module cannot receive a
PING error ERROR BOOL OUT PING response within the specified time or no PING response is
returned.
Status *2 STATUS INT OUT Outputs the result of the PING execution by a status code.

App.5-3
Appendix 5 PING Sending Function
*1 PING monitoring time (REMOTE_VAR)
Specify the monitoring time of PING responses in the following format:

15 (F) 0

H0004

H0001

H0008

H00 Timeout (L)

H00 Timeout (H)

• D300win uses 5-element UINT array data.


• Standard loader uses a data area of consecutive 5 words.

Setting range of Timeout: H0000 to H012C (0 to 300) × 100 ms


Set the lower 2 digits in Timeout (L) and higher 2 digits in Timeout (H) of the set value of monitoring time in hexadecimal. The
monitoring time is obtained by multiplying the set value by 100 ms. When set to 0, the FB operates assuming the monitoring to
be 100 ms.
If an out-of-range value is specified, the FB operation ends abnormally (status: 177).

*2 Status

Status
Meaning Description Substatus
code
0 Normal • The Ethernet module receives a response from the target node. Note 1
164 Send error • No target module exists at the station No. specified in MODULE_NO. -
171 Internal resources depleted Five or more R_READ/R_WRITE FBs were simultaneously executed. -
• A value other than 0 and 2 is set in VAR_TYPE.
• When VAR_TYPE is set to 2, any of the following occurred.
1) A value in an unspecified format was entered in REMOTE_VAR.
(For example, the content of the first word is not "H0004.")
2) An out-of-range value is entered in Timeout (H) or (L).
177 Parameter error -
3) A value other than 1 is entered in the SIZE terminal.
4) An array that is not one-word is specified in RD.
5) The Ethernet module does not support the PING function (The
version of the Ethernet module is V43 or earlier.)
• No module exists at the SX bus station No. specified in MODULE_NO.
193 Channel open error • An abnormal value is set in CHANNEL_NO. -
• After sending a PING, the Ethernet module did not receive a response
195 Time out within the specified time -
• The Ethernet module received an ICMP error message.
201 Client port FULL • Two or more PING send requests are executed. -

Note:
1) The PING function sends an arbitrary data to the target node, which echobacks the same data. The substatus outputs the
result of verification between the send data and echoback data.
0: Verification match
1: Verification mismatch
A mismatch occurs if echoback data are garbled due to the unstable state of LAN.

App.5-4
Fuji Electric Co., Ltd.
Gate City Ohsaki, East Tower,
11-2, Osaki 1-chome, Shinagawa-ku, Tokyo 141-0032, Japan

E-mail: [email protected]
URL: http://www.fujielectric.com/

Materials covered in this document are subject to revision due to the modification of the product.

You might also like