ManualOperacion CJ1 CS1-ETN PDF
ManualOperacion CJ1 CS1-ETN PDF
ManualOperacion CJ1 CS1-ETN PDF
W343-E1-05
SYSMAC
CS/CJ Series
CS1W-ETN01 (10Base-5)
CS1W-ETN11 (10Base-T)
CJ1W-ETN11 (10Base-T)
Ethernet Units
OPERATION MANUAL
CS1W-ETN01 (10Base-5)
CS1W-ETN11 (10Base-T)
CJ1W-ETN11 (10Base-T)
Ethernet Units
Operation Manual
Revised June 2003
iv
Notice:
OMRON products are manufactured for use according to proper procedures by a qualified operator
and only for the purposes described in this manual.
The following conventions are used to indicate and classify precautions in this manual. Always heed
the information provided with them. Failure to heed precautions can result in injury to people or dam-
age to property.
!DANGER Indicates an imminently hazardous situation which, if not avoided, will result in death or
serious injury.
!WARNING Indicates a potentially hazardous situation which, if not avoided, could result in death or
serious injury.
!Caution Indicates a potentially hazardous situation which, if not avoided, may result in minor or
moderate injury, or property damage.
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of
information.
Note Indicates information of particular interest for efficient and convenient opera-
tion of the product.
1,2,3... 1. Indicates lists of one sort or another, such as procedures, checklists, etc.
OMRON, 2000
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or
by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission of
OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is con-
stantly striving to improve its high-quality products, the information contained in this manual is subject to change without
notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility
for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in
this publication.
v
vi
TABLE OF CONTENTS
PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
1 Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
2 General Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
3 Safety Precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
4 Operating Environment Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
5 Application Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
6 Conformance to EC Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
SECTION 1
Features and System Configuration . . . . . . . . . . . . . . . . 1
1-1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-2 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-3 Devices Required in a Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1-4 Related Programming Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1-5 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1-6 Software Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1-7 IP Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1-8 Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
SECTION 2
Communications Functions . . . . . . . . . . . . . . . . . . . . . . . 15
2-1 Communications Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2-2 FINS Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2-3 Socket Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2-4 FTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2-5 Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
SECTION 3
Installation and Initial Setup . . . . . . . . . . . . . . . . . . . . . . 23
3-1 Before Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3-2 Overview of Startup Procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3-3 Unit Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3-4 Switch Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3-5 Mounting to a PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3-6 Connecting to the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3-7 Creating an I/O Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3-8 Creating Routing Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3-9 System Setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3-10 Creating an IP Address Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3-11 Creating an IP Router Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3-12 Checking Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
vii
TABLE OF CONTENTS
SECTION 4
System Setup and Memory Allocations. . . . . . . . . . . . . . 57
4-1 Allocated Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4-2 CPU Bus Unit System Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4-3 CIO Area Allocations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4-4 DM Area Allocations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
SECTION 5
FINS Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5-1 Overview of FINS Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5-2 Procedure Before Using FINS Communications. . . . . . . . . . . . . . . . . . . . . . . . . . 82
5-3 Sending Commands From a PC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5-4 Sending Commands From a Host Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5-5 FINS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
SECTION 6
Socket Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
6-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6-2 Using Socket Services with Socket Service Request Switches . . . . . . . . . . . . . . . 112
6-3 Using Socket Services with CMND(490) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
SECTION 7
FTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
7-2 Setting Login Names and Passwords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7-3 Using File Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7-4 FTP Server Application Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
7-5 Using FTP Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
7-6 UNIX Application Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
SECTION 8
Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
8-1 Overview of Mail Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
8-2 Sending Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
8-3 Mail Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
SECTION 9
Testing Communications . . . . . . . . . . . . . . . . . . . . . . . . . 185
9-1 Communications Testing Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
9-2 PING Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
9-3 Internode Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
viii
TABLE OF CONTENTS
SECTION 10
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
10-1 Troubleshooting with Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
10-2 Error Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
10-3 Error Log. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
10-4 Error Log Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
10-5 Troubleshooting Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
10-6 Troubleshooting with Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
10-7 Results Storage Area Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
SECTION 11
FINS Commands Addressed to Ethernet Units . . . . . . . 213
11-1 Command Codes and Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
11-2 Socket Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
11-3 Command/Response Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Appendices
A Network Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
B Ethernet Network Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
C Buffer Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
D TCP Status Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
E Auxiliary Area Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
F CPU Bus Unit Allocations in the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
G ASCII Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
H Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
I Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
J Inspections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
ix
About this Manual:
This manual describes the installation and operation of the SYSMAC CS-series CS1W-ETN01
(10Base-5) and CS1W-ETN11 (10Base-T) Ethernet Units and the CJ-series CJ1W-ETN11 (10Base-T)
Ethernet Unit, and includes the sections described on the next page.
An Ethernet Unit is classified and treated as a CPU Bus Unit in PC processing.
This manual is based on Ethernet* networks comprised of Ethernet Unit nodes and UNIX* host com-
puter nodes. Although details can vary, theoretically any device supporting the same Ethernet proto-
cols as the Ethernet Unit can form nodes on the network.
Note *Ethernet is a trademark of the Xerox Corporation. UNIX is a registered trademark of USL.
Please read this manual and all related manuals listed in the following table carefully and be sure you
understand the information provided before attempting to install and operate an Ethernet Unit.
Name Cat. No. Contents
SYSMAC CS/CJ-series W343-E1-@ Describes the installation and operation of the CS1W-ETN01 (10Base-
CS1W-ETN01/ETN11 5), CS1W-ETN11 (10Base-T), and CJ1W-ETN11 Ethernet Units.
CJ1W-ETN11 Refer to the CX-Programmer User’s Manual for information on setting
Ethernet Units the CPU Bus Unit Setup for the Ethernet Unit.
Operation Manual Refer to the Communications Commands Reference Manual (W342) for
(this manual) information on FINS commands that can be addressed to CS/CJ-series
CPU Units.
SYSMAC CS/CJ-series W420-E1-@ Describes the basic settings and FINS communications for the CS1W-
CS1W-ETN21 ETN21 (100Base-TX) and CJ1W-ETN21 (100Base-TX) Ethernet Units.
CJ1W-ETN21 Refer to the Communications Commands Reference Manual (W342) for
Ethernet Units information on FINS commands that can be addressed to CS/CJ-series
Operation Manual CPU Units.
(Construction of Networks)
SYSMAC CS/CJ-series W421-E1-@ Provides information for the CS1W-ETN21 (100Base-TX) and CJ1W-
CS1W-ETN21 ETN21 (100Base-TX) Ethernet Units on functions such as mail trans-
CJ1W-ETN21 mission, socket services, automatic clock adjustment, FTP server, and
Ethernet Units creating host applications with FINS communications.
Operation Manual
(Construction of Applications)
SYSMAC CS-series W339-E1-@ Provides an outline of and describes the design, installation, mainte-
CS1G/H-CPU@@-EV1, CS1G/H-CPU@@H nance, and other basic operations for the CS-series PCs.
Programmable Controllers
Operation Manual
SYSMAC CJ-series W393-E1-@ Provides an outline of and describes the design, installation, mainte-
CJ1G-CPU@@ nance, and other basic operations for the CJ-series PCs.
Programmable Controllers
Operation Manual
SYSMAC CS/CJ-series W394-E1-@ This manual describes programming and other methods to use the func-
CS1G/H-CPU@@-EV1, CS1G/H-CPU@@H, tions of the CS/CJ-series PCs.
CJ1G/H-CPU@@H, CJ1M-CPU@@,
CJ1G-CPU@@
Programmable Controllers
Programming Manual
SYSMAC CS/CJ-series W340-E1-@ Describes the ladder diagram programming instructions supported by
CS1G/H-CPU@@-EV1, CS1G/H-CPU@@H, CS-series and CJ-series PCs.
CJ1G/H-CPU@@H, CJ1M-CPU@@,
CJ1G-CPU@@
Programmable Controllers
Instructions Reference Manual
xi
About this Manual, Continued
Name Cat. No. Contents
SYSMAC CS/CJ-series W341-E1-@ Provides information on how to program and operate CS/CJ-series PCs
C200H-PRO27-E, CQM1H-PRO01-E using a Programming Console.
CQM1-PRO01-E
Programming Consoles
Operation Manual
SYSMAC CS/CJ-series W342-E1-@ Describes the C-series (Host Link) and FINS communications com-
CS1G/H-CPU@@-EV1, CJ1G-CPU@@, mands used with CS/CJ-series PCs.
CS1W-SCB21-V1/41-V1, CS1W-SCU21,
CJ1W-SCU41
Communications Commands
Reference Manual
SYSMAC WS02-CXPC1-EV3 W414-E1-@ Provide information on how to use the CX-Programmer, a programming
CX-Programmer Ver. 3.1 device that supports the CS/CJ-series PCs, and the CX-Net contained
Operation Manual within CX-Programmer.
SYSMAC CS/CJ-series W336-E1-@ Describes the use of Serial Communications Units and Boards to per-
CS1W-SCB21-V1/41-V1, CS1W-SCU21 form serial communications with external devices, including the usage
CJ1W-CSU41 of standard system protocols for OMRON products.
Serial Communications Boards and Serial
Communications Units
Operation Manual
!WARNING Failure to read and understand the information provided in this manual may result in per-
sonal injury or death, damage to the product, or product failure. Please read each section
in its entirety and be sure you understand the information provided in the section and
related sections before attempting any of the procedures or operations given.
xii
PRECAUTIONS
This section provides general precautions for using the CS/CJ-series Programmable Controllers (PCs) and related devices.
The information contained in this section is important for the safe and reliable application of Programmable
Controllers. You must read this section and understand the information contained before attempting to set up or
operate a PC system.
xiii
Intended Audience 1
1 Intended Audience
This manual is intended for the following personnel, who must also have
knowledge of electrical systems (an electrical engineer or the equivalent).
• Personnel in charge of installing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of managing FA systems and facilities.
2 General Precautions
The user must operate the product according to the performance specifica-
tions described in the operation manuals.
Before using the product under conditions which are not described in the
manual or applying the product to nuclear control systems, railroad systems,
aviation systems, vehicles, combustion systems, medical equipment, amuse-
ment machines, safety equipment, and other systems, machines, and equip-
ment that may have a serious influence on lives and property if used
improperly, consult your OMRON representative.
Make sure that the ratings and performance characteristics of the product are
sufficient for the systems, machines, and equipment, and be sure to provide
the systems, machines, and equipment with double safety mechanisms.
This manual provides information for programming and operating the Unit. Be
sure to read this manual before attempting to use the Unit and keep this man-
ual close at hand for reference during operation.
!WARNING It is extremely important that a PC and all PC Units be used for the specified
purpose and under the specified conditions, especially in applications that can
directly or indirectly affect human life. You must consult with your OMRON
representative before applying a PC System to the above-mentioned applica-
tions.
3 Safety Precautions
!WARNING Do not attempt to take any Unit apart while the power is being supplied. Doing
so may result in electric shock.
!WARNING Do not touch any of the terminals or terminal blocks while the power is being
supplied. Doing so may result in electric shock.
!WARNING Do not attempt to disassemble, repair, or modify any Units. Any attempt to do
so may result in malfunction, fire, or electric shock.
!WARNING Do not touch the Power Supply Unit while power is being supplied or immedi-
ately after power has been turned OFF. Doing so may result in electric shock.
!Caution Tighten the screws on the terminal block of the AC Power Supply Unit to the
torque specified in the operation manual. The loose screws may result in
burning or malfunction.
xiv
Operating Environment Precautions 4
!Caution Execute online edit only after confirming that no adverse effects will be
caused by extending the cycle time. Otherwise, the input signals may not be
readable.
!Caution The operating environment of the PC System can have a large effect on the
longevity and reliability of the system. Improper operating environments can
lead to malfunction, failure, and other unforeseeable problems with the PC
System. Be sure that the operating environment is within the specified condi-
tions at installation and remains within the specified conditions during the life
of the system. Follow all installation instructions and precautions provided in
the operation manuals.
5 Application Precautions
Observe the following precautions when using the PC System.
!WARNING Always heed these precautions. Failure to abide by the following precautions
could lead to serious or possibly fatal injury.
• Always connect to a ground of 100 Ω or less when installing the Units. Not
connecting to a ground to a ground of 100 Ω or less may result in electric
shock.
• A ground of 100 Ω or less must be installed when shorting the GR and LG
terminals on the Power Supply Unit.
• Always turn OFF the power supply to the PC before attempting any of the
following. Not turning OFF the power supply may result in malfunction or
electric shock.
xv
Application Precautions 5
!Caution Failure to abide by the following precautions could lead to faulty operation of
the PC or the system, or could damage the PC or PC Units. Always heed
these precautions.
xvi
Conformance to EC Directives 6
6 Conformance to EC Directives
6-1 Applicable Directives
• EMC Directives
• Low Voltage Directive
6-2 Concepts
EMC Directives
OMRON devices that comply with EC Directives also conform to the related
EMC standards so that they can be more easily built into other devices or the
overall machine. The actual products have been checked for conformity to
EMC standards (see the following note). Whether the products conform to the
standards in the system used by the customer, however, must be checked by
the customer.
EMC-related performance of the OMRON devices that comply with EC Direc-
tives will vary depending on the configuration, wiring, and other conditions of
the equipment or control panel on which the OMRON devices are installed.
The customer must, therefore, perform the final check to confirm that devices
and the overall machine conform to EMC standards.
Note Conformance with the EMC (Electromagnetic Compatibility) standards for
EMS (Electromagnetic Susceptibility) and EMI (Electromagnetic Interference)
vary with the model in the way shown below.
Ethernet Unit EMS EMI
CS1W-ETN01/11 EN61131-2 EN50081-2 (Radiated emis-
CJ1W-ETN11 EN61000-6-2 sion: 10-m regulations)
xvii
SECTION 1
Features and System Configuration
This section introduces the overall structure of an Ethernet network, outlines the features of the Ethernet Unit, describes
the communications protocols used by an Ethernet network, and provides basic precautions for use of an Ethernet network.
1-1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-2 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-2-1 Device Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-2-2 Node Connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-3 Devices Required in a Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1-3-1 10Base-5 Ethernet Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1-3-2 10Base-T Ethernet Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1-4 Related Programming Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1-5 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1-6 Software Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1-7 IP Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1-7-1 IP Address Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1-7-2 Allocating IP Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1-7-3 IP Address Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1-7-4 Subnet Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1-8 Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1-8-1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1-8-2 Ethernet and IEEE802.3 Standards. . . . . . . . . . . . . . . . . . . . . . . . . . 14
1
Features Section 1-1
1-1 Features
Select from 10Base-5 or Three models of Ethernet Unit are provided to support both 10Base-5
10Base-T (CS1W-ETN01) and 10Base-T (CS1W-ETN11/CJ1W-ETN11) Ethernet trans-
mission media.
Wide-ranging Control The Ethernet Unit enables a Programmable Controller (PC) to support a wide
Capability Using Ethernet range of protocols via Ethernet, including data communications by TCP/IP
and UDP/IP socket services, FINS command execution (OMRON’s standard
protocol), FTP file transfers, and SMTP message communications.
Communications by UDP/ The Ethernet Unit supports the standard Ethernet protocols, UDP/IP and
IP and TCP/IP TCP/IP, so it can communicate with other Ethernet devices, workstations, per-
sonal computers, and Ethernet Units produced by other manufacturers. It can
utilize up to eight socket ports for the various protocols, allowing it to be
employed in a wide range of applications.
Easy Use of Socket TCP or UDP socket services can be easily accessed either by executing the
Services CMND(490) instruction or by presetting parameters and then manipulating
dedicated control switches in memory. Presetting parameters eliminates the
need for ladder programs to monitor the completion timing of instructions and
socket service processing, and thereby reduces the work hours involved in
program development.
FINS Message The Ethernet Unit also supports FINS message communications, OMRON’s
Communications standard communications service, so other OMRON PCs can be accessed by
(FINS Communications using SEND(090), RECV(098), and CMND(490) instructions in ladder pro-
Service Using UDP/IP) grams. In addition, the FINS gateway function can be used to allow access to
other PCs on not only the same Ethernet network but also on other networks
such as Controller Link and SYSMAC Link.
File Transfers Between PC The Ethernet Unit has a built-in FTP server function, so any workstation or
and Host Computer personal computer with an FTP client function can be used for reading files
(FTP Server Function) from or writing files to the PC. This enables large amounts of data to be trans-
ferred at one time without any need for writing a ladder program.
E-mail Capability User-defined messages, Unit error information, status information, and so on,
can be sent from the PC to the mail server as e-mail. This function allows
information generated at the production site to be sent out as e-mail.
24-VDC Power Supply for For the CS1W-ETN01 (10Base-5), a 24-VDC power supply can be used as
Transceiver the power supply for the transceiver. The Ethernet Unit voltage output pro-
vides for a voltage drop in the transceiver cables, so there is no need to adjust
the power supply voltage.
Controller Link Network Ethernet, the information-system network, can be connected to Controller
Connection Link, the control-system network, using the FINS communications service.
This allows a PC on the Controller Link network to be monitored from a PC on
the Ethernet network, and, conversely, for data to be exchanged between a
PC on the Controller Link network and a PC on the Ethernet network.
Abundant The Ethernet Unit is provided with a variety of troubleshooting functions for
Troubleshooting prompt recovery in case of errors.
Functions • Self-diagnostic function at startup
• PING command for checking remote nodes
• Inter-nodal tests for checking remote nodes
• Error log for recording error history data
• E-mail notification when errors occur
2
System Configuration Section 1-2
CX-Programmer
Transceiver Ground
50 m max.
CVM1/CV-series
CS-series PC CS-series CJ-series PC
Transceiver cable
CS1W-ETN11 CJ1W-ETN11
CS-series 100 m max. Ethernet Unit Ethernet Unit
CS1W-ETN01 (10Base-T) (10Base-T)
Ethernet Unit
CS-series CJ-series
(10Base-5) PC PC
CVM1/CV Ethernet Unit
(10Base-5)
CS-series PC
CX-Programmer
C200HX/HG/HE PC
FA computer
1 segment
Hub
3
Devices Required in a Network Section 1-3
Configuration With Use repeaters to extend the distance between nodes or to increase the num-
Segment Extension ber of connected nodes.
10Base-5
Repeater
Node Node Node Node
The devices shown in the following table must be obtained to configure a net-
work using a 10Base-5 Ethernet Unit, so prepare them in advance. Use only
devices in the network that conform to IEEE802.3 standards.
Network device Contents
CS-series 10Base-5 The 10Base-5 Ethernet Unit is a Communications Unit
Ethernet Unit that connects a CS-series PC to an Ethernet network.
(CS1W-ETN01)
24-VDC power supply This is a external 24-VDC power supply for the
purpose of providing power to the transceivers via
transceiver cable. Use a power supply with an output
current of at least 0.3 A per node. The power is
converted within the Unit to the transceiver power
supply voltage, and is provided to the transceiver.
Transceiver The transceiver is a device for interfacing between the
coaxial cable and the nodes.
Note: The Ethernet Unit can provide a maximum
current of 0.4 A to the transceiver, so use a
transceiver with a current consumption of not more
than 0.4 A. Check with the manufacturer for
information regarding transceiver current
consumption.
Transceiver cable (AUI This is the cable for connecting between transceivers
cable) and nodes.
4
Devices Required in a Network Section 1-3
Twisted-pair cables
The devices shown in the following table must be obtained to configure a net-
work using a 10Base-T Ethernet Unit, so prepare them in advance.
Network device Contents
CS-series 10Base-T The 10Base-T Ethernet Units are Communications Units
Ethernet Unit (CS1W- that connect a CS-series or CJ-series PCs to Ethernet
ETN11) or CJ-series networks.
10Base-T Ethernet Unit
(CJ1W-ETN11)
Twisted-pair cable A twisted-pair cable that connects the 10Base-T Ethernet
Unit to the hub. The twisted-pair cable must have an RJ45
Modular Connector attached to each end. Use a category
3, 4, or 5 UTP (unshielded twisted-pair) cable.
Hub A relay devices that connect multiple nodes in as star LAN.
Recommended Hub
Manufacturer Model number Specifications Inquires
Allied Telesis RH509E 9-port hub Allied Telesis
MR820TLX 9-port hub with (0120) 86-0442
10Base-5 back- (in Japan only)
bone port
5
Related Programming Devices Section 1-4
When using the default values that are already stored in the CS/CJ-series
CPU Unit, there is no need to make any settings with the CX-Programmer.
Refer to 4-2 CPU Bus Unit System Setup for details on the above settings.
6
Specifications Section 1-5
1-5 Specifications
CS-series Ethernet Units
Item Specifications
Model number CS1W-ETN01 CS1W-ETN11
Type 10Base-5 10Base-T
Applicable PCs CS-series PCs
Unit classification CS-series CPU Bus Unit
Mounting location CPU Rack or Expansion Rack
Number of Units that can be 4 max. (including Expansion Racks)
mounted
Transfer Media access method CSMA/CD
specifi- Modulation Baseband
cations
Transmission paths Bus Star
Baud rate 10 Mbps
Transmission media Coaxial cable Unshielded twisted-pair (UTP)
cable
Trans- Segment 500 m max. 100 m max.
mission length
distance Distance 2,500 m max. ---
between
nodes
Number of connect- 100/segment max. ---
able nodes
Distance between Multiples of 2.5 m ---
nodes
Transceiver cable 50 m max. ---
length
Current consumption (Unit) 400 mA max. at 5 VDC 400 mA max. at 5 VDC
External power supply Capacity: 0.3 A min. at 24 VDC (per node) ---
Inrush current: 2.5 A max.
(24-VDC startup time of 5 ms)
Permissible voltage fluctuation range:
20.4 to 26.4 VDC (24 VDC –15% to +10%)
Recommended power supply: OMRON S82J-series
Power supply to transceiver Capacity: 0.4 A at 12 V ---
Voltage fluctuation range: 13.05 to 14.48 VDC
Ripple: 2% p-p
Vibration resistance Conforms to JIS 0040.
10 to 57 Hz, 0.075-mm amplitude, 57 to 150 Hz, acceleration: 9.8 m/s2 in X, Y, and Z
directions for 80 minutes each
(Time coefficient; 8 minutes × coefficient factor 10 = total time 80 minutes)
Shock resistance Conforms to JIS 0041.
147 m/s2 three times each in X, Y, and Z directions
Ambient temperature Operating: 0 to 55°C
Storage: –20 to 75°C
Humidity 10% to 90% (with no condensation)
Atmosphere Must be free from corrosive gas.
Weight 300 g max.
Dimensions 35 x 130 x 101 mm (W x H x D)
7
Specifications Section 1-5
8
Specifications Section 1-5
Dimensions
CS1W-ETN01
CS1W-ETN11
(Unit: mm)
9
Software Configuration Section 1-6
CJ1W-ETN11
31 65
2.7
ETN11
RUN ERC SD RD
345 UNIT
EF012
6789
ABCD No.
345 NODE
EF012
6789
ABCD No.
x161
345
EF012
6789
ABCD
x160
90
ETHERNET
2.7
(Unit: mm)
Memory Card/
CS/CJ-series PC's CPU EM File Memory
UDP TCP
Ethernet Unit
IP ICMP ARP
Ethernet (V2.0)
ARP Address Resolution Protocol: Determines the Ethernet address (i.e., physical
address) by broadcasting based on the target IP address.
10
Software Configuration Section 1-6
FINS Factory Interface Network Service: A protocol that sends messages between
PCs on any of various OMRON FA networks. The user must provide mea-
sures such as retry processing to ensure that transmitted messages arrive at
the destination node.
SMTP Simple Mail Transfer Protocol: A communications protocol for sending e-mail
by TCP/IP.
11
IP Addresses Section 1-7
1-7 IP Addresses
Ethernet networks use IP addresses for communications. IP addresses (Inter-
net addresses) identify both the Ethernet network and the node (host com-
puter, Ethernet Unit, etc.) on the Ethernet network. IP addresses must be set
and controlled so that they are not duplicated.
Bit 31 15 00
Bit 31 7 00
Bit 31 00
Bit 31 00
The number of networks in each class and the number of nodes possible on
the network differ according to the class.
Class Number of networks Number of hosts
Class A Small 2 24
– 2 max. (16,777,214 max.)
Class B Medium 2 16
– 2 max. (65.534 max.)
Class C Large 8
2 – 2 max. (254 max.)
12
IP Addresses Section 1-7
nodes regardless of the networks on which they exist. To achieve this, net-
work numbers are allocated by the Network Solutions, InterNIC Registration
Services, to ensure that all Ethernet networks have unique numbers regard-
less of where they exist. The local system administrator is left the responsibil-
ity of allocating unique host numbers locally. You therefore should obtain a
network number from the InterNIC Registration Services to ensure unique-
ness and allow for future network expansions if required.
13
Precautions Section 1-8
1-8 Precautions
Be sure to observe the following precautions when installing and using an
Ethernet Unit.
1-8-1 Installation
Observe the following precautions when installing an Ethernet System. (Refer
to Section 3 Installation and Initial Setup for details.)
1,2,3... 1. Use transceiver cable that meets IEEE802.3 standards to ensure high
noise resistance.
2. Use a transceiver with a current consumption of not more than 0.4 A per
port.
3. Always turn off the power supply to the PC before connecting or discon-
necting the transceiver cable.
4. Be sure not to exceed the current capacity of the Power Supply Unit on the
Rack to which the Ethernet Unit is mounted. The current consumption of
the CS-series Ethernet Units is 400 mA maximum and the current con-
sumption of the CJ-series Ethernet Unit is 380 mA maximum. This value
added to the current consumption of all other Units mounted to the same
Rack must not exceed the capacity of the Power Supply Unit.
5. Do not install the transceiver cables or coaxial cables of the Ethernet Sys-
tem near power supply lines. If installation near possible sources of noise
is unavoidable, install the cables in grounded metal ducts or take other
measure to eliminate noise interference.
14
SECTION 2
Communications Functions
This section provides an overview of the communications functions that can be used with the Ethernet Unit.
15
Communications Functions Section 2-1
Any data
(Active open)
(Passive open)
Data type FINS commands (vari- Any data (PC’s internal DOS files in File Mem- User-defined mes-
ous commands for I/O I/O memory) ory (Memory Card or sages, error log infor-
memory communica- EM File Memory) mation, status
tions in the PC, chang- information
ing the operating mode,
reading and writing
files, and so on)
Maximum data size PC to PC: 1,980 bytes 1,984 bytes max. No particular limit. User-defined mes-
max. sages: 1,024 bytes
PC to host computer: max.
1,980 bytes max.
Host computer to PC:
2,000 bytes max.
Features Enables control of PC Communications by Files are read by Ethernet Unit status is
and host computer that standard TCP/IP and means of simple com- obtained by e-mail.
support FINS com- UDP/IP via Ethernet. mands and applica- Notification of errors is
mands. No need to set FINS tions from host received by e-mail.
addresses. computers with FTP
client functions.
Reference Section 5 FINS Com- Section 6 Socket Ser- Section 7 FTP Server Section 8 Mail
munications vices
16
Communications Functions Section 2-1
17
FINS Communications Section 2-2
To communicate with an
OMRON PC.
Refer to
To perform operations with FINS Communications Section 5 FINS Communications.
an OMRON PC other than
sending or receiving data
(for example, reading or
writing files or changing the
operating mode).
To perform operations
with a host computer (with
the FINS gateway func-
tion enabled) other than
sending or receiving data
(for example, reading or
writing files or changing
the operating mode).
To communicate with a
non-OMRON PC.
By manipulating a
dedicated control Socket services
switch. (control switch manipulation)
To communicate with an
OMRON PC within the Refer to
socket services system. Section 6 Socket Services.
18
Socket Services Section 2-3
Ethernet
CS/CJ-series
CPU Unit
Executing from the host computer FINS commands with UDP/IP headers
added enables various control operations such as the reading and writing of I/
O memory of PCs on the Ethernet network, mode changes, and file memory
operations.
Ethernet
CS/CJ-series
CPU Unit
Ethernet Unit
By Manipulating The first way to use socket services is to set the required parameters in the
Dedicated Control parameter area allocated in the DM Area, and then to request particular UDP
Switches or TCP socket services by turning ON dedicated control switches in memory.
The Ethernet Unit turns OFF the same bit when the requested process has
been completed. Data that is sent or received is automatically handled
according to the I/O memory locations specified in the parameter area.
19
Socket Services Section 2-3
Ethernet
Ethernet Unit
TCP/UDP protocol
CS/CJ-series
CPU Unit
Socket
Socket Service Request Switches
TCP/UDP Parameters
protocol
By Executing CMND(490) The other way to use socket services is to request a UDP or TCP socket ser-
vice by sending a FINS command to the Ethernet Unit by executing
CMND(490) from the CPU Unit. When the Ethernet Unit receives the socket
service request, it returns a response to the CPU Unit to confirm that it
received the request and then begins the requested processing. When the
processing is completed, the results are stored in the Results Storage Area in
the CPU Unit.
Eight TCP ports and eight UDP ports can be used.
Ethernet
FINS command
Socket
FINS response
TCP protocol
Results Storage Area
Processing results
UDP protocol
Socket interface
20
FTP Server Section 2-4
Ethernet
2-5 Mail
Data such as user-created information (1,024 bytes max. in ASCII), Ethernet
Unit error log information (64 records max.), and status information can be
sent as e-mail to specified addresses.
The e-mail can be sent with any of the following three types of timing. (Simul-
taneous specification is also possible.)
• When the Mail Send Switch turns ON.
• When an error occurs (when an error log is recorded.)
• At regular intervals.
This enables periodic e-mail and error messages to be sent from the PC to
the mail server.
Mail server
Ethernet
21
Mail Section 2-5
22
SECTION 3
Installation and Initial Setup
This section explains how to install the Ethernet Unit and make the initial settings required for operation.
23
Before Operation Section 3-1
Address Conversion (for When using the FINS communication service, it is necessary to specify the
FINS Communications nodes according to the FINS address system. Even in this case, data must be
Only) sent and received on the Ethernet network using IP addresses. Therefore, IP
addresses are converted from FINS addresses.
There are three ways to convert addresses. For each method, there are
restrictions on the maximum number nodes at the same network level for
which communications is possible. The methods and the maximum number of
nodes are shown in the following table.
Address conversion method Maximum number of nodes
(including local node)
Automatic generation (the default) 126
IP address table 32
Combined method 126
(using both automatic generation
and IP address table)
Use the CX-Programmer to select the address conversion method in the Sys-
tem Setup. For an explanation of how to make the setting, refer to 4-2 CPU
Bus Unit System Setup.
24
Before Operation Section 3-1
130.25.36.0
OR 5 Remote FINS node number
130.25.36.5 Remote IP address
Note The rightmost byte of the host number becomes the FINS node number, and
set the rest of the host number to all zeroes.
Example 1: Class B
Local IP address: 130.25.0.8
Subnet mask: 255.255.0.0
Remote FINS node number: 5
Host number
Remote IP address 130.25.0.5
Becomes 0.
Example 2: Class A
Local IP address: 130.0.0.8
Subnet mask: 255.0.0.0
Remote FINS node number: 5
Host number
Remote IP address 130.0.0.5
Becomes 0.
Note With CS-series Ethernet Units, when using either the address conversion
method (the default) or the combined method, set the local IP address
switches 7 and 8 on the back of the Ethernet Unit and the node number to the
same values, and set the other host settings to 0. If the values are wrong, the
ERC indicator will flash.
With CJ-series Units, when using either the address conversion method (the
default) or the combined method, set the rightmost byte of the local IP
address and the node number to the same values, and set the other host set-
tings to 0. If the values are wrong, the ERH indicator will flash.
Characteristics of Automatic Generation Method
The automatic address generation method has the advantage of clarifying the
correspondence between the FINS address and the IP address, but it also
has the following restrictions.
1,2,3... 1. It cannot be applied outside of the range with the same network ID.
2. The remote host number must be within the range of FINS node numbers
(1 to 126).
3. The Ethernet Unit’s host number and the node number must be set to the
same value.
The automatic address generation method is the default setting, so there is no
need to set it with the CX-Programmer if the setting has not been changed.
25
Overview of Startup Procedure Section 3-2
Setup. With different segments, nodes with different network IDs can also be
registered.
IP address
FINS node IP address table
address
18 153.214.0.62
FINS node number 20 153.214.0.129 IP address
23 153.218.51.8
1,2,3... 1. Not more than 32 pairs of node number and IP addresses can be regis-
tered in the IP address table, so that limits the number of nodes, including
the local node, to 32.
2. The correspondences must be preset, or the remote FINS node numbers
will not be recognized.
Combined Method The combined method incorporates both the automatic generation method
and the IP address table method. It first refers to the IP address table, and if
there is an applicable FINS address, it reads the corresponding IP address. If
there is no applicable FINS address, it uses the automatic generation method
to calculate an IP address.
FINS node number
IP address table
If not found in
IP address table Host number: XX.XX.00.00
+ IP address
FINS node number: XX
1,2,3... 1. Determine the local IP address and the address conversion method.
Refer to 3-1 Before Operation.
2. Set the unit number of the Ethernet Unit as a CPU Bus Unit.
Refer to 3-4 Switch Settings.
3. Set the node address.
Refer to 3-4 Switch Settings.
4. Set the local IP address.
Refer to 3-4 Switch Settings.
5. Mount the Unit to the Backplane.
Refer to 3-5 Mounting to a PC.
26
Overview of Startup Procedure Section 3-2
6. Connect to the network. Connect the transceiver cable and external 24-
VDC power supply for 10Base-5 systems and the twisted-pair cable for
10Base-T systems.
Refer to 3-6 Connecting to the Network.
7. Turn ON the external 24-VDC power supply (for 10Base-5 systems) and
turn ON power to the CPU Unit. When turning ON the power supply, either
first turn ON the external power supply (i.e., the power to the transceiver),
and then turn ON the power to the CPU Unit afterwards, or else turn them
both ON at the same time. If the power is turned ON first to the CPU Unit,
a communications error will be generated.
8. Create the I/O tables using a Programming Device, such as CX-Program-
mer, CX-Net, or a Programming Console. (This step can be omitted if the
I/O table has already been created.)
Refer to 3-7 Creating an I/O Table.
9. Create the routing tables using the CX-Net. (This step is required only if
FINS communications are used, or if CMND(490) is used by a PC with mul-
tiple Communications Units mounted to it.)
Refer to 3-8 Creating Routing Tables.
10. Make the settings in the System Setup using the CX-Programmer. (Create
the IP address table and IP router table.)
Refer to 3-9 System Setup, 3-10 Creating an IP Address Table, and 3-11
Creating an IP Router Table.
This step is required only in the following cases:
• When using a method other than automatic generation for IP address
conversion. (Address conversion method, IP address table.)
• When using the mail notification function.
• When setting a subnet mask.
• When setting an FTP login name and password.
• When Ethernet is configured in multiple segments. (IP router table)
• When Ethernet 4.28 is used (broadcast settings)
• When the UDP port number for FINS is changed to something other
than the default setting (9600).
11. Check communications. (Use PING command and an internode test.)
CJ Series
1,2,3... 1. Determine the local IP address and the address conversion method.
Refer to 3-1 Before Operation.
2. Set the unit number of the Ethernet Unit as a CPU Bus Unit.
Refer to 3-4 Switch Settings.
3. Set the node address.
Refer to 3-4 Switch Settings.
4. Mount the Unit to the PC.
Refer to 3-5 Mounting to a PC.
5. Connect to the network. Connect the twisted-pair cable.
Refer to 3-6 Connecting to the Network.
6. Turn ON power to the CPU Unit.
7. Create the I/O tables using a Programming Device, such as CX-Program-
mer, CX-Net, or a Programming Console.
27
Unit Components Section 3-3
28
Unit Components Section 3-3
3-3-1 Nomenclature
CS-series Ethernet Units
CS1W-ETN01 (10Base-5)
Front
Indicators
Display the operating status
of the Unit.
CS1W-ETN11 (10Base-T)
Front
Indicators
Display the operating status
of the Unit.
Ethernet Connector
Used to connect the Ethernet transceiver cable.
29
Unit Components Section 3-3
Note The Ethernet address can also be checked using the FINS command, CON-
TROLLER DATA READ. (Refer to 11-3-2 CONTROLLER DATA READ.)
30
Unit Components Section 3-3
Slider
Mount to other Units.
Indicators
ETN11
Display the operating status of the Unit.
RUN ERC SD RD
345 NODE
EF012
6789
ABC No.
x161
Node Number Switches
345
Used to set the Ethernet Unit’s FINS node number
EF012
6789
ABCD
0
x16 in two digits hexadecimal.
ETHERNET
Ethernet Connector
Used to connect the Ethernet twisted-pair cable.
Slider
Mount to other Units.
Note An IP address label is provided with the CJ1W-ETN11. Writing the IP address
and the subnet mask on this label and then attaching it to the front of the Unit
allows the IP address and subnet mask to be confirmed easily.
ETN11
RUN ERC SD RD
Example
ERH TCP FTP TS IP ADDRESS
ABCD No.
SUBNET MASK
345 NODE 255.255.255.0
EF012
6789
ABCD No.
x161
Attach the label to the front
345 of the Ethernet Unit
EF012
6789
ABCD
x160 between the node number
switches and the Ethernet
IP ADDRESS
connector.
133.113. 0. 42
SUBNET MASK
255.255.255.0
ETHERNET
31
Unit Components Section 3-3
Lot No.
OMRON Corporation MADE IN JAPAN
@@@@@@@@@@@@
Ethernet Address
Ethernet address (12 digits)
Note The Ethernet address can also be checked using the FINS command, CON-
TROLLER DATA READ. (Refer to 11-3-2 CONTROLLER DATA READ.)
3-3-2 Indicators
The status of the indicators show the operating status of the Unit.
CS1W-ETN01 (10Base-5) CS1W-ETN11 (10Base-T) CJ1W-ETN11 (10Base-T)
ETN11
RUN ERC SD RD
RUN P/S
ERC ERH ERH TCP FTP TS
SD TCP
RD FTP
TS
32
Switch Settings Section 3-4
Setting range:
0 to F
Note 1. Turn OFF the power supply before setting the unit number.
2. If the unit number is being set for the first time or changed, then an I/O table
must be created for the PC.
Unit Number and CPU Bus With CS-series PCs, words are automatically allocated in the CIO Area and
Unit Allocations the DM Area. The Ethernet Unit uses these words for receiving control data
from the CPU Unit and for notifying the CPU Unit of Ethernet Unit and com-
munications status. The word addresses in the allocated areas for the CPU
Bus Unit are important in creating the user program for using the Ethernet
Unit, so be careful to take them into account when setting the unit number.
The following table shows the areas allocated for the CPU Bus Unit by unit
number. This table only shows the correspondences between unit numbers
and the areas allocated for the CPU Bus Unit. For more details, refer to Sec-
tion 4 System Setup and Memory Allocations.
33
Switch Settings Section 3-4
DM Area Allocations
Unit No. Allocated words Unit No. Allocated words
(decimal) (decimal)
0 (0) D30000 to D30099 8 (8) D30800 to D30899
1 (1) D30100 to D30199 9 (9) D30900 to D30999
2 (2) D30200 to D30299 A (10) D31000 to D31099
3 (3) D30300 to D30399 B (11) D31100 to D31199
4 (4) D30400 to D30499 C (12) D31200 to D31299
5 (5) D30500 to D30599 D (13) D31300 to D31399
6 (6) D30600 to D30699 E (14) D31400 to D31499
7 (7) D30700 to D30799 F (15) D31500 to D31599
Setting range:
01 to 7E (1 to 126 decimal)
The left switch sets the sixteens digit (most significant digit) and the right
switch sets the ones digit (least significant digit). The node number is factory-
set to 01.
When using the automatic generation method for address conversion, set the
node number to the same value as that of the local IP address switches. If this
is not possible, then either the IP address table method or the combined
method must be used for address conversion. For details, refer to 4-2 CPU
Bus Unit System Setup.
If the FINS communications service is not being used over the Ethernet net-
work, then there is no problem if the node number duplicates that of another
Ethernet Unit. The node number must still be set from 01 to 7E, however, or
the ERC indicator will light.
Note Turn OFF the power supply before setting the node number.
34
Switch Settings Section 3-4
Setting range:
0 to F
The switches are all factory-set to 0 (00.00.00.00). The Ethernet Unit cannot
be used with this setting; a proper IP address must be set. The following set-
tings cannot be made for the IP address, or the ERC indicator will flash.
All bits in the network number field set to 0 or 1.
All bits in the host number field set to 0 or 1.
All bits in the subnet number field set to 1.
The beginning of the IP address set to 127 (7F Hex)
Example: 127.35.21.16
Note 1. When using the automatic generation method for address conversion, set
switches 7 and 8 to the same values as the node number setting, and set
the rest of the host number to zeroes. For details regarding the host num-
ber, refer to 1-7 IP Addresses. The value for the host number field in the IP
address must match the value for the node number or the ERC indicator
will flash.
2. If a subnet mask is to be set, use the CX-Programmer to set it in the CPU
Bus Unit System Setup. For details, refer to 4-2 CPU Bus Unit System Set-
up.
ABCD No. 0 to F
Note 1. Turn OFF the power supply before setting the unit number.
2. If the unit number is being set for the first time or changed, then an I/O table
must be created for the PC.
35
Switch Settings Section 3-4
Unit Number and CPU Bus With CJ-series PCs, words are automatically allocated in the CIO Area and
Unit Allocations the DM Area. The Ethernet Unit uses these words for receiving control data
from the CPU Unit and for notifying the CPU Unit of Ethernet Unit and com-
munications status. The word addresses in the allocated areas for the CPU
Bus Unit are important in creating the user program for using the Ethernet
Unit, so be careful to take them into account when setting the unit number.
The following table shows the areas allocated for the CPU Bus Unit by unit
number. This table only shows the correspondences between unit numbers
and the areas allocated for the CPU Bus Unit. For more details, refer to Sec-
tion 4 System Setup and Memory Allocations.
DM Area Allocations
Unit No. Allocated words Unit No. Allocated words
(decimal) (decimal)
0 (0) D30000 to D30099 8 (8) D30800 to D30899
1 (1) D30100 to D30199 9 (9) D30900 to D30999
2 (2) D30200 to D30299 A (10) D31000 to D31099
3 (3) D30300 to D30399 B (11) D31100 to D31199
4 (4) D30400 to D30499 C (12) D31200 to D31299
5 (5) D30500 to D30599 D (13) D31300 to D31399
6 (6) D30600 to D30699 E (14) D31400 to D31499
7 (7) D30700 to D30799 F (15) D31500 to D31599
345 NODE
EF012
6789
345
EF012
6789
ABCD
x160
The top switch sets the sixteens digit (most significant digit) and the bottom
switch sets the ones digit (least significant digit). The node number is factory-
set to 01.
36
Mounting to a PC Section 3-5
When using the automatic generation method for address conversion, set the
node number to the same value as the rightmost byte of the local IP address.
If this is not possible, then either the IP address table method or the combined
method must be used for address conversion. For details, refer to 4-2 CPU
Bus Unit System Setup.
If the FINS communications service is not being used over the Ethernet net-
work, then there is no problem if the node number duplicates that of another
Ethernet Unit. The node number must still be set from 01 to 7E, however, or
the ERC indicator will light.
Note Turn OFF the power supply before setting the node number.
3-5 Mounting to a PC
3-5-1 Mounting to a CS-series PC
Ethernet Units can be mounted to any slots in either a CS-series CPU Rack or
a CS-series Expansion CPU Rack, but the number of slots to which they can
be mounted depends on the Backplane. Up to four Ethernet Units can be
mounted to a single PC. If it is mounted in combination with other CPU Bus
Units (e.g., Controller Link Units), the maximum total number of CPU Bus
Units that can be mounted is 16.
Note Tighten PC Backplane mounting screws to a torque of 1.2 N⋅m, and the Unit’s
screws to a torque of 0.8 N⋅m.
with 2, 3, 5, 8, or 10 slots.
2, 3, 5, 8, or 10 slots
(Expansion Backplane not possible with 2-slot CPU Backplane.) Up to four Units can be mounted
CS1W-BI033/BI053/BI083/BI103 CS-series Expansion Backplane to the slots shown in the diagrams
on the left.
CS-series Expansion Rack
Can mount to any position,
PS
with 3, 5, 8, or 10 slots.
3, 5, 8, or 10 slots
C200H Expansion I/O Backplane
C200H Expansion Rack
PS
37
Mounting to a PC Section 3-5
P C I
S P C
U
P I
S I
Up to four Ethernet
Units can be mounted.
10 Units max. End cover
Expansion Backplane
P I
S I
P I
S I
38
Connecting to the Network Section 3-6
CS1W-ETN11 and CJ1W- The following standards and specifications apply to the connectors for the
ETN11 Ethernet twisted-pair cable.
• Electrical specifications: Conforming to IEEE802.3 standards.
• Connector structure: RJ45 8-pin Modular Connector
(conforming to ISO 8877)
39
Connecting to the Network Section 3-6
40
Connecting to the Network Section 3-6
Lock post
Slide latch
Lock post
CS1W-ETN01
!Caution Turn OFF the PC’s power supply before connecting or disconnecting twisted-
pair cable.
!Caution Allow enough space for the bending radius of the twisted-pair cable as shown
in below.
35mm
41
Connecting to the Network Section 3-6
2. Connect the cable to the hub. Be sure to press in the cable until it locks into
place.
Examples of the above two steps are provided in Appendix A. Request ca-
ble installation from a qualified professional.
3. Connect the cable to the connector on the Ethernet Unit. Be sure to press
in the cable until it locks into place.
Example: CS1W-ETN11
CS1W-ETN11
Crimp terminals must be used for the power supply cable. The applicable M3
crimp terminals and recommended products are shown below.
42
Connecting to the Network Section 3-6
!Caution Be sure to turn OFF the power supply to the PC before connecting to the
power supply terminal block.
Note 1. Do not connect a power supply with a voltage other than 24 VDC.
2. To reduce the effects of noise, wire the power supply cable separately from
power lines and high-voltage lines.
3. Crimp terminals must be used for wiring. Do not just twist loose wire
strands.
4. Use the recommended crimp terminals.
5. Use the proper tools and procedure for installing the crimp terminals. Con-
sult with the terminal manufacturers for instructions. If the proper tools and
procedure are not used, it may cause the cable to become disconnected.
6. When installing the crimp terminals, use a length of cable that will not need
to be bent too much when combined with the terminals. Also, cover the ter-
minal and the end of the cable with insulating tape and heat-absorbing tub-
ing.
7. Be careful not to mistake the plus and minus terminals when connecting
the power supply.
8. Tighten the terminal block screws to a torque of 0.5 N•m. If the screws are
too loose, it may result in short-circuiting, malfunctioning, or fire damage.
9. Check the wiring carefully before turning ON the power.
10. Use a dedicated power supply, and do not use the same power supply for
the I/O power supply, motor power lines, or control power lines.
11. Position the power supply as close as possible to the Unit, and separate
the power supply cable by at least 20 cm from other power lines in order to
avoid adverse effects from high-voltage lines.
12. Noise influence may be reduced by installing a noise filter near the primary
side of the power supply.
13. Carefully twist the power supply cable that is to be connected to the Unit.
14. Do not excessively bend or stretch the cable.
15. Do not place anything on top of cables or cords.
16. If errors occur due to noise related to an external power supply, it may be
possible to solve the problem by not grounding the communications power
supply. Normally the switching power supply is connected to the case and
capacitor, as shown in the following diagram, so along with isolating the FG
terminal it is necessary to insulate the power supply itself from the control
panel.
43
Connecting to the Network Section 3-6
Power
AC power supply AC input supply DC output
circuit
Case
Standard Switching Power Supply Circuit
DC power supply
(1) When S82J is used. (2) When another power supply is used.
17. If communications are adversely affected by noise from the Unit’s power
supply terminals, the problem may be solved by implementing the mea-
sures shown below.
a) Add to the communications retry processing at the application. In par-
ticular, noise resistance capacity can be improved by increasing the
number of retries for applications using UDP.
b) Insert a noise filter right next to the Unit’s power supply terminals.
24 VDC
24-VDC power supply
Noise filter
As close as possible
Recommended filter: MAS-1206-33 by Nemic-Rambda K.K.
Specifications Rated voltage: 250 V (AC, DC)
Rated current: 6 A
Power Supply The following table shows the power supply specifications. Make sure that
Specifications these specifications are met.
Item Specifications
Power supply voltage 24 VDC
Allowable power supply voltage 20.4 VDC to 26.4 VDC (24 VDC –15% + 10 %)
fluctuation
Current consumption 300 mA max. at 24 VDC (per node)
Inrush current 2.5 A max. (24 VDC when rise time is 5 ms)
44
Creating an I/O Table Section 3-7
Applicable Programming The following Programming Devices can be used with CS/CJ-series PCs.
Devices
Programming Console
Model number Key Sheet (required) Recommended cable (required)
C200H-PRO27-E CS1W-KS001-E CS1W-CN224 (cable length: 2.0 m)
CS1W-CN624 (cable length: 6.0 m)
CQM1-PRO01-E CS1W-CN114 (cable length: 0.1 m)
Connecting Programming To connect a Programming Console, attach a CS/CJ-series Key Sheet and
Devices then connect the Console to the CPU Unit’s peripheral port. (It cannot be con-
nected to the RS-232C port.)
45
Creating Routing Tables Section 3-8
Initial screen
CH
SHIFT
*DM
CHG
WRIT ????
WRITE
Password
000000CPU BU ST?
0:CLR 1:KEEP
WRIT OK
46
Creating Routing Tables Section 3-8
Local Network Table The local network table is a table describing the correspondences among unit
numbers of the Communications Units and Boards mounted to each node
(PC or FA Computer).
Unit #04
Example
Unit #05
Unit #06 Local Network Table
Unit #07 Local network Unit number
address
1 04
2 05
3 06
4 07
Network #1
Network #2
Network #3
Network #4
Note 1. The unit number is set (from 0 to F: 1 to 15) by the rotary switch on the front
of the Ethernet Unit.
2. The network address is the number of the network (from 1 to 127) to which
the Communications Unit or Board is connected. It is set when the local
network table is created.
Relay Network Table A relay table is a table that shows the nodes to which data should be sent first
in order to send data to a network that is not connected to the local node. It
shows the correspondence between the address of the final destination net-
work, and the network address and node number of the first relay point of the
path to reach there. When internetwork communications are carried out, the
end network can be reached by following the relay points.
The following example shows a routing table for sending data from PC #1 (the
local node: network address 1, node number 1) to PC #4 (the destination
node: network address 3, node number 2).
Node #2
PC #3 Unit #0
(relay node) Node #1 PC #4 (destination node)
PC #1 (local node) PC #2 (relay node) Unit #1
Node #3
Node #1 Node #2 Node #2
Node #1
PC #1 PC #2 PC #3 End network
relay network table relay network table relay network table
Local
End Relay Relay End Relay Relay network Unit
network network node network network node address number
To go to network #3,
first go to node #2 at
network #2.
To go to network #3, (To go to network #3 (The network is the same,
first go to node #3 at according to the local so go to node #2 at network #3.)
network #1. network table, go
through the unit
number of the local
CPU Rack.)
47
Creating Routing Tables Section 3-8
Note 1. To transfer routing tables for multiple nodes to a PC in one batch, connect
the CX-Net to a PC with only one Communications Unit mounted. Routing
tables cannot be transferred to other nodes from a PC with multiple Com-
munications Units mounted.
2. Routing tables can only be transferred as a batch to multiple nodes within
the same network as the PC to which the CX-Net is connected.
48
Creating Routing Tables Section 3-8
PC #1
Node #a
Network #A PC #2
Node #b
Node #c
PC #3
Network #B
Node #d
PC #4
Node #e
Node #f
Network #C Node #g
In the table for PC #3, for example, if network #A is taken as the end network,
then network #B becomes the relay network and node #c becomes the relay
node. If network #C is taken as the end network, then network #B still
becomes the relay network and node #e becomes the relay node.
49
Creating Routing Tables Section 3-8
Unit #5
Node #6 Network #10
Unit #3 Unit #4
Node #4 Node #5
Unit #2 Unit #7
Node #3 Node #15
Network #20 Network #30
PC #2 Routing Table
(Local network table) (Relay network table)
Local CPU Bus End Relay Relay
network Unit No. network network node
PC #3 Routing Table
(Local network table) (Relay network table)
Local CPU Bus End Relay Relay
network Unit No. network network node
PC #4 Routing Table
(Local network table) (Relay network table)
Local CPU Bus End Relay Relay
network Unit No. network network node
PC #5 Routing Table
(Local network table) (Relay network table)
Local CPU Bus End Relay Relay
network Unit No. network network node
PC #6 Routing Table
(Local network table) (Relay network table)
Local CPU Bus End Relay Relay
network Unit No. network network node
PC #7 Routing Table
(Local network table) (Relay network table)
Local CPU Bus End Relay Relay
network Unit No. network network node
50
System Setup Section 3-9
51
Creating an IP Address Table Section 3-10
Item Default
Destination mail address Not set.
SMTP server address 0.0.0.0 (Not set.)
Connecting and Using a The IP address table must be created using the Unit settings on a CX-Pro-
Programming Device for grammer connected to the PC. It cannot be created using a Programming
the PC Console. For details on how to connect and use a CX-Programmer, refer to
the CX-Programmer User’s Manual.
Note An IP address table can also be registered using the FINS command IP
ADDRESS TABLE WRITE. For details, refer to IP ADDRESS TABLE WRITE
on page 237.
Note 1. An IP router table needs to be created only when the IP address table
method or the combined method is used for address conversion.
2. With CJ-series Ethernet Units, it is possible to register one default IP router
(the IP router selected when the applicable network number is not regis-
tered).
Connecting and Using a The IP router table must be created using the Unit settings on a CX-Program-
Programming Device for mer connected to the PC. It cannot be created using a Programming Console.
the PC For details on how to connect and use a CX-Programmer, refer to the CX-Pro-
grammer User’s Manual.
52
Checking Communications Section 3-12
53
Checking Communications Section 3-12
Note 1. The internode test can be easily carried out by manipulating dedicated
control switches for the Ethernet Unit. For details, refer to 9-3 Internode
Test.
2. Internode testing of the FINS communications service can also be carried
out by means of the FINS commands INTERNODE ECHO TEST and
BROADCAST TEST RESULTS READ. For details, refer to 11-3-4 INTER-
NODE ECHO TEST and 11-3-5 BROADCAST TEST RESULTS READ.
Application Conditions
• A 1-to-1 connection is made between the host computer (workstation or
personal computer) and the PC (Programmable Controller). There are no
communications beyond the network, i.e., there are no inter-network com-
munications.
• The MEMORY AREA READ command (a FINS command addressed to
the PC with command code 0101 hex) is sent to the PC from the host
computer via Ethernet.
• IP address conversion is set to automatic generation (default setting).
Setting Method
54
Checking Communications Section 3-12
When the above settings have been completed, reset the power supply.
4. Check Communications
In order to check that connection is established with Ethernet Unit at an IP
protocol level (i.e., whether communications are possible), send the follow-
ing PING command from the host computer to the Ethernet Unit.
PING 133.113.0.42
(For details, refer 9-2-2 Host Computer.)
If a normal response is not returned for the PING command, it is possible
that there is a problem with a connection cable or an IP address. If this is
the case, sending any FINS command will end in an error. Check the ca-
bles and other setup conditions and eliminate any possible factors prevent-
ing normal communications. Confirm that a normal response is received to
the PING command.
5. Send a FINS Command
Send the following kind of PC-addressed FINS command to the PC (MEM-
ORY AREA READ, command code 0101) from the host computer’s UDP
port 9600 (same port number as the Ethernet Unit’s default FINS UDP
port). If a normal response is received, this means that the startup test is
completed.
For details of FINS frames (ICF to SID below), refer to 5-4-2 FINS Frames.
For details of FINS commands, refer to the CS/CJ-series Programmable
Controllers Communications Commands Reference Manual (W342).
Command
80 00 02 01 2A 00 01 28 00 01 01 01
ICF RSV GCT DNA DA1 DA2 SNA SA1 SA2 SID Command code
(READ)
82 00 64 00 00 96
55
Checking Communications Section 3-12
Normal Response
C0 00 02 01 28 00 01 2A 00 01 01 01
ICF RSV GCT DNA DA1 DA2 SNA SA1 SA2 SID Command code
(READ)
00 00
56
SECTION 4
System Setup and Memory Allocations
This section explains the System Setup and the words allocated in the CIO Area and the DM Area for Ethernet Units.
57
Allocated Words Section 4-1
to to
to to
n + 24
m + 99
The words in the CIO Area and DM Area are allocated according to the unit
number as shown in the following tables. The 25 words are allocated per Unit
in the CIO Area and 100 word are allocated per Unit in the DM Area.
58
CPU Bus Unit System Setup Section 4-2
DM Area Allocations
Unit No. Allocated words Unit No. Allocated words
(decimal) (decimal)
0 (0) D30000 to D30099 8 (8) D30800 to D30899
1 (1) D30100 to D30199 9 (9) D30900 to D30999
2 (2) D30200 to D30299 A (10) D31000 to D31099
3 (3) D30300 to D30399 B (11) D31100 to D31199
4 (4) D30400 to D30499 C (12) D31200 to D31299
5 (5) D30500 to D30599 D (13) D31300 to D31399
6 (6) D30600 to D30699 E (14) D31400 to D31499
7 (7) D30700 to D30799 F (15) D31500 to D31599
59
CPU Bus Unit System Setup Section 4-2
mer. With CJ-series Ethernet Units, however, it is possible to set the local IP
address and the subnet mask using the FINS command IP ADDRESS
WRITE. For details, refer to 11-3-20 IP ADDRESS WRITE.
4-2-1 Settings
Item CX-Programmer default
Broadcast setting All 1s (4.3BSD specifications)
Address conversion method Automatic address generation
FINS UDP port number 9600
Local IP address (CJ Series only) 0.0.0.0 (The local IP address set in allo-
cated words m+98 and m+99 of the DM
Area is enabled.)
Subnet mask 0.0.0.0 (A value corresponding to the IP
address is used.)
FTP login name Not set. (CONFIDENTIAL)
FTP password Not set.
IP address table Not set.
IP router table Not set.
Broadcast Settings
Set the method for specifying the broadcast address.
Setting Meaning
All 1s (4.3BSD) (Default) Broadcast with host number set to all ones. (4.3BSD
specifications)
All 0s (4.2BSD) Broadcast with host number set to all zeroes. (4.2BSD
specifications)
60
CPU Bus Unit System Setup Section 4-2
Note When using automatic address generation (the default) for address conver-
sion, make the following settings.
With the CS Series, set local IP address DIP switches 7 and 8 on the back of
the Ethernet Unit to the same value as the node number setting on the front of
the Unit, and set all other host settings to 0.
With the CJ Series, set the rightmost byte of the local IP address and the
node number setting on the front of the Ethernet Unit to the same value, and
set all other host settings to 0.
If the IP address host number does not match the node number, the ERC indi-
cator (CS Series) or ERH indicator (CJ Series) will flash.
IP Address Table
With an IP address table, the address is converted according to a preset table
of correspondences (i.e., an IP address table) between FINS node numbers
and IP addresses.
The following is an example of an IP address table.
FINS messages addressed to FINS node number 23 are sent to the node with
IP address 150.31.3.68.
Automatic Address Generation and IP Address Table
With the combined method, first the IP address table is referenced. If the
applicable node is not registered, then the automatic address generation
method is used.
FINS UDP Port Number
Set the method for specifying the UDP port number for FINS communications.
Setting Meaning
9600 (Default) Uses the default value of 9600.
User-defined Uses the input value (from 1 to 65535).
61
CPU Bus Unit System Setup Section 4-2
Set the local IP address in the allocated words in the DM Area when using the
CPU Bus Unit System Setup at its default settings (i.e., for simple operation).
The setting is usually made with a Programming Console.
Application Setting device Setting area Remarks
Operation with the CX-Programmer CPU Unit Bus System Setup The IP address set in the CPU
CPU Unit Bus Sys- Unit Bus System Setup is
tem Setup set as stored in the allocated words
desired (i.e., The in the DM Area.
default settings are
not used.)
Simple operation Programming Console (CX- Allocated words in the DM The setting in the allocated
(i.e., The CPU Unit Programmer can also be Area words in the DM Area is
Bus System Setup is used.) enabled only when the IP
used at its default address in the CPU Unit Bus
settings. Only the IP System Setup is set to
address is set.) 00.00.00.00.
If the IP address in the CPU
Unit Bus System Setup is set
to a value other than
00.00.00.00, this value is
stored in the allocated words
in the DM Area.
Note 1. With CS-series Ethernet Units, set the local IP address using the 8 rotary
switches on the back of the Unit. For details, refer to Setting the Local IP
Address on page 34.
2. If no local IP address is set in either the CPU Bus Unit System Setup or the
allocated words in the DM Area (m+98 and m+99), the Ethernet Unit will
not be able to perform communications. Be sure to set the local IP address
in one of these areas. It is not possible, however, to set the following IP ad-
dresses. If any of these values are set, the ERH indicator will flash.
• IP addresses where all network number bits are 0.
• IP addresses where all host number bits are 0.
• IP addresses where all subnet number bits are 0.
• IP addresses starting with 127 (7F Hex), e.g., 127.35.21.16.
Subnet Mask
Set all bits in the subnet mask that correspond to the bits in the IP address
used for the network number and the bits used for the subnet number to “1,”
and set all bits in the subnet mask that correspond to the bits in the IP
address used for the host number to “0”. The subnet mask must be set only
when configuring a system which includes subnetworks.
If no subnet mask is set, the subnet mask will be automatically set to one of
the following values, depending on the local IP address setting:
Class Subnet mask value
Class-A IP address 255.0.0.0
Class-B IP address 255.255.0.0
Class-C IP address 255.255.255.0
62
CPU Bus Unit System Setup Section 4-2
130.25.36.253 130.26.2.254
Node A Node B
IP router
63
CPU Bus Unit System Setup Section 4-2
64
CPU Bus Unit System Setup Section 4-2
• User Data
(Refer to Sending User Data for Errors below.)
• Error Log Information
(Refer to Sending Error Log Information for Errors below.)
• Status Information
(Refer to Status Information for Errors below.)
If none of these types of data is selected, mail will not be sent even if the set-
ting is made for mail to be sent whenever an error is registered.
Setting Meaning
Not selected (Default) Mail not sent when error is registered in error log.
Selected Mail not sent when error is registered in error log.
Periodic Mail
Specify whether or not mail is to be sent at the time intervals set for the mail
interval in the mail settings. The following types of data can be specified to be
sent as mail.
• User data
(Refer to Periodic Mail for User Data below.)
• Error log information
(Refer to Periodic Mail for Error Log Information below.)
• Status information
(Refer to Periodic Mail for Status Information.)
65
CPU Bus Unit System Setup Section 4-2
If none of these types of data is selected, mail will not be sent even if the set-
ting is made for mail to be sent whenever an error is registered.
Setting Meaning
Not selected (Default) Mail is not sent periodically.
Selected Mail is sent periodically.
Mail Interval
When mail is sent periodically, it is sent at the time interval that is set here.
The setting range is 1 to 1,440, in units of 10 seconds, so the mail can be sent
at intervals of from once every 10 seconds to once every 10 days. This setting
is only enabled when the periodic mail setting (see above) is selected.
If the mail interval is set to 0, then mail will not be sent periodically. If it is set to
a value greater than 1,440, it will be processed as 1,440 (10 days).
The default setting is 0 (mail not sent periodically).
Periodic Mail for User Data
Specify whether or not user data is to be added to mail contents when mail is
sent periodically. The user data is ASCII data stored with the CPU Unit’s I/O
memory address set for the mail function’s “user-created mail data address”
at the beginning. (When user data is sent, 1,024 bytes or the data up to the
null code (00 Hex) is transmitted.)
Setting Meaning
Not selected (Default) User data not included in periodic mail.
Selected User data included in periodic mail.
User-created Mail Data Specify, by area classification and beginning word address, the CPU Unit’s
Address memory address for the data (user-created information) to be transmitted
when data is sent by user request. The default setting is for no address to be
set.
Local Mail Address In 50 or fewer characters, specify the mail address to be entered in the “From”
field in the mail.
Destination Mail Address In 50 or fewer characters, specify the address to which the mail is to be sent.
SMTP Server Address Specify the IP address of the mail server (i.e., the SMTP server address). The
setting range is 0.0.0.0 to 255.255.255.255. The default is 0.0.0.0 (nothing
set).
66
CIO Area Allocations Section 4-3
The following items in the diagram can also be checked using software switch
settings on the CX-Programmer.
• The status of UDP/TCP sockets 1 to 8 (Opening Flag, Receiving Flag,
Sending Flag, Closing Flag, Results Storage Error Flag, Socket Open
Flag)
• Service status (FTP status)
For explanations of how to use the related communications services listed in
the above diagram, refer to the indicated sections.
67
CIO Area Allocations Section 4-3
68
CIO Area Allocations Section 4-3
Opening Flag
Receiving Flag
Results Storage Error Flag
Sending Flag
TCP/UDP Open Flag
Closing Flag
Note The status of these flags can also be checked using the software switch set-
tings on the CX-Programmer.
Opening Flag (Bit 0)
Turns ON when an open request is received either by control switch manipula-
tion or the CMND(490) instruction, and turns OFF again when the open pro-
cessing has been completed. When CMND(490) is used, the Results Storage
Error Flag (bit 14) will turn ON at the same time as the Opening Flag turns
OFF if there is an error in the Results Storage Area designation.
Receiving Flag (Bit 1)
Turns ON when a receive request is received either by control switch manipu-
lation or the CMND(490) instruction, and turns OFF again when the receive
processing has been completed. When CMND(490) is used, the Results Stor-
age Error Flag (bit 14) will turn ON at the same time as the Receiving Flag
turns OFF if there is an error in the Results Storage Area designation.
69
CIO Area Allocations Section 4-3
70
CIO Area Allocations Section 4-3
Bit 08: Internode test flag (OFF: Test stopped, ON: Test running)
71
CIO Area Allocations Section 4-3
Note A transceiver is built into the CS1W-ETN11 and CJ1W-ETN11. If this bit turns
ON, the Ethernet Unit has malfunctioned.
Socket Service Request When a socket service request is executed by control switch manipulation, it
Switches 1 to 8 (CPU Unit is the following bits that are manipulated. For details, refer to 6-2 Using Socket
to Ethernet Unit) Services with Socket Service Request Switches.
15 14 13 12 11 10 9 8
7 6 5 4 3 2 1 0
n+19 to n+22
72
DM Area Allocations Section 4-4
Note For CS-series Ethernet Units, this area is the IP Address Display Area and
data in this area can be transferred from the Ethernet Unit to the CPU Unit
only. For CJ-series Ethernet Units, this area is the IP Address Display/Setting
Area and data in this area can be transferred in either direction.
The meanings of the items shown in the above diagram are explained on the
following pages. For details regarding the related communications services
shown in the diagram, refer to the indicated sections.
Internode Test Remote Network Address and Node Number (CPU Unit to Ethernet Unit)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m Remote network address Remote node number
Specify the remote network address and node number in hexadecimal within
the following ranges:
Remote network address: 00 to 7F Hex (0 to 127 decimal)
Remote node number: 01 to 7E Hex (0 to 126 decimal)
If a remote network address is set to 00, it will specify the local network (i.e.,
the network to which the Ethernet Unit is connected.)
73
DM Area Allocations Section 4-4
Specify, in hexadecimal, the amount of time to wait for the internode test
response.
0000 (Hex): 2 seconds
0001 to FFFF (Hex): 0.01 to 655.35 seconds
Timeout
Error code
Response error
Send error
Data does not match
Routing table error
Send parameter error
Internode test results are reflected here. (The bits all turn back OFF when the
internode test is started.)
Bits 0 to 5 turn ON when their applicable error occurs.
The error code for the error that occurred is stored in bits 13 to 15. The mean-
ings of the error codes are shown in the following table.
Bit Meaning
15 14 13
0 0 0 Normal
0 0 1 Timeout error
0 1 0 Response (response code) error
0 1 1 Send error
1 0 0 Data disagreement error
1 0 1 Routing table error (See note.)
1 1 0 Send parameter error (See note.)
Note When a routing table error or a sent parameter error occurs, the number of
internode test runs is not incremented.
Internode tests are executed repeatedly as long as the Internode Test Start
Switch, one of the Unit Control Switches in the CIO area, remains ON.
In this word, specify in hexadecimal the number of times that the internode
test is actually to be executed.
0000 to FFFF (Hex): 0 to 65,535 times
74
DM Area Allocations Section 4-4
When the count reaches FFFF (Hex), it will start over again at 0. The count
value will be retained until the internode test is restarted.
Note When a routing table error or a transmission parameter error occurs, the num-
ber of internode tests is not incremented.
The number of timeout errors that have occurred in the internode test is
stored in this word in hexadecimal.
0000 to FFFF (Hex): 0 to 65,535 times
When the count reaches FFFF (Hex), it will not go any further. The count
value will be retained until the internode test is restarted.
The number of response errors that have occurred in the internode test is
stored in this word in hexadecimal.
0000 to FFFF (Hex): 0 to 65,535 times
When the count reaches FFFF (Hex), it will not go any further. The count
value will be retained until the internode test is restarted.
The number of transmission errors that have occurred in the internode test is
stored in this word in hexadecimal.
0000 to FFFF (Hex): 0 to 65,535 times
When the count reaches FFFF (Hex), it will not go any further. The count
value will be retained until the internode test is restarted.
Number of Times Internode Test Data Did Not Match (Ethernet Unit to CPU Unit)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+8 Number of data disagreement errors (0000 to FFFF)
The number of data disagreement errors that have occurred in the internode
test is stored in this word in hexadecimal.
0000 to FFFF (Hex): 0 to 65,535 times
When the count reaches FFFF (Hex), it will not go any further. The count
value will be retained until the internode test is restarted.
The connection status for each TCP socket is stored by code in this word. For
details, refer to Appendix D TCP Status Transitions.
75
DM Area Allocations Section 4-4
The transmission statuses of user mail, periodic mail, and error log mail are
stored in this word as shown in the following table.
Bits Status
2 1 0
6 5 4
10 9 8
OFF OFF OFF Mail is either waiting to be sent or can be sent using
the Mail Send Switch. No mail is being sent.
OFF OFF ON Mail is being sent.
OFF ON OFF Mail is either waiting to be sent or can be sent using
the Mail Send Switch. The previous mail transmis-
sion was completed normally.
ON ON OFF Mail is either waiting to be sent or can be sent using
the Mail Send Switch. An error occurred in the previ-
ous mail transmission.
ON ON ON Mail cannot be sent (system setting error).
When socket services are requested by control switch manipulation, the set-
tings must be made in advance in a Socket Service Parameter Area. The
parameters used will vary depending on the service requested. For details,
refer to 6-2 Using Socket Services with Socket Service Request Switches.
IP Address Display/Setting Area
CS-series Ethernet Units
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+98 SW1 SW2 SW3 SW4
m+99 SW5 SW6 SW7 SW8
76
DM Area Allocations Section 4-4
be stored here and the ERC indicator will flash. (Refer to Setting the Local IP
Address.)
CJ-series Ethernet Units
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+98 (1) (2) (3) (4)
m+99 (5) (6) (7) (8)
Note 1. If a value other than 00.00.00.00 is set as the local IP address in the CPU
Bus Unit System Setup, even if an IP address is set in the allocated words
in the DM Area, it will be overwritten with the setting in the CPU Bus Unit
System Setup.
2. If no local IP address is set in either the CPU Bus Unit System Setup or the
allocated words in the DM Area (m+98 and m+99), the Ethernet Unit will
not be able to perform communications. Be sure to set the local IP address
in one of these areas. It is not possible, however, to set the following IP ad-
dresses. If any of these values are set, the ERH indicator will flash.
• IP addresses where all network number bits are 0.
• IP addresses where all host number bits are 0.
• IP addresses where all subnet number bits are 0.
77
SECTION 5
FINS Communications
This section provides information on communicating on Ethernet Systems and interconnected networks using FINS
commands. The information provided in the section deals only with FINS communications in reference to Ethernet Units.
FINS commands issued from a PC are sent via the SEND(090), RECV(098), and CMND(490) instructions programmed
into the user ladder-diagram program. Although an outline of these instructions is provided in this section, refer to the CS/
CJ-series Programmable Controllers Programming Manual (W340) for further details on programming these instructions.
79
Overview of FINS Communications Section 5-1
Ethernet header
IP header
FINS frame
FCS
PC
or host computer
Ethernet Unit
Ethernet
Ethernet Unit
PC
When a FINS command is issued from the Ethernet Unit, the IP address is
found from the FINS address specified by CMND(490). For details, refer to 3-
1 Before Operation.
Note The UDP/IP protocol does not provide communications control to ensure
communications reliability. Consequently, the FINS communications services
using the UDP/IP protocols cannot guarantee that any message arrived safely
and unaltered at the destination. Methods to ensure reliability, such as retries
and appropriate processing of FINS responses, must be programmed into the
user application.
80
Overview of FINS Communications Section 5-1
Host computer to PC • The host computer issues the data for the SEND(090)/RECV(098) or CMND(490) in-
struction as a UDP datagram. Programs are required for sending data and for receiving
and processing responses.
Data
UDP packet issued by user program
81
Procedure Before Using FINS Communications Section 5-2
No
Set the FINS UDP port number Set the FINS UDP port numbers
for all Ethernet Units on the for all of the Ethernet Units on
Ethernet network to the default the Ethernet network to the
of 9600. same value.
Note The location of the local IP address setting depends on the type of CPU Unit
in the following way.
CS Series: Rotary switches on back of Ethernet Unit.
CJ Series: CPU Bus Unit System Setup or allocated words in the DM Area.
82
Sending Commands From a PC Section 5-3
Note 1. The maximum data length is limited to 512 bytes for data exchange be-
tween the PC and SYSMAC LINK Systems or the PC and SYSMAC BUS/
2 Remote I/O Systems.
2. When broadcasting, do not require a response.
PC Communications Data The following table shows the I/O data areas involved when SEND(090) and
Areas RECV(098) are used.
Area Range
CIO Area CIO 0000 to CIO 6143
Work Area W000 to W511
Holding Area H000 to H511
Auxiliary Area A000 to A959 (See note 1.)
Timer Area TIM0000 to 4095
Counter Area CNT0000 to 4095
DM Area D00000 to D32767
EM Area E00000 to E32767 (See note 2.)
Note 1. Data cannot be written to words A000 to A447 in the Auxiliary Area.
2. A maximum of 13 banks in the EM Area can be used. For details regarding
the EM Area, refer to the operation manual for the PC that is used.
83
Sending Commands From a PC Section 5-3
SEND(090) The SEND(090) instruction sends the data in n number of words, starting from
the beginning word S at the local node, to the words starting from the begin-
ning word D at the remote destination node (node number N).
Number
…
…
of words
(n)
Number of retries
Number of words (n) 0 to F (Hex): 0 to 15 retries
0001 to 03DE (Hex): 1 to 990 words Communications port number: 0 to 7
Response
0: Required.
Destination network number 1: Not required.
00 (Hex): Local network
01 to 7F (Hex): 1 to 127
Note The message service does not guarantee that a message will reach the desti-
nation node. A message may be lost during transmission due to factors such
as noise. To prevent this from occurring when using message services, it is
common to set up retry processing at the node from which instructions are
issued. With the SEND(090), RECV(098), and CMND(490) instructions, retry
processing is executed automatically by specifying the number of retries, so
specify a number other than 0.
84
Sending Commands From a PC Section 5-3
RECV(098) With the RECV(098) instruction, the data in m number of words, starting from
the beginning word S at the remote node (node number M) is received at the
words starting from the beginning word D at the local node.
Local node Remote node number N
…
Number
…
of words
(m)
S: Remote node beginning word
D: Local beginning word
C: First word of control data (below)
Number of retries
Number of reception words (m) 0 to F (Hex): 0 to 15 retries
0001 to 03DE (Hex): 1 to 990 words Communications port number: 0 to 7
Response
0: Required.
Destination network number 1: Not required.
00 (Hex): Local network
01 to 7F (Hex): 1 to 127
Note The message services function does not guarantee that a message will reach
the destination node. A message may be lost during transmission due to fac-
tors such as noise. In order to prevent this from occurring when using mes-
sage services, it is common to set up retry processing at the node from which
instructions are issued. With the SEND(090), RECV(098), and CMND(490)
instructions, retry processing is executed automatically by specifying the num-
ber of retries, so specify a number other than 0.
85
Sending Commands From a PC Section 5-3
CMND(049) The CMND(049) instruction sends n bytes of command data, starting from the
beginning word S at the local node, to the node at node number N. the data in
m number of words, starting from the beginning word S at the remote node
(node number M) is received at the words starting from the beginning word D
at the local node.
Local node Destination node number N
Command
Com-
mand Interpretation
data: n
bytes
…
Response
S: Beginning command storage word
D: Beginning response storage word Execution
C: First word of control data (below)
…
Response
data: m bytes
Number of retries
Destination network number 0 to F (Hex): 0 to 15 retries
00 (Hex): Local network Communications port number: 0 to 7
01 to 7F (Hex): 1 to 127
Response
0: Required.
1: Not required.
Destination Unit address
00 (Hex): CPU Unit
10 to 1F: (Hex): Unit #0 to #15
E1 (Hex): Inner Board
FE (Hex): Unit connected to network Response monitor time
0000 (Hex): 2 s
Destination node number N 0001 to FFFF (Hex): 0.1 to 6,553.5 s (in units of 1 s)
00 to 7E (Hex); 0 to 126
The same data can be broadcast to all nodes on the network by
setting the destination node number to FF (Hex).
The range of node addresses is different for networks other than Ethernet.
Note The message services function does not guarantee that a message will reach
the destination node. A message may be lost during transmission due to fac-
tors such as noise. In order to prevent this from occurring when using mes-
sage services, it is common to set up retry processing at the node from which
instructions are issued. With the SEND(090), RECV(098), and CMND(490)
instructions, retry processing is executed automatically by specifying the num-
ber of retries, so specify a number other than 0.
86
Sending Commands From a PC Section 5-3
87
Sending Commands From a PC Section 5-3
88
Sending Commands From a PC Section 5-3
Instruction 1
Instruction 2
Instruction 3
Instruction 4
Instruction 5
Instruction 6
Instruction 7
Instruction 8
There are eight communications ports, so up to eight communications instructions can be executed
at a time. The number of messages that can be sent or received with a single CPU Bus Unit ser-
vice, though, is not more than two each for the CPU Unit to the Ethernet Unit and for the Ethernet
Unit to the CPU Unit.
Execution Communications
condition Port Enabled Flag
KEEP(011) A Input A remains ON from start to completion of commu-
nications instruction.
Reset B
Communications
instructions Executes communications instructions.
@SEND
@RECV
@CMND
Communications
Port Enabled Flag
DIFU(013) B Creates reset input. (Turns reset B ON
after execution of communications in-
struction.)
Communications
Port Error Flag
Send Error Flag display
(Retry can be executed.)
89
Sending Commands From a PC Section 5-3
Communications Flags The execution status of the SEND(090), RECV(098), and CMND(490) instruc-
tions is always reflected by the communications flags (i.e., the Communica-
tions Port Enabled Flag and the Communications Port Error Flag). The CS/
CJ-series CPU Unit’s communications flags are allocated in the Auxiliary Area
as shown in the following table.
Flag name Address Contents
Word Bits
Communications Port A202 Bit 7: Port 7 OFF: Execution enabled
Enabled Flag Bit 6: Port 6 (being executed)
Bit 5: Port 5 ON: Execution disabled
Bit 4: Port 4 (not being executed)
Bit 3: Port 3
Bit 2: Port 2
Bit 1: Port 1
Bit 0: Port 0
Communications Port A219 Bit 7: Port 7 OFF: Normal completion
Error Flag Bit 6: Port 6 ON: Abnormal completion
Bit 5: Port 5
Bit 4: Port 4
Bit 3: Port 3
Bit 2: Port 2
Bit 1: Port 1
Bit 0: Port 0
Note With CS/CJ-series PCs, communications ports 0 to 7 are also used for exe-
cuting the PCMR(260) (PROTOCOL MACRO) instruction, so these flags are
used in common for SEND(090), RECV(098), CMND(490), and PCMR(260).
While PCMR(260) is being executed, SEND(090), RECV(098), and
CMND(490) cannot be executed at the same communications port.
Communications Port The status of a SEND(090), RECV(098), and CMND(490) instruction after
Completion Codes execution is reflected as a communications port completion code, in one word
(two bytes) of data as shown in the following table. (The value is 0000 during
instruction execution.) The recorded status is saved until execution of the next
instruction.
Word Contents
A203 Communications Port 0 Completion Code
A204 Communications Port 1 Completion Code
A205 Communications Port 2 Completion Code
A206 Communications Port 3 Completion Code
A207 Communications Port 4 Completion Code
A208 Communications Port 5 Completion Code
A209 Communications Port 6 Completion Code
A210 Communications Port 7 Completion Code
The meanings of the communications port completion codes are the same as
those for FINS commands and responses. When CMND(490) is used, how-
ever, even if a FINS command has an abnormal completion, it will not be
reflected in the communications port completion code. For details, refer to
Communications Port Error Flag and Completion Codes for CMND(490)
below.
Bits 08 to 15 in the communications port completion code correspond to the
first byte of the response code, and bits 00 to 07 correspond to the second
byte. For details, refer to 10-6 Troubleshooting with Response Codes.
90
Sending Commands From a PC Section 5-3
91
Sending Commands From a PC Section 5-3
120000
@MOV(21) Input CIO 120000 remains ON from the start of
#000A
SEND(090) execution until completion.
D00000
Control Data Creation
@MOV(21) Word Contents Meaning
#0002
D0000 00 0A Number of send words = 10
D00001
D0001 00 02 Destination network number = 2
@MOV(21) D0002 04 00 Destination node number = 4
#0400
Destination unit address = 0
D00002
D0003 07 05 Response required.
@MOV(21) Communications port No. used = 7
#0705 Number of retries = 5
D00003 D0004 00 64 Response monitor time = 10 s
@MOV(21)
#0064
D00004
Send Data Creation
@XFER(70)
Ten words of data from word CIO 0000 is
#000A
stored from D00010 onwards.
0000
D00010
@SEND(90)
D00010 Ten words of data from D00010 at the local node is
sent to D00020 onwards at network number 2, node
D00020 number 4, unit address 0 (the PC).
D00000
120000 A21907
120000
Send Error Display
92
Sending Commands From a PC Section 5-3
120002
@MOV(21) Input CIO 120002 remains ON from the start of
RECV(098) execution until completion.
#0010
D00005 Control Data Creation
Word Contents Meaning
@MOV(21)
#0003 D0005 00 10 Number of reception words = 16
D00006 D0006 00 03 Source network number = 3
@MOV(21)
D0007 20 00 Source node number = 32
#2000 Source unit address = 0
D00007 D0008 07 05 Response required.
Communications port No. used = 7
@MOV(21)
Number of retries = 5
#0705
@MOV(21)
#0000
D00009
A total of 16 words of data beginning from word A100
@RECV(98)
at network number 3, node number 32, unit address 0
(the PC) is received at word CIO 2000 onwards of the
A100 local node.
2000
D00005
120002 A21907
121001
Reception Error Display
Note With CS/CJ-series PCs, the Communications Port Enabled Flags at bits 0 to 7
in word A202 turn OFF even when the PCMR(260) instruction is being exe-
cuted using the ports corresponding to those flags.
93
Sending Commands From a PC Section 5-3
SEND(090)
The transmission delay for the SEND(090) instruction can be calculated using
the following equation, which is illustrated in the following diagram.
Max. delay = Local node service cycle + local node service processing time
+ transmission processing time + reception processing time +
remote node service cycle + remote node service processing
time + CPU data set processing time (remote node)
SEND(090) executed
in user program
CPU Bus Unit service cycle (local node)
CPU Bus Unit service processing time (local node)
Transmission processing time
Reception processing time
CPU Bus Unit service cycle (remote node)
CPU Bus Unit service processing time (remote node)
Maximum transmission delay CPU data set processing time (remote node)
CPU Bus Unit Service The CPU Bus Unit service cycle is a single PC cycle.
Cycle
CPU Bus Unit Service This is the time required to process CPU Bus Units and is approximately 1 ms
Processing Time for Ethernet Units.
Note 1. The actual operating environment can cause transmission delays larger
than those calculated with the methods given here. Among the causes of
longer delays are the following: traffic on the network, window sizes at net-
work nodes, traffic through the Ethernet Unit (e.g., socket servicing, FTP
server communications, etc.), and the system configuration.
2. The CPU data set processing time is the standard when the peripheral ser-
vice time is set in the CPU Unit System Setup to the default of 4%. As this
value is increased, the processing time is shortened.
Example Calculations The following example shows calculations for sending 256 words between two
PC nodes using SEND(090). The local node’s CPU cycle time is 10 ms, and
the remote node’s CPU cycle time is 5 ms. Calculations are shown in the fol-
lowing table.
94
Sending Commands From a PC Section 5-3
Item Calculation
CPU Bus Unit service cycle (local node) PC cycle time = 10 ms
CPU Bus Unit service processing time (local 1 ms
node)
Transmission processing time 256 x 0.011 + 3 = 5.816 ≅ 6 ms
Reception processing time 256 x 0.011 + 3 = 5.816 ≅ 6 ms
CPU Bus Unit service cycle (remote node) 5 ms
CPU Bus Unit service processing time (remote 1 ms
node)
CPU data set processing time (remote node) 256 x 0.02 + 20 = 25.12 ≅ 25 ms
Total 10 + 1 +6 + 6 + 5 + 1 + 25= 54 ms
RECV(098)
The transmission delay for the RECV(098) instruction can be calculated using
the following equation, which is illustrated in the following diagram.
Max. delay = Local node service cycle + local node service processing time
+ transmission processing time (command) + reception pro-
cessing time (command) + remote node service cycle + remote
node service processing time + CPU data read processing
time (remote node) + remote node service processing time +
transmission processing time (response) + reception process-
ing time (response) + local node service cycle + local node ser-
vice processing time + CPU data set processing time (local
node)
RECV(098) executed in user program CPU data set processing time
Service processing
CPU Bus Unit service processing time (local node)
CPU Bus Unit service
processing time (local node)
CPU Bus Unit Service The CPU Bus Unit service cycle is a single PC cycle.
Cycle
CPU Bus Unit Service This is the time required to process CPU Bus Units and is approximately 1 ms
Processing Time for Ethernet Units.
CPU Data Read The CPU data read processing time is the integer portion of the minimum
Processing Time cycle time, which satisfies the following formula.
Number of words transferred x 0.02 + 20 ms ≤ Integer portion of remote node
cycle time
95
Sending Commands From a Host Computer Section 5-4
Example Calculations The following example shows calculations for receiving 256 words between
two PC nodes using RECV(098). The local node’s CPU cycle time is 10 ms,
and the remote node’s CPU cycle time is 15 ms. Calculations are shown in the
following table.
Item Calculation
CPU Bus Unit service cycle (local node) PC cycle time = 10 ms
CPU Bus Unit service processing time 1 ms
(local node)
Transmission processing time (command) 3 ms
Reception processing time (command) + 3 + 15 + 1 = 19 ms
Remote node service cycle + CPU Bus
Unit service processing time (remote
node)
CPU data read processing time (remote 256 x 0.02 + 20 = 25.12 → 30 ms
node)
Service processing 1 ms
Transmission processing time (response) 256 x 0.011 + 3 = 5.816 ≅ 6 ms
Reception processing time (response) + (256 x 0.011 + 3) + 10 + 1 = 16.816 ≅
Local node service cycle + CPU Bus Unit 17 ms
service processing time (local node)
CPU data set processing (local node) 256 x 0.02 + 20 = 25.12 ≅ 25 ms
Total 10 + 1 + 3 + 19 + 30 + 1 + 6 + 17 + 25 =
112 ms
Note 1. The FINS UDP port number at the Ethernet Unit is set to the default of
9600. It can be changed in the CPU Bus Unit System Setup, but the same
FINS UDP port number must be set for all of the Ethernet Units on the
same Ethernet network.
2. Even if the Ethernet network is comprised of multiple segments, set the
same value for the FINS network number.
96
Sending Commands From a Host Computer Section 5-4
Example 1: Intranetwork In this example, the host computer and the remote node (Ethernet Unit) are
Addressing on the same network. The communications parameters specified from the
host computer would be as follows:
Destination IP Address: 196.36.32.100 (Ethernet Unit of remote node)
UDP port number: FINS UDP port No. (Ethernet Unit of remote node)
FINS addresses (Remote node CPU Unit):
Network number: 1
Node number: 100
Unit number: 0
FINS addresses (Host computer):
Network number: 1
Node number: 50
Unit number: 0
Host computer Remote node
IP address: 196.36.32.50 IP address: 196.36.32.100
FINS network/node/unit: 1/50/0 (Hex) FINS network/node/unit: 1/100/0 (Hex)
Ethernet
Example 2: Internetwork In this example, the host computer and the remote node (Ethernet Unit) are
Addressing on different networks, connected by a relay node. The communications
parameters specified from the host computer would be as follows:
Destination IP Address: 196.36.32.100 (Ethernet Unit of relay node)
UDP port number: FINS UDP port number (Ethernet Unit of relay node)
FINS addresses (Remote node CPU Unit):
Network number: 2
Node number: 1
Unit number: 0
FINS addresses (Host computer):
Network number: 1
Node number: 50
Unit number: 0
Host computer
IP address: 196.36.32.50
FINS network/node/unit: 1/50/0 hex) Relay node Remote node
IP address: 196.36.32.100 FINS network/node/unit: 2/1/0 (Hex)
Ethernet Unit
Controller Link
97
Sending Commands From a Host Computer Section 5-4
FINS Response Frame The response code (one byte each for MRES and SRES) for the command is
Configuration added at the beginning of the FINS parameter/data field in the response
frame.
Size (bytes) Contents
98
Sending Commands From a Host Computer Section 5-4
Settings The Ethernet Unit IP address is 196.36.32.100, and the FINS node number is
100. IP address conversion is set to automatic generation.
The workstation’s IP address is 196.36.32.50 and its FINS node number is 50.
The FINS UDP port number is 9600 (default).
Sample Program
1 #include <errno.h>
2 #include <stdio.h>
3 #include <sys/types.h>
4 #include <sys/socket.h>
5 #include <netinet/in.h>
6 #include <signal.h>
7
8 #define FINS_UDP_PORT 9600
9 #define SERV_IP_ADDR ”196.36.32.100” /*Ethernet Unit IP ADDRESS*/
10 #define MAX_MSG 2010
11 #define RESP_TIMEOUT 2
12
13
99
Sending Commands From a Host Computer Section 5-4
14 /*
15 * FINS COMMUNICATIONS SAMPLE PROGRAM
16 */
17 main(argc,argv)
18 int argc;
19 char *argv[];
20 {
21 int sockfd;
22 struct sockaddr_in ws_addr,cs_addr;
23 char fins_cmnd[MAX_MSG],fins_resp[MAX_MSG];
24 int sendlen,recvlen,addrlen;
25 char sid=0;
26 extern recv_fail();
27
28 /*GENERATE UDP SOCKET*/
29 if((sockfd=socket(AF_INET,SOCK_DGRAM,0))<<0)
30 err_exit(”can’t open datagram socket”);
31
32 /*ALLOCATE IP ADDRESS AND PORT # TO SOCKET*/
33 bzero((char*)&ws_addr,sizeof(ws_addr));
34 ws_addr.sin_family=AF_INET;
35 ws_addr.sin_addr.s_addr=htonl(INADDR_ANY);
36 ws_addr.sin_port=htons(FINS_UDP_PORT);
37 if(bind(sockfd,(struct sockaddr*)&ws_addr,sizeof(ws_addr))<0)
38 err_exit(”can’t bind local address”);
39
40 /*
41 *GENERATE MEMORY AREA READ COMMAND
42 *(READ 150 WORDS FROM D00100.)
43 /*
44 fins_cmnd[0]=0x80; /*ICF*/
45 fins_cmnd[1]=0x00; /*RSV*/
46 fins_cmnd[2]=0x02; /*GCT*/
47 fins_cmnd[3]=0x01; /*DNA*/
48 fins_cmnd[4]=0x64; /*DA1*/ /*Ethernet Unit FINS NODE NUMBER*/
49 fins_cmnd[5]=0x00; /*DA2*/
50 fins_cmnd[6]=0x01; /*SNA*/
51 fins_cmnd[7]=0x32; /*SA1*/ /*WS FINS NODE NUMBER*/
52 fins_cmnd[8]=0x00; /*SA2*/
53 fins_cmnd[9]=++sid; /*SID*/
54 fins_cmnd[10]=0x01; /*MRC*/
55 fins_cmnd[11]=0x01; /*SRC*/
56 fins_cmnd[12]=0x82; /*VARIABLE TYPE: DM*/
57 fins_cmnd[13]=0x00; /*READ START ADDRESS: 100*/
58 fins_cmnd[14]=0x64;
59 fins_cmnd[15]=0x00;
60 fins_cmnd[16]=0x00; /*WORDS READ: 150*/
61 fins_cmnd[17]=0x96;
62
63
64 /*SEND FINS COMMAND*/
65 bzero((char*)&cs_addr,sizeof(cs_addr));
66 cs_addr.sin_family=AF_INET;
67 cs_addr.sin_addr.s_addr=inet_addr(SERV_IP_ADDR);
68 cs_addr.sin_port=htons(FINS_UDP_PORT);
69
70 signal(SIGALRM,recv_fail);
71
72 CMND_SEND:
73 sendlen = 18;
74 if(sendto(sockfd,fins_cmnd,sendlen,0,&cs_addr,sizeof(cs_addr))
==sendlen){
75 alarm(RESP_TIMEOUT); /*START RESPONSE MONITOR TIMER*/
76 printf(”send length %d¥n”,sendlen);
100
Sending Commands From a Host Computer Section 5-4
77 {
78 else{
79 err_exit(”send error”);
80 }
81
82 /*RECEIVE FINS RESPONSE*/
83 addrlen = sizeof(cs_addr);
84 if((recvlen = recvfrom(sockfd,fins_resp,MAX_MSG,0,&cs_addr,&addrlen))
<0){
85 if(errno == EINTR)
86 goto CMND_SEND; /*RE-SEND FINS COMMAND*/
87 err_exit(”receive error”);
88 }
89 else{
90 alarm(0); /*STOP RESPONSE MONITOR TIMER*/
91 printf(”recv length %d¥n”,recvlen);
92 if(recvlen<14) /*ILLEGAL RESPONSE LENGTH CHECK*/
93 err_exit(”FINS length error”);
94 if((fins_cmnd[3]!=fins_resp[6])||(fins_cmnd[4]!=fins_resp[7])
95 ||(fins_cmnd[5]!=fins_resp[8])){ /
*DESTINATION ADDRESS CHECK*/
96 err_exit(”illegal source address error”);
97 }
98 if(fins_cmnd[9]!=fins_resp[9]) /*SID CHECK*/
99 err_exit(”illegal SID error”);
100 }
101
102
103 /*CLOSE SOCKET*/
104 close(sockfd);
105 }
106 /*
107 *ERROR PROCESSING FUNCTIONS
108 */
109 err_exit(err_msg)
110 char *err_msg;
111 {
112 printf(”client: %s %x¥n”,err_msg,errno);
113 exit(1);
114 }
115
116 /*
117 *SIGNAL CAPTURE FUNCTIONS
118 */
119 recv_fail()
120 {
121 printf(”response timeout error ¥n”);
122 }
101
FINS Server Section 5-5
words read) + CPU cycle time + CPU data read processing time (Refer to
page 96)
Note 1. The transfer time may exceed the calculated value due to the actual oper-
ating environment. Factors affecting the transfer time are network traffic,
the window size of each node, Ethernet Unit traffic (e.g., socket services,
FTP server communications, etc.), and the system configuration.
2. The CPU data set processing time is the standard when the peripheral ser-
vice time is set in the CPU Unit System Setup to the default of 4%. As this
value is increased, the processing time is shortened.
Example This example shows the calculations for a host computer sending a write
command for 256 words to the PC. The standard for the maximum transfer
delay time is as follows when the PC’s CPU cycle time is 10 ms.
Maximum transfer delay time
= Host computer communications processing time + 4 + (0.011 x 256) + 10
+ (256 x 0.02 + 20) = host computer communications processing time + 42 ms
102
SECTION 6
Socket Services
This section describes the functionality provided by the Ethernet Unit via the socket services.
103
Overview Section 6-1
6-1 Overview
6-1-1 Socket Service Functions
The socket services allow devices on the Ethernet to send and receive vari-
ous data using the UDP or TCP protocol. The socket services can be used by
CS/CJ-series PCs through the user program by manipulating dedicated bits
(called Socket Service Request Switches) or by executing the CMND(490)
instruction.
The two methods of using the socket services are as follows:
• Dedicated Bits (Socket Service Request Switches)
Requests can be made to a socket service by setting parameters and
then merely manipulating specific Socket Service Request Switches.
• CMND(490)
Requests can be made to a socket service by sending service request
commands to the Ethernet Unit.
Note One of the main differences between using Socket Service Request Switches
and using CMND(490) is in the number of sockets that can be connected
simultaneously, as shown in the following table.
Protocol Socket Service Request CMND(490)
Switches
UDP Total of 8 sockets max. 8 sockets max.
TCP 8 sockets max.
call
Socket Service
Request Switches UDP data
Refreshed
transfers
Socket Service
(See Note 1.)
Parameters
Refreshed
(See Note 2.)
Note 1. Socket Service Request Switches in the CPU Bus Area in the CIO Area
are used to send a service request from the CPU Unit to the Ethernet Unit.
2. The Socket Service Parameters in the CPU Bus Unit Area in the DM Area
are used to specify the service being requested from the Ethernet Unit.
The CPU Bus Unit Area in the DM Area is also used to receive results of
processing from the Ethernet Unit to the CPU Unit.
Using CMND(490)
CS/CJ-series PC
FINS
command TCP data
transfers System User program
Sockets
Sockets
call
FINS response
UDP data
Processing transfers
results
104
Overview Section 6-1
6-1-2 Sockets
Sockets are interfaces that allow TCP and UDP protocols to be used directly
from the user program. With personal computers, socket are provided as C
language interface libraries, which allow TCP or UDP protocols to be pro-
gramming using library functions. With UNIX computers, socket interfaces are
supported in the form of system calls.
The CS/CJ-series PCs support the socket service from the user program. The
user program requests service functions either by manipulating Socket Ser-
vice Request Switches in the CPU Bus Unit Area in the CIO Area or by send-
ing FINS commands to the Ethernet Unit by executing CMND(490) instruction
in the ladder diagram.
Socket communications services can be used to transfer arbitrary data
between a PC and a host computer or between two PCs. The Ethernet sup-
ports two socket services: a UDP socket service and a TCP socket service.
Refer to 2-1-3 Selecting Communications Services for a comparison of the
socket services and the FINS communications service.
UDP socket 1
UDP open request
Socket
services
Sockets
TCP socket 8
TCP socket
port 65535
105
Overview Section 6-1
quently, port numbers 1024 and above should be used for socket services.
The Ethernet Unit does not support port #0.
Some port numbers over 1024 may be reserved on some workstations (for
example, the X-window server is port #6000). Do not use port numbers that
are already reserved for other processes.
The setting status of the UNIX workstation port numbers can be checked in /
etc/services.
TCP Communications The following procedure is followed each time data is transmitted to ensure
that the data arrives normally at the remote node:
1,2,3... 1. The remote node returns ACK when data is received normally.
2. The local node sends the next data after it receives ACK, or it resends the
same data if ACK is not returned within the specified time.
Transmitted data
Send Receive
request ACK (acknowledge) request
made. made.
Resent data
Local node Remote node
With the TCP protocol, the remote IP address and remote TCP port number
are specified when an open request is made for a socket. When a send
request is made, the number of bytes to send and the send data are specified.
When a receive request is made, the number of bytes to receive is specified.
With the TCP protocol, communications with another remote device are not
possible until the socket that was opened has been closed.
UDP Communications Data is simply sent to the remote. Unlike TCP, the reception of data is not
checked and data is not resent. To increase communication reliability, data
resends must be programmed by the user in user application.
Transmitted data
Send Receive
request request
made. ACK (acknowledge: only when made.
processed by application)
With the UDP protocol, the remote IP address and remote TCP port number
are not specified when an open request is made for a socket. When a send
request is made, the remote IP address, the remote TCP port number, the
number of bytes to send, and the send data are specified. When a receive
request is made, the number of bytes to receive is specified. (In addition to the
received data, the source IP address and source UDP port number are stored
in the response data).
With the UDP protocol, communications with another remote device are pos-
sible even if the socket that was opened is not closed.
106
Overview Section 6-1
Passive OPEN and Active An open command is executed for a node to establish a connection. The open
OPEN method differs depending on whether the node is a client or server. A passive
open method is used to open the node as a server and the active open
method is used to open the node as a client.
Active Passive
open open
Client Server
TCP TCP
socket socket
Connection
Note 1. TCP sockets must be closed once a connection has been made before
communications are possible with other TCP sockets. This is true for other
server and client sockets. Up to eight TCP sockets can be open simulta-
neously.
2. With UDP sockets, communications are possible with more than one other
UDP socket even without closing the connection.
3. When a connection is made between two nodes, the process at the node
providing a service is called the server, and the process at the node re-
questing the service is called the client. The server is started first and waits
for a service request from a client. The client requests to the server that a
connection be opened and then transmits data. When the TCP protocol is
used, however, the client–server relationship does not need to be pro-
grammed in the application because it is automatically handled by the pro-
tocol.
TCP Communications The communications procedure is shown below for communications between
Procedure a host computer and Ethernet Unit using a TCP socket. In this example, the
host computer is the server and the Ethernet Unit is the client.
107
Overview Section 6-1
Passive open
Active open
Connection requested
ACK (acknowledge)
Data receive request
Send next data
Close Close
Cautions when Using TCP An example of the fragmentation and transmission of data using the TCP is
shown in the following illustration.
1,2,3... 1. The sending user program sends a request to send 1,984 bytes of data.
2. The Ethernet Unit fragments the send data into Data A with 1,024 bytes
and Data B with 960 bytes.
3. Data A and Data B are sent consecutively.
4. The receiving user program sends a request to receive 1,984 bytes of data.
However, only data A is sent in the first packet, and data B is not received.
5. Another receive request to receive data must be made before the remain-
ing data, Data B, is received.
108
Overview Section 6-1
Only first
Data B 1,024 bytes
960 bytes 5. Second receive request
1,984 bytes
2. Data separated
3. Data A and Data B Data B
Data B sent
consecutively. Remaining
960 bytes
When using TCP protocol, the fragmented data is passed to the user pro-
gram. Therefore, the receiving user program must be able to evaluate the end
of the data transmission, and repeatedly send receive requests until all data
has been received. The receive request is sent twice in the example shown
above, but the data would be even more fragmented if a router was included
in the communications path, and the number of receive requests would need
to be increased accordingly.
When making the receive request, it is not necessary to specify the same data
length as the sent data length. For example, if the length setting is shorter
than the actual length of the data, all the data can be received by repeating
the receive requests.
Note If communications are with a different segment and data is sent via the TCP
protocol, data will be fragmented into units of 536 bytes.
Cautions when Using UDP An example of fragmentation and transmission of data using the UDP is
shown in the following illustration.
1,2,3... 1. The transmission user program sends a request to send 1,984 bytes of da-
ta.
2. The Ethernet Unit fragments the send data into Data A with 1,472 bytes
and Data B with 512 bytes.
3. Data A and Data B are sent consecutively.
4. When the receiving user program sends a request to receive 1,984 bytes
of data, Data A and Data B are linked to restore the original data, which is
passed to the user program.
Sending User Program Ethernet Unit Receiving Node Receiving User Program
1. Send request
1,984bytes 1,472 bytes
Source data Data A
4. First receive request
1,984 bytes
Data B Data A Data B
512 bytes
2. 3.
109
Overview Section 6-1
data request is set smaller than the actual length of the data, all received data
exceeding the set data length will be discarded.
Note 1. The formulas above calculate guideline figures for the transfer delays when
the Ethernet Unit uses a single socket only. The user program execution
time is not included in these calculations.
2. The communications time for the remote node varies according to the
equipment used. If the remote node is not an Ethernet Unit, refer to the
documentation for the actual equipment to calculate the communications
time.
3. The delay times may exceed the calculated values due to the operating en-
vironment. Factors affecting the delay times are the network load ratio
(amount of network traffic), the window size of each node, the load on the
Ethernet Unit (including operating multiple socket services, FTP server,
etc.), and the system configuration.
4. The values for A and B given above are guideline values for when the pe-
ripheral service time in the PC Setup in the CPU Unit is set to the default
value of 4%. If the peripheral service time setting is increased, the values
of A and B will decrease.
Example
The following table shows calculation of the approximate maximum transfer
delay for sending 512 bytes of data between two PCs using CMND(490) for a
TCP socket.
Local PC cycle time: 5 ms
Remote PC cycle time: 10 ms
Item Formula
Local receive processing time 5 x 5 + 20 x 2 + 30 = 95 ms
Local send processing time 5 x 5 + 20 x 2 + 30 = 95 ms
110
Overview Section 6-1
Item Formula
Remote send processing time 10 x 5 + 20 x 2 + 30 = 120 ms
Remote receive processing time 10 x 5 + 20 x 2 + 30 = 120 ms
Maximum transmission delay 95 + 95 + 120 + 120 = 430 ms
UDP Socket Service • The UDP socket sets a broadcast address for the remote node address to
broadcast data to all nodes of the network simultaneously. The maximum
length of broadcast data is 1,472 bytes. Data in multiple fragments (over
1,473 bytes for a UDP socket) cannot be broadcast.
• The UDP socket does not check the transmitted data to ensure communi-
cations reliability. To increase communication reliability, communications
checks and retries must be included in the user application program.
TCP Socket Service • If the TCP socket of the remote node closes (the connection is broken)
during communications, the TCP socket at the local node must also be
closed. The communications Results Storage Area can be used to check
if the connection has been broken. Close the local socket immediately
after detecting that the remote TCP socket has closed. The following situ-
ations indicate that the remote socket has closed.
TCP Receive Results Storage Area:
Response code = 004B (error at remote node)
TCP Send Results Storage Area:
Response code = 0020 (connection broken with remote socket during
transmission)
111
Using Socket Services with Socket Service Request Switches Section 6-2
• Data can remain in a buffer at the local node if the remote TCP socket
closes during communications. Any data remaining in the buffer will be
discarded when the TCP socket is closed. To avoid problems of this
nature, steps will have to be taken in the application program, such as
sending data to enable closing, and then only closing once reception of
this data has been confirmed.
• When closing a connection for a TCP socket, the first port to be closed
cannot be reopened for at least 60 seconds after the other port closes.
However, this restriction does not apply for a port opened using the TCP
ACTIVE OPEN REQUEST command with a local TCP port number of 0
(port number automatically assigned) which is closed from the side that
actively opened the socket.
• A connection is established for a passively opened socket by actively
opening it from another socket. You cannot actively open multiple connec-
tions to a socket passively opened at the Ethernet Unit.
• The Ethernet Unit TCP sockets have no KEEP ALIVE function to check
that the connection is normal if communications do not occur for a set
time period through a communications line for which a connection has
been established. The Ethernet Unit’s TCP sockets make no checks to
the socket at the other node. Checks made by the remote node, however,
are received as responses, so that it is not necessary for the user pro-
gram to consider the KEEP ALIVE function.
Precautions in Using • Send and reception processing can not be performed at the same time
Socket Service Request when Socket Service Request Switches are used for socket services
Switches because there is only one Socket Service Parameter Area for each
socket. For example, if the Send Request Switch is turned ON when data
is being received, the response code will be 110C Hex, indicating that a
Request Switch was turned ON during communications processing. (The
response code for the reception will overwrite this code when processing
has been completed.)
• If more than one Request Switch is turned ON simultaneously, the
response code will be 110C Hex and all requested processing will end in
an error.
• Close processing can be performed, however, even during open, send, or
receive processing. This enables emergency close processing. Also, the
only parameter required for close processing is the socket number, so a
socket can be closed even when parameters are set for another process.
112
Using Socket Services with Socket Service Request Switches Section 6-2
Sockets
Sockets
call
Socket Service
Request Switches
Refreshed UDP data
transfers
Socket Service
(See Note 1.)
Parameters
Refreshed
(See Note 2.)
Note 1. Socket Service Request Switches in the CPU Bus Unit Area in the CIO
Area are used to send a service request from the CPU Unit to the Ethernet
Unit.
2. The Socket Service Parameters in the CPU Bus Unit Area in the DM Area
are used to specify the service being requested from the Ethernet Unit.
The CPU Bus Unit Area in the DM Area is also used to receive results of
processing from the Ethernet Unit to the CPU Unit.
After setting the required parameters in a Socket Service Parameter Area in
the CPU Bus Unit Area in the DM Area, the Socket Service Request Switches
can be used to request opening, sending, receiving, or closing for either the
UDP or TCP protocol. When requesting a send, send data at the send/receive
data addresses set in the parameter area is sent. When requesting a recep-
tion, data is received to the send/receive data addresses set in the parameter
area.
113
Using Socket Services with Socket Service Request Switches Section 6-2
m+18
m+88
114
Using Socket Services with Socket Service Request Switches Section 6-2
Parameter Settings
The following table shows the parameters that are required for each service
and the use of the parameters by the socket service.
UDP Socket Services
Parameter No. of Range Socket service
words (decimal values in UDP UDP UDP UDP
parentheses) open receive send close
UDP/TCP socket No. 1 0001 to 0008 Hex W W W W
(1 to 8)
Local UDP/TCP port No. 1 0000 to FFFF Hex W --- --- ---
(0 to 65,535)
Remote IP address 2 00000000 to FFFFFFFF Hex --- R W ---
(0.0.0.0 to 255.255.255.255)
Remote UDP/TCP port No. 1 0000 to FFFF Hex --- R W ---
(0 to 65,535)
Number of bytes to send/receive 1 0000 to 07C0 Hex --- RW RW ---
(0 to 1,984 bytes)
Send/Receive data address 2 Memory area address --- W W ---
Time out time 1 0000 to FFFF Hex --- W --- ---
(0 to 65,535)
(0: No limit, 0.1 to 6,553.5 s)
Response code 1 --- R R R R
115
Using Socket Services with Socket Service Request Switches Section 6-2
116
Using Socket Services with Socket Service Request Switches Section 6-2
117
Using Socket Services with Socket Service Request Switches Section 6-2
lowing response codes will be stored depending on the service that was
requested.
118
Using Socket Services with Socket Service Request Switches Section 6-2
Response Meaning
code
110C Request Switch turned ON during other processing.
220F Specified socket is already processing a send request.
2210 The specified socket is not open.
2211 Unit is busy; cannot execute.
2607 Specified Socket Service Parameter Area is already being used for
another socket.
003E Internal buffer cannot be obtained due to high reception traffic
(ENOBUFS).
0042 The remote IP address is a broadcast address and the number of
bytes to send is greater than 1,472 bytes (EMSGSIZE).
004C The network ID is incorrect or the remote IP address is incorrect
(EADDRNOTAVAIL)
004E The network ID is not in the IP router table, router settings are incor-
rect, or the remote IP address is incorrect (ENETUNREACH).
0051 The router settings are incorrect or the remote IP address is incor-
rect (EHOSTUNREACH).
0081 The specified socket was closed during send processing.
119
Using Socket Services with Socket Service Request Switches Section 6-2
Response Meaning
code
004B Error in communications with remote node (ECONNRESET).
(See note.)
004E Remote IP address parameter error (ENETUNREACH).
(See note.)
0051 Remote IP address parameter error (EHOSTUNREACH).
(See note.)
0053 Error in communications with remote node (ETIMEDOUT) or remote
node does not exist.
0066 Internal memory cannot be obtained; cannot execute.
0080 Open request timed out.
0081 The specified socket was closed during open processing.
0082 Connection could not be established with specified remote node.
Note These response codes will be returned only on large, multilevel networks.
120
Using Socket Services with Socket Service Request Switches Section 6-2
Response Meaning
code
0053 Communications error with remote node (ETIMEDOUT).
No remote node.
0081 The specified socket was closed during open processing.
Note These response codes will be returned only on large, multilevel networks.
Note These response codes will be returned only on large, multilevel networks.
121
Using Socket Services with Socket Service Request Switches Section 6-2
Response Meaning
code
110C Request Switch turned ON during other processing.
220F Specified socket is already processing a send request.
2210 The specified socket is not open.
2211 Unit is busy; cannot execute.
2607 Specified Socket Service Parameter Area is already being used for
another socket.
0020 Connection with remote socket broken during send (EPIPE).
003E Internal buffer cannot be obtained due to high reception traffic
(ENOBUFS).
0042 The remote IP address is a broadcast address and the number of
(See note.) bytes to send is greater than 1,472 bytes (EMSGSIZE).
0044 ICMP data received (ENOPROTOOPT).
(See note.)
0045 Error in communications with remote node (ECONNABORTED).
(See note.)
004A Error in communications with remote node (ECONNREFUSED)
(See note.)
004B Error in communications with remote node (ECONNREFUSED)
(See note.)
004E Remote IP address parameter error (ENETUNREACH).
(See note.)
004F ICMP data received (EHOSTDOWN).
(See note.)
0051 Remote IP address parameter error (EHOSTUNREACH).
(See note.)
0053 Error in communications with remote node (ETIMEDOUT).
(See note.)
0081 The specified socket was closed during send processing.
Note These response codes will be returned only on large, multilevel networks.
TCP Socket Close Request
Response Meaning
code
0000 Normal end
2210 The specified socket is not open.
2211 Unit is busy; cannot execute.
2607 Specified Socket Service Parameter Area is already being used for
another socket.
0302 CPU Unit error; cannot execute.
122
Using Socket Services with Socket Service Request Switches Section 6-2
Offset 15 8 7 0
n+19 Socket Service Socket Service
Request Switches 2 Request Switches 1
123
Using Socket Services with Socket Service Request Switches Section 6-2
As shown in the above table, the Request Switches are turned OFF by the
Ethernet Unit when the requested processes has been completed.
Note There is also a Socket Force-close Switch in bit 2 of the first word allocated to
the Ethernet Unit in the CPU Bus Unit Area in the CIO Area. When the Socket
Force-close Switch is turned ON, all sockets that are open will be force-
closed. Refer to page 68 for details.
When using socket services with the Socket Service Request Switches, the
ladder diagram should be programmed to check the response codes when
Socket Service Request Switches are turned OFF.
124
Using Socket Services with Socket Service Request Switches Section 6-2
The flags shown in the following diagram are provided in the Socket Status
Words for socket service requests made with the Socket Service Request
Switches.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Opening Flag
Receiving Flag
Sending Flag
TCP/UDP Open Flag
Closing Flag
125
Using Socket Services with Socket Service Request Switches Section 6-2
Note The TCP socket connection status is also provided as codes in the following
words of the words allocated to the Ethernet Unit in the CPU Bus Unit Area in
the DM Area: D30000 + (100 x unit number) +9 to +16. Refer to TCP Socket
Connection Status on page 75 and to Appendix D TCP Status Transitions for
details.
2. Turn ON the Socket Service Request Bits in the CPU Bus Unit Area in the
CIO Area.
CPU Bus Unit Area in the CIO Area
I/O memory
Send
or
Receive
126
Using Socket Services with Socket Service Request Switches Section 6-2
Precautions
A Socket Service Parameter Area cannot be used for other sockets once
open processing has been successfully completed for it. Check the socket
status before attempting to open a socket. TCP socket status is provided in
words m+9 to m+16 in the DM Area for sockets 1 to 8.
TCP Connection Status
The TCP connection status is provided for ports for which TCP sockets have
been opened. When a port is closed, the previous status will remain in the DM
Area until a socket is opened again. Writing data to the DM Area, however, is
not synced with writing to the Socket Status Areas, and timing may vary
somewhat.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+9 to m+16 – – – – – – – – – – – –
127
Using Socket Services with Socket Service Request Switches Section 6-2
The flow is similar for other socket services. Replace the names of the appro-
priate flags in the flowchart to adapt it to other socket services.
Request
Switch
Flag
Closing during Other The Close Request Switch or Force-close Switch can be used to close a
Processes socket even when open, receive, or send processing is being executed. Clos-
ing is the only other process that is possible during other processes.
Close Request Switch
The processing results are stored as the response code when the Close
Request Switch is used. There will always be one PC cycle time between
128
Using Socket Services with Socket Service Request Switches Section 6-2
turning OFF the Request Switch for the canceled process and turning of the
Close Request Switch, allowing time for the response code to be read.
Opening, Sending, or
Receiving Flag
Closing Flag
Open Flag
Request Switch Request
turned ON. accepted. Close request
accepted.
Not synced with
Close Request Request Switches.
Switch turned ON.
Note The Open Flag will not turn ON at all if a close request is made during open
processing.
Force-close Switch
The requested processes are canceled and an response code is stored when
the Force-close Switch is used.
Force-close Switch
Opening, Sending, or
Receiving Flag
Closing Flag
Open Flag
Note The Open Flag will not turn ON at all if a force-close request is made during
open processing.
129
Using Socket Services with Socket Service Request Switches Section 6-2
System Configuration The programming example uses the following system configuration. For the
TCP connection, the Ethernet Unit uses a passive open and the host com-
puter uses an active open.
Host computer Ethernet Unit
PC
Data Flow The data will flow between the CPU Unit, Ethernet Unit, and host computer as
shown in the following diagram.
Line Ethernet CPU Unit
Host computer (Ethernet) Unit
Request Switches and ex-
Sent to line. ecution bits turned ON
(see Note).
Note Here, “execution bits” refer to CIO 000000 to CIO 000003, which are used in
the ladder diagram to control execution of communications.
Basic Operations
• CIO 000000 is turned ON to request opening a TCP socket from the
Ethernet Unit.
• CIO 000001 is turned ON to request closing the TCP socket from the
Ethernet Unit.
• CIO 000002 is turned ON to request sending data from the Ethernet Unit.
Data (100 bytes) is sent beginning at D00000.
• CIO 000003 is turned ON to request receiving data from the Ethernet
Unit. The data that is received (100 bytes) is stored beginning at D01000.
• One of the bits between CIO 000100 and CIO 000103 will turn ON if an
error occurs. Refer to 6-2-2 Response Codesfor information on errors.
130
Using Socket Services with Socket Service Request Switches Section 6-2
Program Memory Map The send and receive data and bits (flags) used by the program are shown in
the following diagram.
DM Area
CIO Area
The following bits and flags are used to control CMND(490) execution. The
bits in CIO 0000 are used to signal execution, the bits in CIO 0001 are used to
signal errors, and the bits in CIO 0002 are used to control the program so that
the instruction is executed only once.
15 to 8 7 6 5 4 3 2 1 0
131
Using Socket Services with Socket Service Request Switches Section 6-2
Programming Example
000000
@RSET TCP Passive Open
000100
When the TCP Open Bit (CIO 000000) turns ON, the TCP
Open Error Flag (CIO 000100) is turned OFF and the TCP
Opening Flag (CIO 000200) is turned ON to initialize pro-
@SET cessing.
000200
000000 000200
MOV(21) When the TCP Opening Flag (CIO 000200) turns ON, the
#0001
following parameters are written to the parameter area for
socket number 1.
D30018 D30018: 0001 Hex = UDP/TCP socket No. 1
D30019: 1000 Hex = Local UDP/TCP port No. 4096
MOV(21) D30020 and D30021:
#1000 C424 2037 Hex =
Remote IP address 196.36.32.55
D30019
D30022: 0000 Hex = Any remote UDP/TCP port No.
D30026: 0000 Hex = No timeout time
MOV(21)
#C424
D30020
MOV(21)
#2037
D30021
MOV(21)
#0000
D30022
MOV(21)
#0000
D30026
000000 000200
SET After the parameters have been set, the TCP Passive
151901 Open Request Switch (CIO 151901) is turned ON and
the TCP Opening Flag (CIO 000200) is turned OFF.
RSET
000200
000000 000200 151901 If the TCP Passive Open Request Switch (CIO 151901)
turns OFF while the TCP Opening Flag (CIO 000200) is
<>(305) SET
OFF, the contents of the response code (D30027) in the
D30027 000100 Socket Service Parameter Area is checked, and if it is not
#0000 0000 Hex (normal end), the TCP Open Error Flag (CIO
000000 000200 151901 000100) is turned ON.
RSET
After the execution results have been checked, the TCP
000000 Open Bit (CIO 000000) is turned OFF.
000001
@RSET
TCP Close
When the TCP Close Bit (CIO 000001) turns ON, the TCP
000101
Close Error Flag (CIO 000101) is turned OFF and the TCP
Closing Flag (CIO 000201) is turned ON to initialize proces-
@SET
sing.
000201
000001 000201
When the TCP Closing Flag (CIO 000201) turns ON, the
MOV(21)
following parameter is written to the parameter area for
#0001 socket number 1.
D30018 D30018: 0001 Hex = UDP/TCP socket No. 1
000001 000201 After the parameter has been set, the Close Request
SET Switch (CIO 151905) is turned ON and the TCP Closing
151905 Flag (CIO 000201) is turned OFF.
If the Close Request Switch (CIO 151905) turns OFF while
RSET the TCP Opening Flag (CIO 000201) is OFF, the contents
000201 of the response code (D30027) in the Socket Service Pa
rameter Area is checked, and if it is not 0000 Hex (normal
Continued on next page. end), the TCP Close Error Flag (CIO 000101) is turned ON.
After the execution results have been checked, the TCP Close Bit (CIO 000001) is turned OFF.
132
Using Socket Services with Socket Service Request Switches Section 6-2
000002
@RSET
000102
@SET
000202
000002 000202
MOV(21) When the TCP Sending Flag (CIO 000202) turns ON, the
#0001 following parameters are written to the parameter area for
socket number 1.
D30018
D30018: 0001 Hex = UDP/TCP socket No. 1
D30023: 0064 Hex = No. of send/receive bytes is 100
MOV(21) D30024 and D30025:
#0064 8200 0000 Hex =
Send/receive data address D00000
D30023
MOV(21)
#8200
D30024
MOV(21)
#0000
D30025
000002 000202
SET
151903 After the parameters have been set, the Send Request
Switch (CIO 151903) is turned ON and the TCP Sending
RSET Flag (CIO 000202) is turned OFF.
000202
000002 000202 151903 If the Send Request Switch (CIO 151903) turns OFF while
the TCP Sending Flag (CIO 000202) is OFF, the contents
<>(305) SET
of the response code (D30027) in the Socket Service Pa-
030027 000102 rameter Area is checked, and if it is not 0000 Hex (normal
end), the TCP Send Error Flag (CIO 000102) is turned ON.
#0000
000002 000202 151903
RSET
After the execution results have been checked, the TCP
Send Bit (CIO 000002) is turned OFF.
000002
000003
@RSET TCP Receive
When the TCP Receive Bit (CIO 000003) turns ON, the
000103
TCP Receive Error Flag (CIO 000103) is turned OFF and
the TCP Receiving Flag (CIO 000203) is turned ON to
@SET
initialize processing.
000203
133
Using Socket Services with Socket Service Request Switches Section 6-2
MOV(21)
#8203
D30024
MOV(21)
#E800
D30025
MOV(21)
#0000
D30026
000003 000203
After the parameter has been set, the Receive Request
SET
Switch (CIO 151904) is turned ON and the TCP Receiv-
151904 ing Flag (CIO 000203) is turned OFF.
RSET
000203
Note When using the above programming example, change the bit and word
addresses as necessary to avoid using the same areas used by other parts of
the user program or the CPU Bus Unit.
System Configuration The programming example uses the following system configuration.
Host computer
Ethernet Unit
PC
134
Using Socket Services with Socket Service Request Switches Section 6-2
Basic Operations
• CIO 000000 is turned ON to request opening a UDP socket from the
Ethernet Unit.
• CIO 000001 is turned ON to request closing the UDP socket from the
Ethernet Unit.
• CIO 000002 is turned ON to request sending data from the Ethernet Unit.
• CIO 000003 is turned ON to request receiving data from the Ethernet
Unit. The data that is received (100 bytes) is stored beginning at D01000.
• One of the bits between CIO 000100 and CIO 000103 will turn ON if an
error occurs. Refer to6-2-2 Response Codes for information on errors.
Program Memory Map The send and receive data and bits (flags) used by the program are shown in
the following diagram.
DM Area
CIO Area
The following bits and flags are used to control CMND(490) execution. The
bits in CIO 0000 are used to signal execution, the bits in CIO 0001 are used to
signal errors, and the bits in CIO 0002 are used to control the program so that
the instruction is executed only once.
15 to 8 7 6 5 4 3 2 1 0
135
Using Socket Services with Socket Service Request Switches Section 6-2
Programming Example
000000
@RSET UDP Open
When the UDP Open Bit (CIO 000000) turns ON, the UDP
000100
Open Error Flag (CIO 000100) is turned OFF and the UDP
Opening Flag (CIO 000200) is turned ON to initialize pro-
@SET cessing.
000200
000000 000200
MOV(21) When the UDP Opening Flag (CIO 000200) turns ON, the
#0001 following parameters are written to the parameter area for
socket number 1.
D30018 D30018: 0001 Hex = UDP/TCP socket No. 1
D30019: 1000 Hex = Local UDP/TCP port No. 4096
MOV(21)
#1000
D30019
000000 000200
After the parameters have been set, the UDP Open Re-
SET
quest Switch (CIO 151900) is turned ON and the UDP
151900 Opening Flag (CIO 000200) is turned OFF.
RSET If the UDP Open Request Switch (CIO 151900) turns
000200
OFF while the UDP Opening Flag (CIO 000200) is OFF,
000000 000200 151900 the contents of the response code (D30027) in the Socket
Service Parameter Area is checked, and if it is not 0000
<>(305) SET
Hex (normal end), the UDP Open Error Flag (CIO
030027 000100 000100) is turned ON.
#0000
000000 000200 151900 After the execution results have been checked, the UDP
RSET Open Bit (CIO 000000) is turned OFF.
000000
000001
UDP Close
@RSET When the UDP Close Bit (CIO 000001) turns ON, the UDP
000101
Close Error Flag (CIO 000101) is turned OFF and the
UDP Closing Flag (CIO 000201) is turned ON to initialize
processing.
@SET
000201 When the UDP Closing Flag (CIO 000201) turns ON, the
following parameter is written to the parameter area for
000001 000201
socket number 1.
D30018: 0001 Hex = UDP/TCP socket No. 1
MOV(21)
#0001 After the parameter has been set, the Close Request
D30018 Switch (CIO 151905) is turned ON and the UDP Closing
000001 000201 Flag (CIO 000201) is turned OFF.
SET
If the Close Request Switch (CIO 151905) turns OFF
151905 while the UDP Opening Flag (CIO 000201) is OFF, the
contents of the response code (D30027) in the Socket
RSET Service Parameter Area is checked, and if it is not 0000
000201 Hex (normal end), the UDP Close Error Flag (CIO
000101) is turned ON.
000001 000201 151905
<>(305) SET After the execution results have been checked, the UDP
Close Bit (CIO 000001) is turned OFF.
D30027 000101
#0000
000001 000201 151905
RSET
000001
000002
@RSET UDP Send
000102 When the UDP Send Bit (CIO 000002) turns ON, the UDP
Send Error Flag (CIO 000102) is turned OFF and the UDP
@SET
Sending Flag (CIO 000202) is turned ON to initialize pro-
cessing.
000202
136
Using Socket Services with Socket Service Request Switches Section 6-2
MOV(21)
#1000
D30022
MOV(21)
#0064
D30023
MOV(21)
#8200
D30024
MOV(21)
#0000
D30025
000002 000202
SET After the parameters have been set, the Send Request
151903 Switch (CIO 151903) is turned ON and the UDP Sending
Flag (CIO 000202) is turned OFF.
RSET
000202
137
Using Socket Services with Socket Service Request Switches Section 6-2
MOV(21)
#8203
D30024
MOV(21)
#E800
D30025
MOV(21)
#0000
D30026
000003 000203
SET After the parameter has been set, the Receive Request
151904 Switch (CIO 151904) is turned ON and the UDP Receiv-
ing Flag (CIO 000203) is turned OFF.
RSET
000203
Note When using the above programming example, change the bit and word
addresses as necessary to avoid using the same areas used by other parts of
the user program or the CPU Bus Unit.
138
Using Socket Services with CMND(490) Section 6-3
Basic FINS Command The basic format for FINS commands used for socket services is shown in the
Format following diagram.
0 1 2 3 4 5 6 7 8 9 10 11 12 Byte order from
the beginning of
the frame
Command Code:
Specifies the process code requested from the socket.
Socket Number
Specifies the socket number for the process, between 1 and 8.
Results Storage Area
Specifies the area to store the results of the requested process.
Parameters
Specifies the parameters defined for the command code.
139
Using Socket Services with CMND(490) Section 6-3
Note If there is more than one Communications Unit mounted to the PC, the FINS
network address must be set as a parameter for CMND(490) and a local net-
work table must be created in the routing tables from the CX-Programmer.
The flags shown in the following diagram are provided in the Socket Status
Words for socket service requests made with CMND(490).
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Opening Flag
Receiving Flag
Results Storage Error Flag
Sending Flag
Socket Open Flag
Closing Flag
140
Using Socket Services with CMND(490) Section 6-3
Note The TCP socket connection status is also provided as codes in the following
words of the words allocated to the Ethernet Unit in the CPU Bus Unit Area in
the DM Area: D30000 + (100 x unit number) +9 to +16. Refer to TCP Socket
Connection Status on page 75 and to Appendix D TCP Status Transitions for
details.
141
Using Socket Services with CMND(490) Section 6-3
1,2,3... 1. Execute a socket service request command (MRC: 27) for the Ethernet
Unit using CMND(490).
CPU Ethernet Unit
User program
Socket service
CMND
Request
command
END
Response
CMND
END
3. The Ethernet Unit starts the process requested by the parameters in the
socket service request command.
CPU Ethernet Unit
Other node
Communications
4. When the process has been completed, the result is stored in the results
storage area defined in the socket service request command and the sock-
et status will indicate completion of processing.
CPU Ethernet Unit
Socket status area
Process complete
notification
142
Using Socket Services with CMND(490) Section 6-3
Check the Port Enabled Flag. ON? The specified port is running
NO network communications.
YES
Is the Port Enabled Flag in A502 for communica-
tions port ON?
Check results storage area response code. 0000? An error occurred. The specified
NO socket could not be opened.
UDP opened
143
Using Socket Services with CMND(490) Section 6-3
1
Open Flag
0
1
Open Flag
0
1
Opening Flag
0
1
Close Flag
0
1
Closing Flag 0
144
Using Socket Services with CMND(490) Section 6-3
SEND REQUEST
1
Port Enabled Flag Running Running
0
Send Flag 1
0
1
Opening Flag
0
Results storage area
Store normal response code
RECEIVE REQUEST
Port Enabled Flag 1 Running Running
0
Receive Flag 1
0
1
Opening Flag 0
CMND(490) (RECEIVE
REQUEST) response command Normal response code
CMND(490) (CLOSE
REQUEST) response command Normal response code
1
Receive Flag
0
Close Flag 1
0
Opening Flag 1
0
Results storage area for
RECEIVE REQUEST Store error response code
Note The timing shown in the above diagram occurs if a CLOSE REQUEST com-
mand is executed during SEND REQUEST command execution. The timing
145
Using Socket Services with CMND(490) Section 6-3
System Configuration
The system configuration for the program example and the Ethernet Unit sys-
tem setup are shown below. To establish a TCP connection, the Ethernet Unit
is passively opened and the host computer actively opened.
Host computer
Ethernet Unit
PC
Data Flow
The data will flow between the CPU Unit, Ethernet Unit, and host computer as
shown in the following diagram.
Line Ethernet
Host computer (Ethernet) CPU Unit
Unit
Request Switches and
execution bits turned ON
Sent to line. (see Note).
CMND(490) response
Note Here, “execution bits” refer to CIO 000000 to CIO 000003, which are used in
the ladder diagram to control execution of communications and are not sys-
tem flags, such as the Port Enabled Flags (A20200 to A20207).
Basic Operations
• CIO 000000 is turned ON to request opening a passive TCP socket from
the Ethernet Unit.
• CIO 000001 is turned ON to request closing the TCP socket from the
Ethernet Unit.
• CIO 000002 is turned ON to request sending data from the Ethernet Unit.
Data (100 bytes) is sent beginning at D02005.
• CIO 000003 is turned ON to request receiving data from the Ethernet
Unit. The data that is received (100 bytes) is stored beginning at D04022.
146
Using Socket Services with CMND(490) Section 6-3
• One of the bits between CIO 000100 and CIO 000103 will turn ON if an
error occurs. Refer to 6-2-2 Response Codes for information on errors.
The following areas can be used to access details about errors:
CMND(490) response codes
Response codes in results storage area
Network Communications Error Flags (A21900 to A21907)
Completion codes (A203 to A210)
0 1 2
15 to 8 7 6 5 4 3 2 1 0
DM Area
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
147
Using Socket Services with CMND(490) Section 6-3
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
148
Using Socket Services with CMND(490) Section 6-3
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
Command code
0 1 2 3 4 5 6 7 8 9
149
Using Socket Services with CMND(490) Section 6-3
CIO Area The following bits and flags are used to control CMND(490) execution. The
bits in CIO 0000 are used to signal execution, the bits in CIO 0001 are used to
signal errors, and the bits in CIO 0002 are used to control the program so that
the instruction is executed only once.
15 to 8 7 6 5 4 3 2 1 0
150
Using Socket Services with CMND(490) Section 6-3
Programming Example
000000
@RSET TCP Passive Open
000100 When the TCP Open Bit (CIO 000000) turns ON, the TCP
Open Error Flag (CIO 000100) is turned OFF and the TCP
Opening Flag (CIO 000200) is turned ON to initialize pro-
cessing.
@SET
000200
000001
@RSET TCP Close
000101
When the TCP Close Bit (CIO 000001) turns ON, the TCP
Close Error Flag (CIO 000101) is turned OFF and the TCP
Closing Flag (CIO 000201) is turned ON to initialize pro-
cessing.
@SET
000201
000001 000201 A20200 150903 The Network Communications Error Flag (A21900) is ON.
RSET After the execution results have been checked, the TCP
000000 Close Bit (CIO 000001) is turned OFF.
Continued on next page.
151
Using Socket Services with CMND(490) Section 6-3
152
Using Socket Services with CMND(490) Section 6-3
Note When using the above programming example, change the bit and word
addresses as necessary to avoid using the same areas used by other parts of
the user program or the CPU Bus Unit.
System Configuration
The system configuration for the program example and the Ethernet Unit sys-
tem setup are shown below.
Host computer
Ethernet Unit
PC
Basic Operations
• CIO 000000 is turned ON to request opening a UDP socket from the
Ethernet Unit.
• CIO 000001 is turned ON to request closing the UDP socket from the
Ethernet Unit.
• CIO 000002 is turned ON to request sending data from the Ethernet Unit.
Data (100 bytes) is sent beginning at D02008.
• CIO 000003 is turned ON to request receiving data from the Ethernet
Unit. The data that is received (100 bytes) is stored beginning at D04025.
• One of the bits between CIO 000100 and CIO 000103 will turn ON if an
error occurs. Refer to 6-2-2 Response Codes for information on errors.
The following areas can be used to access details about errors:
CMND(490) response codes
Response codes in results storage area
Network Communications Error Flags (A21900 to A21907)
Completion codes (A203 to A210)
153
Using Socket Services with CMND(490) Section 6-3
DM Area
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
154
Using Socket Services with CMND(490) Section 6-3
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
155
Using Socket Services with CMND(490) Section 6-3
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
CIO Area The following bits and flags are used to control CMND(490) execution. The
bits in CIO 0000 are used to signal execution, the bits in CIO 0001 are used to
signal errors, and the bits in CIO 0002 are used to control the program so that
the instruction is executed only once.
15 to 8 7 6 5 4 3 2 1 0
156
Using Socket Services with CMND(490) Section 6-3
Programming Example
000000
@RSET UDP Open
000100 When the UDP Open Bit (CIO 000000) turns ON, the
UDP Open Error Flag (CIO 000100) is turned OFF and
the UDP Opening Flag (CIO 000200) is turned ON to
initialize processing.
@SET
000200
157
Using Socket Services with CMND(490) Section 6-3
RSET
000202
000003
@RSET
000103
@SET
UDP Receive
When the UDP Receive Bit (CIO 000003) turns ON, the
000203 UDP Receive Error Flag (CIO 000103) is turned OFF
and the UDP Receiving Flag (CIO 000203) is turned ON
000003 000203 A020200 to initialize processing.
CMND(490)
When the UDP Receiving Flag (CIO 000203) turns ON, the
D04000
status of the Port Enabled Flag (A20200) is checked to be
D04010 sure it is ON and a UDP RECEIVE REQUEST command is
D00030
sent using CMND(490).
D04000: First command word
D04010: First response word
D00030: First control data word
RSET
000203
The UDP Receiving Flag (CIO 000203) is also turned OFF.
000003 000203 A020200 150101 150114
SET
If the Port Enabled Flag (A20200) turns ON and the Re-
ceiving Flag (CIO 150101) turns OFF while the UDP Re-
000103 ceiving Flag (CIO 000203) is OFF, checks are made and if
any of the following are true, the UDP Receive Error Flag
(CIO 000103) is turned ON.
<>(305)
D04020 The Results Storage Error Flag (CIO 150114) is ON.
#0000 The contents of the Response Storage Area set in the com-
mand code (D04020) is not 0000 Hex (normal end).
A021900
The Network Communications Error Flag (A21900) is ON.
000003 000203 A020200 150101 After the execution results have been checked, the UDP
RSET Receive Bit (CIO 000003) is turned OFF.
000003
END(001)
158
Using Socket Services with CMND(490) Section 6-3
Note When using the above programming example, change the bit and word
addresses as necessary to avoid using the same areas used by other parts of
the user program or the CPU Bus Unit.
159
SECTION 7
FTP Server
161
Overview Section 7-1
7-1 Overview
The Ethernet Unit supports the server functions of FTP (file transfer protocol),
a standard protocol in TCP/IP. A host computer functioning as an FTP client
on the Ethernet can read or write individual files in a Memory Card mounted
to the CPU Unit or in EM file memory.
Only one FTP client can connect at the same time.
Ethernet network
Note The PC, however, is unable to read or write files at other nodes using FTP
because the Ethernet Unit does not support FTP client functions.
File System
The file system in the CPU Unit that can be accessed by the Ethernet Unit
includes files in any Memory Card mounted in the CPU Unit and files in EM
file memory. The directory tree is shown below.
/: root
MEMCARD Memory card directory
EM EM file memory directory
Note 1. The date of the MEMCARD directory displayed for ls or dir commands
in the root directory will be the date of the file system volume label.
2. The login date will be displayed for EM files and for MEMCARD if a volume
label has not been created.
Login Messages
Status Message
Normal 220 xxx.xx.xx.xx yyyyyyyyyy FTP server (FTP Version z.zz) ready.
connection xxx.xx.xx.xx: IP address of Ethernet Unit
yyyyyyyyyy: Ethernet Unit model number (CS1W-ETN01)
z.zz: Firmware version of Ethernet Unit
FTP server 221 FTP server busy, Goodbye.
busy
162
Setting Login Names and Passwords Section 7-2
Setting Restrictions The following restrictions apply to login names and passwords.
• The login name and password must consist of alphanumeric characters,
hyphens, and/or underscores. They are not case sensitive.
• A login name consists of 12 characters.
• A password consists of 8 characters.
• Always set a password when setting a new login name. The login name
will not be valid unless a password is set for it.
• If a login name is not set or contains illegal characters, the default login
name, CONFIDENTIAL, must be used. No password is required and any
password that is set will be ignored.
Setting Method A new login name and password can be set in the CPU Bus Unit Setup using
the Unit settings on the CX-Programmer.
Note The CPU Bus Unit Setup is not contained in I/O memory, but in a parameter
area. The Setup cannot be written using instructions or edited as I/O memory.
Settings can be made only with the CX-Programmer.
Refer to the CX-Programmer User’s Manual for actual setting methods.
Memory Card
File
File
EM File
Memory
File
File Memory
Media Memory type Capacity Model File data recognized by CPU Unit
CS/CJ- Flash memory 8 MB HMC-EF861 • Complete user program
series 15 MB HMC-EF171 • Specified portions of I/O Memory
Memory • Parameter area data (e.g. PC Setup)
Cards 30 MB HMC-EF371
EM File RAM Max. capacity of EM Area All EM Area banks
Memory in CPU Unit from specified bank in
I/O Memory (specified
in PC Setup)
163
Using File Memory Section 7-3
Note The HMC-AP001 PC Card Adapter can be used to mount a Memory Card in a
PC card slot on a computer.
File Types
The MS-DOS file format is used, allowing the files to be handled as normal
files on a Windows-based computer.
File Names Files are distinguished by assigning file names and extensions. The following
characters can be used in file names and extensions:
Alphanumeric characters: A to Z and 0 to 9. (Names converted to all-caps)
!&$#’[]-^()_
The following characters cannot be used in files names and extensions:
, . / ? * ” : ; << > = + (spaces)
File names are not case sensitive and will be converted to all-caps in the PC
file system. File names can be up to 8 character long with 3-character exten-
sions. An error will occur if a file name or extension is too long. The first period
(.) in a file name will be taken as the delimiter between the file name and
extension. Extensions are determined by the file type.
Directories Up to five levels of directories (including root as the first level) can be created
as file storage locations. A maximum of 65 characters can be used in direc-
tory names.
164
Using File Memory Section 7-3
File Names Handled by The files described in the following table can be read or written by the CPU
CPU Unit Unit.
File type File name Extension Contents Description
Data file ******** .IOM Specified ranges of I/ • Contains word (16-bit) data from a starting
O Memory word through an end word in one memory
area.
• The following areas can be used: CIO, HR,
WR, AR, DM, and EM.
Program file ******** .OBJ Complete user pro- • Contains all the programs for cyclic tasks
gram and interrupt tasks, as well as task infor-
mation for one CPU Unit.
Parameter area file ******** .STD • PC Setup • Contains all of the parameter data for one
• Registered I/O CPU Unit.
tables • There is no need for the user to distinguish
• Routing tables the various types of data contained in the
• CPU Bus Unit file.
Setup and other • The file can be automatically read to or
setup data written from the CPU Unit simply by speci-
fying the extension (.STD)
Files Data files AUTOEXEC .IOM I/O Memory data for • There does not necessarily need to be a
trans- the specified number data file in the Memory Card when the
ferred at of words starting from automatic file transfer function is used at
startup D20000 startup.
• The AUTOEXEC.IOM file always contains
DM Area data starting at D20000.
• All data in the file will be transferred to
memory starting at D20000 at startup.
Program AUTOEXEC .OBJ Complete user pro- • There must be a program file in the Mem-
files gram ory Card when the automatic file transfer
function is used at startup.
• Contains all the programs for cyclic tasks
and interrupt tasks, as well as task infor-
mation for one CPU Unit.
Parameter AUTOEXEC .STD • PC Setup • There must be a parameter file in the
area file • Registered I/O Memory Card when the automatic file
tables transfer function is used at startup.
• Routing tables • Contains all of the parameter data for one
• CPU Bus Unit CPU Unit.
Setup and other • There is no need for the user to distinguish
setup data the various types of data contained in the
file.
• All parameters in the file will be automati-
cally transferred to specified locations in
memory at startup.
165
Using File Memory Section 7-3
Writing Data Files via FTP In this example, the put command (see page 171) is used to write the follow-
ing data to a file called DMDATA.IOM on a Memory Card, and then the READ
DATA FILE instruction (FREAD(700)) is used to write 5 words of data from the
beginning of the DMDATA.IOM file to D00000 to D00004.
C: Control word
#0000 = Read data from Memory Card
S1: First source word S2: Filename
No. of words
\D
to read = 5
First word to
read = 0
D: First destination word
Note 1. FREAD(700) will not be able to read the last byte in a file if the files con-
tains an odd number of bytes. Add 00 Hex to the end of the file if necessary
to make an even number of bytes.
2. The UM and DM Areas contain binary data. Set the data type to binary us-
ing the type command (see page 170) before reading or writing files us-
ing FTP.
3. Refer to the CS/CJ-series Programmable Controllers Programming Manu-
al (W340) for information on the File Memory Instructions.
166
FTP Server Application Example Section 7-4
1,2,3... 1. Make sure that a Memory Card is inserted in the CPU Unit and turn ON
the power supply to the PC.
2. If EM File Memory is to be used, create the EM File Memory.
3. Connect to the FTP server from a computer on the Ethernet by entering
the text that is underlined in the following diagram.
IP address of the Ethernet Unit
Results
Login name
ABC (subdirectory)
DEF.IOM (file)
Results
Results
Note 1. The current status of the FTP server can be obtained from the service sta-
tus in the words allocated to the Ethernet Unit in the CPU Bus Unit Area in
the CIO Area. The first word allocated to the Ethernet Unit is n and is com-
puted as follows: n = 1500 + (25 x unit number)
167
Using FTP Commands Section 7-5
• The Ethernet Unit is considered to be the remote host and the host com-
puter (FTP client) is considered to be the local host.
• A remote file is a file on the Memory Card or in EM File Memory in the
CPU Unit. A local file is one in the host computer (FTP client).
• The parent directory is the directory one above the working directory.
168
Using FTP Commands Section 7-5
Function Connects the FTP server. Normally when the FTP client is booted, the FTP
server IP address is specified to execute this command automatically.
user
Format user [user_name]
Function Specifies the user name. Specify the FTP login name set in the Ethernet Unit
system setup. The default FTP login name is “CONFIDENTIAL.”
If a non-default login name is used, it must be followed by the password. In
this case, enter the FTP password set in the system setup.
The user name is automatically requested immediately after connection to the
FTP server.
ls
Format ls [-l] [REMOTE_FILE_NAME [local_file_name]]
Function Displays the remote host (Memory Card or EM File Memory) file names.
Set the switch [-l] to display not only the file names but the creation date and
size as well. If the switch is not set, only the file names will be displayed.
You can specify a file name in the Memory Card or EM File Memory if desired.
If a local file name is specified, the file information will be stored in the speci-
fied file in the host computer.
Example ls /
dir
Format dir [REMOTE_FILE_NAME [local_file_name]]
Function Displays the file names, date created, and size of the files in the remote host
(Memory Card or EM File Memory). It displays the same information as com-
mand “ls –l”.
Specify a file name in the Memory Card or EM File Memory as the remote file
name.
If a local file name is specified, the file information is stored in the specified file
in the host computer.
Example dir /
rename
Format rename CURRENT_FILE_NAME NEW_FILE_NAME
Function Changes the specified current file name to the specified new file name.
rename can be used only to change the file name. It cannot be used to move
the file to a different directory.
mkdir
Format mkdir DIRECTORY_NAME
Function Creates a directory of the specified name at the remote host (Memory Card or
EM File Memory).
169
Using FTP Commands Section 7-5
An error will occur if a file or directory of the same name already exists in the
working directory.
rmdir
Format rmdir DIRECTORY_NAME
Function Deletes the directory of the specified name from the remote host (Memory
Card or EM File Memory).
The directory must be empty to delete it.
An error will occur if the specified directory does not exist or is empty.
pwd
Format pwd
Function Displays the remote host’s (Ethernet Unit) current work directory.
cd
Format cd [directory_name]
Function Changes the remote host (Ethernet Unit) work directory to the specified
remote directory.
The files in the Memory Card are contained in the MEMCARD directory under
the root directory (/). The files in EM File Memory are contained in the EM
directory under the root directory (/). The root directory (/) is the directory
used when logging into the Ethernet Unit. No MEMCARD directory will exist if
a Memory Card is not inserted in the PC or if the Memory Card power indica-
tor is not lit. No EM directory will exist if EM File Memory does not exist.
cdup
Format cdup
Function Changes the working directory at the remote host to the parent directory (one
directory above the current working directory).
type
Format type data_type
Function Specifies the file data type. The following data types are supported:
ascii: Files are transferred as ASCII data
binary (image): Files are transferred as binary data.
All files are treated by the PC as binary files. Before reading or writing any
files, always use the type command to set the file type to binary. File con-
tents cannot be guaranteed if transferred as ASCII data.
The default file type is ASCII.
get
Format get FILE_NAME [receive_file_name]
Function Transfers the specified remote file from the Memory Card or EM File Memory
to the local host.
A receive file name can be used to specify the name of the file in the local
host.
mget
Format mget FILE_NAME
170
Using FTP Commands Section 7-5
Function Allows the use of a wildcard character (*) to transfer multiple remote files from
the Memory Card or EM File Memory to the local host.
put
Format put file_name [DESTINATION_FILE_NAME]
Function Transfers the specified local file to the remote host (Memory Card or EM File
Memory).
A destination file name can be used to specify the name the file is stored
under in the Memory Card or EM File Memory.
Any existing file with the same name in the remote host (Memory Card or EM
File Memory) will be overwritten by the contents of the transferred file.
If an error occurs during file transfer, the file being transferred will be deleted
and the transmission will end in an error.
mput
Format mput FILE_NAME
Function Allows the use of a wildcard character (*) to transfer multiple local files to the
remote host (Memory Card or EM File Memory).
Any existing file with the same name in the remote host (Memory Card or EM
File Memory) will be overwritten by the contents of the transferred file.
If an error occurs during file transfer, the file being transferred will be deleted
and the transmission of that file will end in an error. However, mput execution
will continue and remaining files will be transferred.
delete
Format delete FILE_NAME
Function Deletes the specified remote file from the Memory Card or EM File Memory.
mdelete
Format mdelete FILE_NAME
Function Allows the use of a wildcard character (*) to delete multiple remote files from
the Memory Card or EM File Memory.
close
Format close
bye
Format bye
quit
Format quit
171
Using FTP Commands Section 7-5
172
Using FTP Commands Section 7-5
FTP Status Flag The current status of the FTP server can be obtained from the service status
in the words allocated to the Ethernet Unit in the CPU Bus Unit Area in the
CIO Area. The word containing the FTP Status Flag can be computed as fol-
lows: 1500 + (25 x unit number) + 17
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n+17
Status of Meaning
bit 00
1 FTP server busy
0 FTP server free
Note The FTP status can also be checked using the software switch settings on the
CX-Programmer.
FTP Indicator The FTP indicator on the Ethernet Unit indicates FTP status as shown in the
following table.
FTP indicator Meaning
Lit FTP server busy
Not lit FTP server free
FTP File Transfer Time File transfers using FTP can require up to 5 or 10 minutes depending on the
capacity of the file. Approximate file transfer time are provided in the following
table for reference.
All times are in seconds unless otherwise specified.
File system Memory Card EM File Memory
CPU Unit status Operating mode PROGRAM RUN PROGRAM RUN
Cycle time --- 20 ms --- 20 ms
Transfers using 1 KB 3 17 1 3
put 30 KB 10 53 5 24
60 KB 17 91 11 52
120 KB 31 173 24 128
Transfers using 1 KB 1 2 1 1
get 30 KB 6 22 4 14
60 KB 10 43 9 37
120 KB 19 100 22 113
Note 1. The above times assume that the peripheral servicing time setting in the
PC Setup is set to the default value of 4%.
173
UNIX Application Example Section 7-6
FTP started.
Login name
3. Make sure the Memory Card is inserted. The MEMCARD directory will be
displayed if there is a Memory Card in the CPU Unit.
174
UNIX Application Example Section 7-6
File read.
File written
8. End FTP.
FTP ended.
175
SECTION 8
Mail
177
Overview of Mail Function Section 8-1
178
Overview of Mail Function Section 8-1
Body
Ethernet Unit Information The following Ethernet Unit information is always attached to the mail.
• Model
179
Overview of Mail Function Section 8-1
• Version
• IP address (decimal notation)
• Subnet mask (decimal notation)
• ID address conversion method
Optional Information The optional information that can be sent is shown in the following table. Dif-
ferent information can be selected with each mail trigger, and it is also possi-
ble to make multiple selections. (The selections are specified in the CPU Bus
Unit System Setup.) If not even one is selected, however, no e-mail will be
sent even when the trigger condition is met.
Item Contents
User-created information User-created information is data set by the user, in ASCII, in the CPU Unit’s memory. A maxi-
mum of 1,024 bytes of data is sent from the user-created information address set in the CPU
Bus Unit Area. If there is a null code (00 Hex) in the data, however, only the data up to that
point will be sent.
The data set by the user is sent just as it is, and the code is not converted. The relevant words
are always read by the Ethernet Unit, so the contents of the mail can be changed by changing
the contents of the words.
Error log information The error log information includes the entire error log in RAM. A maximum of 64 records can
be saved. For details, refer to 10-3 Error Log.
Status information The following data is sent.
(1) Open/closed status of UDP sockets 1 to 8
(2) TCP status of TCP sockets 1 to 8
(3) Unit error information
(4) Counter information
• Total number of receive packets
• Total number of receive errors
• Total number of send packets
• Total number of send errors
• Total number of send collisions
The Ethernet Unit processes error log and status data in ASCII so that it can
be easily read as e-mail.
Note Set user-created information in ASCII.
180
Overview of Mail Function Section 8-1
ON, the mail transmission is started according to the mail settings that have
previously been made in the CPU Bus Unit System Setup.
If a transmission is restarted while the mail processing is still in progress, it
will be invalid. After the transmission has been completed, the Ethernet Unit
will automatically turn the switch OFF again. Once the switch has been turned
OFF, another mail message can be sent.
Unit Control Switches: CIO 1500 + (25 x unit number)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Triggered by Error Log If there is a need for immediate notification when an error occurs, e-mail can
Recording be sent at the same time as an error is recorded in the error log. When an
error to be recorded in the error log occurs, the e-mail transmission is started
according to the mail settings that have previously been made in the CPU Bus
Unit System Setup.
Note If several errors in a row are recorded in the error log, the notification of these
errors may all be included in the same e-mail message.
Triggered at Regular If there is a need to periodically check the Ethernet Unit’s status, e-mail can
Intervals be sent at regular intervals. With this method, e-mail is sent at fixed time inter-
vals according to the mail interval and mail information settings in the CPU
Bus Unit System Setup.
Note After the mail processing has been completed, the next e-mail will be sent
when the fixed time interval elapses. There may be discrepancies in the trans-
mission intervals if the Ethernet Unit status causes the processing to take
more time.
8-1-4 Mail Status
The mail status is reflected in the Mail Status areas in the CPU Bus Unit
words allocated in the DM Area. It can be checked as required.
Mail Status: D30000 + (100 x unit number)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note 0: OFF; 1: ON
181
Sending Mail Section 8-2
1,2,3... 1. Make the following settings in the CPU Bus Unit System Setup.
• Mail send information
• Mail timing
• User-created mail data address
• SMTP server address
• Local mail address
• Destination mail address
2. Turn ON the Mail Send Switch (word n, bit 3) in the allocated CIO Area
words.
1,2,3... 1. Use the CX-Programmer, a Programming Device for the PC, to make the
initial mail settings in the CPU Bus Unit System Setup in the CPU Unit. For
the purposes of this example, make the settings shown below. (For details
regarding the CPU Bus Unit System Setup, refer to 4-2-2 Mail Settings.)
• User mail: Send user-created information and status information.
• Error mail: Not used.
• Periodic mail: Not used.
Settings
• User mail: Enabled (selected)
• User mail status information transmission: Enabled (selected)
(Leave all other check boxes for mail settings not selected.)
• User-created mail data address: DM00200 (See below.)
• Ethernet Unit mail address
• Destination mail address
• SMTP server address (mail server IP address)
From DM00200 onwards, store data to be sent as mail (user-created informa-
tion) in ASCII as shown below.
182
Mail Example Section 8-3
2. Turn ON the Mail Send Switch in the CIO Area words allocated to the CPU
Bus Unit.
n = CIO 1500 + 25 x unit number)
For Unit #5, for example, the Mail Send Switch address is CIO 162503.
The status, such as mail being processed, and so on, is reflected in the User
Mail Status Area in the DM Area words allocated to the CPU Bus Unit. Check
the status as required.
User Mail Status: D30000 + (100 x unit number) + 17, bits 0 to 2
Bits Status
2 1 0
0 0 0 Waiting for mail, or mail ready to send according to Mail Send
Switch, or no mail is being sent.
0 0 1 Mail being processed.
0 1 0 Waiting for mail, or mail ready to send according to Mail Send
Switch. Previous mail transmission completion was normal.
1 1 0 Waiting for mail, or mail ready to send according to Mail Send
Switch. Previous mail transmission completion was abnormal.
1 1 1 Mail cannot be sent (due to System Setup error).
Note 0: OFF; 1: ON
183
SECTION 9
Testing Communications
185
Communications Testing Functions Section 9-1
PING Command The PING command is a common way to perform echoback tests on Ethernet
networks. The PING command can be executed to see if nodes are physically
connected properly and to be sure that IP address are set for the correct
Ethernet nodes.
Internode Testing Echoback tests with specific nodes can also be performed by setting parame-
ters in the DM Area and then manipulating specific bits in memory. This type
of internode test can be performed only for remote nodes that support the
FINS internode testing function. Internode testing can be used to make sure
settings for FINS communications services are correct.
PC Remote Node
(host computer or Ethernet Unit)
TCP UDP
Ethernet Unit
ICMP
IP
Ethernet
Echo request
Echo response
186
Internode Test Section 9-3
Method
Input the following at the host computer prompt ($):
$ ping IP_address(host_name)
The destination is specified by its IP address or host name. If the host name is
used, the host name must be defined in file /etc/hosts.
Note The PING command is not supported by some host computers.
Application Examples
These examples show sending the PING command to the node at IP address
130.25.36.8. The “$” on the example screen represents the host computer
prompt. User inputs are underlined. Comments are placed after semicolons.
187
Internode Test Section 9-3
Test Procedure
1,2,3... 1. Write the test parameters into PC memory. The test parameters are de-
scribed following this procedure.
2. Turn ON the Internode Test Start Switch allocated to the Ethernet Unit in
the CPU Bus Unit Area. The Internode Test Start Switch is described fol-
lowing the test parameters. This will begin the internode test.
3. If desired, the test parameters can be changed while the internode test is
actually running. Use the same procedure as used in step 1.
4. Turn OFF the Internode Test Start Switch allocated to the Ethernet Unit in
the CPU Bus Unit Area to stop the test.
Note 1. The test parameters are effected as soon as they are set or changed. It is
not necessary to reboot or restart. If the test parameters are changed dur-
ing the test, however, the new parameters will not be used until the Intern-
ode Test Start Switch is turned OFF and then back ON.
2. Line traffic on the Ethernet network will increase during the test, possibly
affecting system performance.
Configuration of the The software switches are stored at offsets from the first word calculated with
Software Switches the formula: first word = D03000 + (100 x unit number).
Offset Contents
+0 Bits 8 to 15: Bits 0 to 7:
Remote network address Remote node number
+1 Number of send bytes
+2 Response monitor time
Setting Range The parameter setting ranges are given in the following table.
Parameter Range
Remote network address 00 Hex: Local network
01 to 7F Hex (1 to 127 decimal)
Remote node number 01 to 7E Hex (0 to 126 decimal)
Number of send bytes 0000 Hex specifies the max. length of 1,996
bytes.
0001 to 07CC Hex (1 to 1996 decimal)
Response monitor time 0000 Hex specifies 2 s.
(Unit: 10 ms) 0001 to FFFF Hex (1 to 65535 decimal)
Note 1. The following limits apply to the number of bytes sent when running the test
through a SYSMAC NET or SYSMAC LINK network:
SYSMAC NET: 1,986 bytes
SYSMAC LINK: 512 bytes
2. Broadcast transmissions (target node address = FF) cannot be used for
the internode test.
3. A timeout error will occur if no response is received within the set response
monitor time.
188
Internode Test Section 9-3
− − − − − − − − − − − − −
The internode test run status can be confirmed using the TS indicator on the
Unit’s front panel or the Internode Test Flag (error status, bit 8) in the allocated
words in the CIO Area.
Error status area (1 word) = CIO 1500 + (25 × unit number) + 18
TS indicator Internode Test Flag Run status
(error status, bit 8)
Lit 1 Internode test running
Not lit 0 Internode test stopped
Test Status
The result of the test run and descriptions of errors are stored as the test sta-
tus. The test status is stored at the word whose address is calculated by the
following formula:
Word = D03000 + (100 x unit number) + 3
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1: Timeout error
1: Response error
1: Send error
1: Data not matched
1: Routing table error
1: Send parameter error
Error Code If the test is run repeatedly, the code for the latest test results is stored.
Bit Description
15 14 13
0 0 0 Normal
0 0 1 Timeout error
0 1 0 Response (response code) error
0 1 1 Send error
189
Internode Test Section 9-3
Bit Description
15 14 13
1 0 0 Data not matched
1 0 1 Routing table error (see note)
1 1 0 Send parameter error (see note)
Note The internode test does not count errors when a routing table error or send
parameter error has occurred.
Error Flags The bits corresponding to errors are turned ON if errors occur. The flag status
is maintained until the internode test is run again.
Note 1. The contents of the test status area and test runs/errors area are main-
tained until the internode test is run again.
2. When the number of tests counts to the maximum value (FFFF), subse-
quent internode test runs are counted from 0. However, the maximum val-
ue is maintained and further errors are not counted when the number of
errors reaches the maximum value.
190
SECTION 10
Troubleshooting
This section describes information and procedures that can be used to troubleshoot problems that sometimes occur with
Ethernet Unit and Ethernet communications.
The Ethernet Unit makes up part of a network. Repair a defective Ethernet Unit as soon as possible as it can have a negative
effect on the entire network. We recommend that customers keep one or more spare Ethernet Units to allow immediate
recovery of the network.
191
Troubleshooting with Indicators Section 10-1
192
Troubleshooting with Indicators Section 10-1
193
Error Status Section 10-2
Address disagreement
EEPROM error
Logged Errors The following errors are recorded in the error log.
• Errors in network operation
• Errors in data transfers
• Error in the CPU Unit
194
Error Log Error Codes Section 10-4
Error Log Table Each error is recorded as one record in an error log table. Up to 64 records
can be saved. If more than 64 errors occur, the oldest errors will be deleted
from the error log and the most recent error will be recorded.
The following information is recorded in the error log table.
• Main error code (See table later in this section.)
• Detailed error code (See table later in this section.)
• Time stamp (from the clock in the CPU Unit)
Error Log Location When an error is detected, the error codes and time stamp are recorded in the
error log in RAM inside the Ethernet Unit. Serious errors are also recorded in
EEPROM. The maximum number of errors that can be saved to EEPROM is
64 for the CS Series and 32 for the CJ Series. The errors recorded in
EEPROM will be saved even if the Unit is restarted or power is turned OFF.
When the Ethernet Unit is started, the contents of the error log in EEPROM is
copied to RAM.
When a FINS command is used to read the error log, the log held in RAM is
read. When a FINS command is used to clear the error log, the logs held in
both RAM and EEPROM are cleared.
FINS Commands for Error The following FINS commands can be used to read or clear the error log.
Logs Refer to Section 11 FINS Commands Addressed to Ethernet Units.
Command Function
code
MRC SRC
21 02 ERROR LOG READ
03 ERROR LOG CLEAR
195
Error Log Error Codes Section 10-4
196
Troubleshooting Procedures Section 10-5
Note 1. The time information in the CPU Unit is used in the CPU Bus Units.
2. If the time information cannot be read from the CPU Unit, the time stamp
in the error log will be all zeros. This can occur due to CPU Unit startup
error, unit number errors, CPU error, and model number errors. If the time
is read out from a Programming Device, the time will be shown as all zeros
in the year 2000.
3. The battery must be installed in the CS/CJ-series CPU Unit, the power
turned ON, and then the time set before the clock in the CPU Unit can be
used. The time will not be set correctly in the error log unless the clock time
is set correctly.
4. An error record is not created in EEPROM when a CPU Bus Unit memory
error occurs.
197
Troubleshooting Procedures Section 10-5
True ➨ Make sure that Unit is firmly mounted and tighten the mounting
screws firmly or lock the sliders into place.
6. Do the RUN and ERH indicators not light if another CPU Unit is mounted
to the Rack?
True ➨ Replace the Ethernet Unit.
7. Replace the CPU Unit that didn’t work.
8. ERC indicator not lit?
True ➨ Step 14.
9. Is the same node number used by another Unit?
True ➨ Set the node numbers so that each one is used only once.
10. Create the I/O tables in the CPU Unit.
11. Replace the following components one at a time in the order given and dis-
card any faulty ones: transceiver cable, transceiver, Ethernet Unit.
12. Is the node number set between 01 and 7E Hex?
True ➨ Replace the following items in order to eliminate the faulty part:
Ethernet Unit, transceiver, transceiver cable.
13. Set the unit number to between 01 and 7E Hex.
14. ERH indicator not lit?
True ➨ Step 18.
15. Is the same unit number used by another CPU Bus Unit?
True ➨ Set the unit numbers correctly.
16. Has a CPU Unit error occurred in the PC’s CPU Unit?
True ➨ Restart the CPU Unit. If the error persists, replace the CPU Unit.
17. Set the Setup and routing tables correctly.
18. ERH indicator not flashing?
True ➨ Go to 10-5-6 Network Connection Problems on page 203.
19. Is the IP address incorrect?
True ➨ Correct the IP address in the System Setup, and read out the con-
troller status using the READ CONTROLLER STATUS command
in FINS communications and correct any problems indicated.
20. Make sure that the node number and the last byte of the IP address are the
same and set other host IDs to 0, or change the address conversion meth-
od to use and IP address table or “both methods.”
1,2,3... 1. Refer to 10-6 Troubleshooting with Response Codes on page 207 and re-
move any causes of the problem discovered there before proceeding with
this procedure.
2. Is the control data for the instruction set incorrectly?
True ➨ Make sure that the FINS network address is not set to 0 for the
Ethernet Unit and check the network address, node number and
unit address.
198
Troubleshooting Procedures Section 10-5
General Problems
199
Troubleshooting Procedures Section 10-5
Reception Problems
Transmission Problems
200
Troubleshooting Procedures Section 10-5
General Problems
Opening Problems
Reception Problems
201
Troubleshooting Procedures Section 10-5
Transmission Problems
Connection Problems
1,2,3... 1. Are you unable to connect to the Ethernet Unit’s FTP server?
True ➨ Step 5.
2. If the FTP indicator lit?
True ➨ The FTP server is connected to another client. Wait until the client
has finished.
3. Are the parameter settings in the host computer incorrect?
True ➨ Correct the computer settings. Refer to the documentation for your
computer.
4. Go to 10-5-6 Network Connection Problems on page 203.
5. Are you unable to log in?
True ➨ Check the login name and password settings.
6. Is a Memory Card being used?
True ➨ Step 11.
7. Can you display the EM directory using ls from the host computer?
True ➨ End.
8. Have specified banks of the EM Area been converted to EM File Memory?
True ➨ Step 9.
9. Has the EM File Memory been initialized?
202
Troubleshooting Procedures Section 10-5
1,2,3... 1. Go through the procedure in 10-5-1 Startup Problems before starting this
procedure.
2. Go to step 6. for the CS1W-ETN11 or CJ1W-ETN11.
3. Is the P/S indicator lit?
True ➨ Step 6.
4. Is a 24-VDC power supply connected?
203
Troubleshooting Procedures Section 10-5
True ➨ Replace the following items in order to remove the faulty part:
Power supply cable, Power Supply Unit, Ethernet Unit.
5. Connect a 24-VDC power supply.
6. Is the power supply indicator lit on the transceiver?
True ➨ Step 9.
7. Is the transceiver cable loose?
True ➨ Connect the cable firmly.
8. Replace the following components one at a time in the order given and dis-
card any faulty ones: transceiver cable, transceiver, Ethernet Unit.
9. Execute ping at each node for all nodes on the network to see if commu-
nications are possible.
10. Was not even one response received at every node in the network?
True ➨ Check terminators, the coaxial cable, and transceiver cables.
11. Were responses not received only between certain nodes?
True ➨ Make sure the distance between transceivers on the coaxial cable
is a multiple of 2.5 m.
Check IP address settings.
Make sure that the remote node supports ICMP.
12. Is an FTP client not mounted on the remote node?
True ➨ Mount an FTP client.
13. Are you using FINS communications (e.g., SEND(090), RECV(098), or
CMND(490))?
True ➨ Do an internode test.
14. Read protocol status using the FINS command READ PROTOCOL STA-
TUS and check the following parameters in the returned status data. If any
of these items have actually been counted, the remote node may not sup-
port the relevant service.
IP (all communications): Items 2 through 6
ICMP (PING): Items 5 through 8
TCP (FTP and TCP sockets): Items 4 through 6 under reception status
UDP (FINS and UDP sockets): Items 1 through 3
If item 4, 8, or 9 under the IP status is being counted, there may be too
much traffic through the Ethernet Unit. Check your user applications.
204
Troubleshooting Procedures Section 10-5
205
Troubleshooting Procedures Section 10-5
error log information, or status data is not set in the send informa-
tion).
11. Is the send status for recurring mail “0”?
True ➨ If sending recurring mail is not set in the Setup, make the proper
settings.
If sending recurring mail is set in the Setup, go to Step 24.
12. Is the send status for recurring mail “6”?
True ➨ Check the communications path.
Correct the SMTP server address.
Correct the IP router table.
Something is blocking communications or equipment on the com-
munications path is not set correctly.
13. Is the destination mail address incorrectly set?
True ➨ Correct the destination mail address in the Setup. (Error mail will
be held at the SMTP server if the destination mail address is incor-
rect. Be sure the send destination mail address is set correctly.)
14. Is required information missing from the mail data?
True ➨ Correct the mail send information settings in the Setup (the user
data, error log information, or status data is not set in the send in-
formation).
15. Was it impossible to obtain the required information from the mail data?
True ➨ Correct the following errors.
Correct the user-generated mail address.
Check the user application to be sure that there is not too much
traffic at the Ethernet Unit.
16. Is notification given for error mail?
True ➨ End
17. Is the send status for error mail “7”?
True ➨ Correct mistakes in the Setup
Correct the SMTP server address (it is set to 0.0.0.0).
Correct the error mail send information settings (the user data, er-
ror log information, or status data is not set in the send informa-
tion).
18. Is the send status for error mail “0”?
True ➨ If sending error mail is not set in the Setup, make the proper set-
tings.
If sending error mail is set in the Setup, no system errors have oc-
curred and the system should be operating correctly.
19. Is the send status for error mail “6”?
True ➨ Check the communications path.
Correct the SMTP server address.
Correct the IP router table.
Something is blocking communications or equipment on the com-
munications path is not set correctly.
20. Is the destination mail address incorrectly set?
True ➨ Correct the destination mail address in the Setup. (Error mail will
be held at the SMTP server if the destination mail address is incor-
rect. Be sure the send destination mail address is set correctly.)
21. Is required information missing from the mail data?
206
Troubleshooting with Response Codes Section 10-6
True ➨ Correct the mail send information settings in the Setup (the user
data, error log information, or status data is not set in the send in-
formation).
22. Was it impossible to obtain the required information from the mail data?
True ➨ Correct the following errors.
Correct the user-generated mail address.
Check the user application to be sure that there is not too much
traffic at the Ethernet Unit.
23. End
24. Check the setting of the mail send timing in the Setup. The timing may not
be set or may be set longer than intended.
207
Troubleshooting with Response Codes Section 10-6
208
Troubleshooting with Response Codes Section 10-6
Network Relay Errors For network relay errors using SEND(090) or RECV(098), check the path of
the command using the routing tables and the nature of the error using the
response code to eliminate the cause of the error.
For network relay errors using CMND(490), the location of the relay error is
recorded in the second through third words of the response, as shown below.
1st byte 2nd byte
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
First word 0 0 0
Command code
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Second word Main response code (MRES) Sub response code (SRES)
209
Results Storage Area Response Codes Section 10-7
210
Results Storage Area Response Codes Section 10-7
211
SECTION 11
FINS Commands Addressed to Ethernet Units
This section describes the FINS commands that can be sent to an Ethernet Unit and the responses that are returned by the
Ethernet Unit.
213
Command Codes and Response Codes Section 11-1
214
Socket Applications Section 11-2
The MRES codes are shown in the following table along with the results they
indicate. Refer to 10-6 Troubleshooting with Response Codes for details on
response codes including the SRES.
MRES Execution results
00 Normal completion
01 Local node error
02 Remote node error
03 Unit error (controller error)
04 Service not supported
05 Routing error
10 Command format error
11 Parameter error
22 Status error
23 Operating environment error
25 Unit error
11-2-1 Format
The basic format of these commands is shown in the diagram below.
Socket Number Specifies the socket number for which the process is requested, from 1 to 8.
Results Storage Area Specifies the area to store the results of the requested process.
Parameters Specifies the parameters for the command code. Parameters depend on the
command being executed; for details, refer to the following pages.
215
Socket Applications Section 11-2
Note The variable types (area designations) given in parentheses can also be
used, allowing CV-series or CVM1 programs to be more easily corrected for
use with CS/CJ-series PCs.
Word and Bit Addresses Three bytes of data are used to express data memory addresses of PCs. The
most significant two bytes give the word address and the least significant byte
gives the bit number between 00 and 15. The word address combined with
the bit number expresses the bit address. The bit number is always 00
because Ethernet Units can handle only word data, i.e., individual bits cannot
be addressed.
00
Word Bit
Word addresses for specific memory area words can be calculated by con-
verting the normal decimal word address to hexadecimal and adding it to the
first word in the Addresses for communications column in the above table. For
example, the address for communications for D00200 would be 0000 (from
above table) plus C8 (decimal 200 converted to hexadecimal), or 00C8.
216
Command/Response Reference Section 11-3
Two bytes
The results storage format is the format used to store transfer results and data
for socket services requested with command codes 2701 to 2714.
Response codes applicable to the command are described at the end of the
command description. If any UNIX error codes are generated, these are also
described. Refer to your UNIX error symbol definition file /usr/include/sys/
errno.h for details. UNIX errors are returned in the results storage area.
Note Except for special cases, all send/receive data is in hexadecimal format.
11-3-1 RESET
Reset the Ethernet Unit.
Command Block
04 03
Command
code
Response Block
04 03
Command Response
code code
Precautions
No response will be returned if the command ends normally. A response will
be returned only if an error occurs.
In some cases, send requests (SEND(192)/RECV(193) instructions) made
from the PC to the Ethernet Unit just before execution of the RESET com-
mand may not be executed.
Except for the FINS communications service sockets, all open sockets (for
sockets services, FTP server, or mail transmission) are closed immediately
before resetting.
Response Codes
Response code Description
1001 Command too large
217
Command/Response Reference Section 11-3
Command
code
Response Block
Command Response Model Version IP address Subnet FINS UDP Mode Ethernet
code code mask port number setting address
Parameters
Model, Version The Ethernet Unit mode and version are returned as ASCII characters occu-
(Response) pying 20 bytes each (i.e., 20 characters each). If all bytes are not used, the
remaining bytes will be all spaces (ASCII 20 Hex).
Example Model: CS1W-ETN01, CS1W-ETN11, CJ1W-ETN11
Version: V1.00
IP Address, Subnet Mask The Ethernet Unit’s IP address and subnet mask are returned as 4 bytes
(Response) each.
FINS UDP Port Number The Ethernet Unit’s UDP port number for FINS is returned as 2 bytes.
(Response)
Mode Setting (Response) The mode setting in the system setup is returned.
Bit 15 00
Others all 0
Broadcast setting
IP address conversion
FINS UDP port number
designation
Broadcast Setting
0: All 1s for host number (4.3BSD specification)
1: All 0s for host number (4.2BSD specification)
IP Address Conversion
00, 01: Automatic generation
10: IP address table
11: Both methods (IP address table + automatic generation)
FINS UDP Port Number Designation
0: Default value (9600)
1: System setup value
Ethernet Address The Ethernet address of the Ethernet Unit is returned. The Ethernet address
(Response) is the address marked on the label on the side of the Ethernet Unit.
Response Codes
Response code Description
0000 Normal
1001 Command too large
218
Command/Response Reference Section 11-3
Command Block
06 01
Command
code
Response Block
Parameters
Error Flags (Response) Indicates the operating status and errors that occurred when the Ethernet Unit
was started.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
219
Command/Response Reference Section 11-3
Note If this bit turns ON for the CS1W-ETN11 or CJ1W-ETN11, the Ether-
net Unit has malfunctioned.
Address Disagreement
The address conversion method was set for automatic generation, but the
node number and the last byte of the local IP address do not agree, or other
host sections are 0.
EEPROM Error
An error occurred in the EEPROM memory in the Ethernet Unit.
Total Number of Packets The total number of packets received by the Ethernet Unit is returned.
Received (Response)
Total Number of Receive The total number of errors detected while the Ethernet Unit was receiving is
Errors (Response) returned. The types of error detected are short packet errors, alignment
errors, and CRC errors.
Total Number of Packets The total number of packets sent by the Ethernet Unit is returned.
Sent (Response)
Total Number of Errors The total number of packet errors detected while the Ethernet Unit was send-
Sent (Response) ing is returned.
Total Number of Send The number of packets damaged by 16 collisions with data from other nodes
Collisions during Ethernet Unit transmissions.
Precautions Counting of the total number of packets received, total number of receive
errors, total number of packets sent, total number of errors sent, and total
number of send collisions is discontinued when the counted value reaches the
maximum value.
Response Codes
Response code Description
0000 Normal
1001 Command too large
220
Command/Response Reference Section 11-3
Always specify the unit address of the Ethernet Unit in the CMND(194)
instruction.
Response Codes
Response code Description
0000 Normal
1001 Command too large
1002 Command too small (No test data)
Command
code
Response Block
08 02
Response Codes
Response code Description
0000 Normal
1001 Command too large
Precautions
No response is made to this command.
When using this command, set the FINS header parameters (or the control
data for the CMND(194) instruction) as follows:
Destination node number: FF (broadcast data)
Destination unit address: FE (Ethernet Unit)
Response/no response flag: 1 (no response)
221
Command/Response Reference Section 11-3
Command Block
21 02
21 02 10 bytes 10 bytes
Parameters
Beginning Record Number The first record to be read. The first record number can be specified in the
(Command) range between 0000 and 003F (0 to 63 decimal) where 0000 is the oldest
record.
Number of Records The number of records to read is specified between 0001 and 0040 (1 to 64
(Command, Response) decimal) in the command. The response returns the actual number of records
read.
Maximum Number of The maximum number of records that can be stored in the error log. Care is
Stored Records required as the error log differs according to the type of PC or CPU Bus Unit.
(Response) In an Ethernet Unit, the maximum number of stored records is fixed at 40 (64
decimal).
Number of Stored The number of records stored at the time the command is executed is
Records (Response) returned.
Error Log Data The specified number of error log records from the beginning record number
(Response) is returned sequentially. The total number of bytes in the error log is calculated
as the number of records x 10 bytes/record. Each error log record thus com-
prises 10 bytes, configured as follows:
1st byte 10th byte
Error Detailed
code information Month
Year
Hour
Day
Second
Minutes
222
Command/Response Reference Section 11-3
Response Codes
Response code Description
0000 Normal
1001 Command too large
1002 Command too small
1103 Beginning record number is out of range
110C The number of read records is 0.
Command
code
Response Block
21 03
Command Response
code code
Response Codes
Response code Description
0000 Normal
1001 Command too large
Response Block
27 01
Command Response
code code
Results Storage
Format
Results storage
response code
Parameters
UDP Socket Number The UDP socket number to be opened specified as 2 bytes between 1 and 8.
(Command)
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
page 216 for details about the variable types and addresses that can be spec-
ified.
Local UDP Port Number The UDP port number for communications with the socket is specified as 2
(Command) bytes (0 cannot be specified). Packets received at this port are distributed to
223
Command/Response Reference Section 11-3
the socket specified in the UDP socket number, and send packets are distrib-
uted from the UDP socket to this port. The port number specified as the FINS
UDP port number (default value 9600) cannot be used.
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1100 UDP socket number is out of range.
Local UDP port number is 0.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
220F Specified socket is already open or is being closed.
2211 High traffic at Unit; cannot execute service.
Command Response
code code
Results Storage
Format Received bytes
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
page 216 for details about the variable types and addresses that can be spec-
ified.
224
Command/Response Reference Section 11-3
Number of Reception The maximum number of bytes of data to be received is given in the com-
Bytes (Command, Results mand. The number of bytes of data received will be stored in the results stor-
Storage Area) age area. Up to 1,984 bytes can be specified.
Timeout Value (Command) The maximum control time between receiving the receive request and storing
the result. If this set time limit is exceeded, the code for a timeout error will be
set as the results storage response code. The value is set in units of 0.1 s.
The timeout time will be unlimited if the value is set to 0.
Source UDP Port Number The port number of the node sending data.
(Results Storage Area)
Received Data (Results The data sent from the remote node.
Storage Area)
Precautions
If a packet is received which contains more bytes than the number specified in
Number of reception bytes specified in the command, the specified number of
bytes will be stored and the remainder of the bytes will be discarded.
Response Codes
Response code Description
0000 Normal
0105 IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1100 UDP socket number or number of reception bytes is out of
range.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
220F The specified socket is currently receiving data.
2210 The specified socket is not open.
2211 High traffic at Unit; cannot execute service.
225
Command/Response Reference Section 11-3
Command Block
27 03 1984 bytes max.
Command UDP Results storage area Destination IP Destination Number of Send data
code socket address UDP port bytes sent
number number
Response Block
27 03
Command Response
code code
Results Storage
Format
Response Number of
code bytes sent
Parameters
UDP Socket Number The UDP socket number to send the data specified as 2 bytes between 1 and
(Command) 8.
Results Storage Area The area in which the result of the command execution is stored. The first byte
(Command) specifies the memory area and data type (variable type). The 2nd to 4th bytes
specify the beginning address of the results storage area. Refer to page 216
for details about the variable types and addresses that can be specified.
Destination IP Address The IP address of the node to which data is being sent.
(Command)
Destination UDP Port The UDP port number of the node to which data is being sent.
Number (Command)
Number of Bytes Sent The number of bytes in the data sent by this command. Up to 1,984 bytes can
(Command, Results be specified, or up to 1,472 bytes can be specified if the broadcast address is
Storage Area) specified as the send destination. The results storage area stores the actual
number of bytes sent.
Send Data (Command) Specifies the data sent to the remote node.
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1003 The number of bytes sent does not match the sent data
length.
1100 UDP socket number or number of bytes sent is out of range.
The destination IP address is 0.
Local UDP port number is 0.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
220F Specified socket is currently sending.
2210 The specified socket is not open.
2211 High traffic at Unit; cannot execute service.
226
Command/Response Reference Section 11-3
Command Block
27 04
Response Block
27 04
Command Response
code code
Results Storage
Format
Response
code
Parameters
UDP Socket Number The UDP socket number to be closed specified as 2 bytes between 1 and 8.
(Command)
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
page 216 for details about the variable types and addresses that can be spec-
ified.
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1100 UDP socket number is out of range.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
227
Command/Response Reference Section 11-3
Command Block
27 10
Command TCP Results storage area Local Timeout Remote IP Remote TCP
code socket TCP value address port number
number port
number
Response Block
27 10
Command Response
code code
Results Storage
Format
Response Remote IP Remote port
code address number
Parameters
TCP Socket Number The TCP socket number to be opened specified as 2 bytes between 1 and 8.
(Command)
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
page 216 for details about the variable types and addresses that can be spec-
ified.
Local TCP Port Number The TCP port number for communications with the socket is specified as 2
(Command, Results bytes (0 cannot be specified). Do not specify the port number of the FTP
Storage Area) server (port #21).
Timeout Value (Command) The maximum control time between receiving the open request and storing
the result. If this set time limit is exceeded, the code for a timeout error will be
set as the results storage response code. The value is set in units of 0.1 s.
The timeout time is unlimited if the value is set to 0.
Remote IP Address Specify the remote node’s IP address. If all zeroes are set, no remote node is
(Command, Results specified and connection is awaited from any node. If any other value is set,
Storage Area) connection is awaited from the specified remote node. The IP address of the
connected remote node will be stored in the results storage area.
228
Command/Response Reference Section 11-3
Remote Port Number Specify the remote TCP port number with this command. If all zeroes are set,
(Command, Results no remote TCP port number is specified. If any other value is set, it specifies
Storage Area) the TCP port number of the remote node. The TCP port number of the con-
nected remote node will be stored in the results storage area.
Precautions
Processing varies as shown in the table below according to the specified com-
bination of remote IP address and remote TCP port number.
Remote IP address Remote TCP port Description
0 0 All connection requests received
0 Not 0 Received only when port number
matches.
Not 0 0 Received only when IP address
matches.
Not 0 Not 0 Received only when IP address and
port number matches.
229
Command/Response Reference Section 11-3
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1100 TCP socket number is out of range.
Local TCP port number is 0.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
220F The specified socket (connection) is already open or is cur-
rently being opened.
2211 High traffic at Unit; cannot execute service.
230
Command/Response Reference Section 11-3
27 11
Response Block
27 11
Command Response
code code
Results Storage
Format
Response Local port
code number
Parameters
TCP Socket Number The TCP socket number to be opened specified as 2 bytes between 1 and 8.
(Command)
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
page 216 for details about the variable types and addresses that can be spec-
ified.
Local TCP Port Number The TCP port number for communications with the socket is specified as 2
(Command, Results bytes (0 cannot be specified). Do not specify the port number of the FTP
Storage Area) server (port #21). An available TCP port number is automatically assigned if 0
is specified.
Remote Port Number Specify the remote TCP port number (must be non-zero).
(Command)
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1100 TCP socket number is out of range.
Remote IP address is 0.
Remote TCP port number is 0.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
220F The specified socket (connection) is already open or is being
opened.
2211 High traffic at Unit; cannot execute service.
231
Command/Response Reference Section 11-3
Response Block
27 12
Command Response
code code
Results Storage
Received bytes
Format
Response Number of Received data
code reception
bytes
Parameters
TCP Socket Number The TCP socket number to receive data specified as 2 bytes between 1 and 8.
(Command)
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
232
Command/Response Reference Section 11-3
page 216 for details about the variable types and addresses that can be spec-
ified.
Number of Reception The maximum number of bytes of data to be received is given in the com-
Bytes (Command, Results mand. The number of bytes of data received will be stored in the results stor-
Storage Area) age area. Up to 1,984 bytes can be specified.
Timeout Value (Command) The maximum control time between receiving the receive request and storing
the result. If this set time limit is exceeded, the code for a timeout error will be
set as the results storage response code. The value is set in units of 0.1 s.
The timeout time is unlimited if the value is set to 0.
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1100 TCP socket number or number of reception bytes is out of
range.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
220F The specified socket is receiving data.
2210 No connection could be established to the specified socket.
2211 High traffic at Unit; cannot execute service.
233
Command/Response Reference Section 11-3
Command Response
code code
Results Storage
Format
Response Number of
code bytes sent
Parameters
TCP Socket Number The TCP socket number to send the data specified as 1 byte between 1 and
(Command) 8.
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
page 216 for details about the variable types and addresses that can be spec-
ified.
Number of Bytes Sent The number of bytes in the data sent specified between 1 and 1,984. The
(Command, Results results storage area stores the actual number of bytes sent.
Storage Area)
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1003 The number of bytes sent does not match the amount of data.
1100 The TCP socket number or number of bytes sent is out of
range.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
220F The specified socket is sending data.
2210 No connection could be established to the specified socket.
2211 High traffic at Unit; cannot execute service.
234
Command/Response Reference Section 11-3
Response Block
27 14
Command Response
code code
Results Storage
Format
Response
code
Parameters
TCP Socket Number The TCP socket number to be closed specified as 2 bytes between 1 and 8.
(Command)
Results Storage Area The area in which the results of the command execution are stored. The first
(Command) byte specifies the memory area and data type (variable type). The 2nd to 4th
bytes specify the beginning address of the results storage area. Refer to
page 216 for details about the variable types and addresses that can be spec-
ified.
Precautions
Any other processing, such as sending or receiving data, being carried out
when this close command is executed will be forcibly ended and a code will be
stored in the results storage area to indicate that this processing was forcibly
ended.
235
Command/Response Reference Section 11-3
Response Codes
Response code Description
0000 Normal
0105 Local IP address setting error
0302 CPU Unit error; execution not possible.
1001 Command too large
1002 Command too small
1100 The TCP socket number is out of range.
1101 The variable type for the results storage area is out of range.
1103 Non-zero bit address specified for the results storage area.
2210 No connection could be established to the specified socket.
2211 High traffic at Unit; cannot execute service.
11-3-18 PING
Equivalent processing to the UNIX computer ping command (see below).
Command Block
27 20
Response Block
27 20
Command Response
code code
Parameters
Destination IP Address The IP address (in hexadecimal) of the destination node for the PING com-
(Command) mand echo request packet.
Timeout Value (Command) The wait time for the echo reply packet. The value is set in seconds. The time-
out time is set at 20 seconds if the value is specified as 0. If the echo reply
packet is not received within the set time limit, the code for a timeout error will
be set as the results storage response code.
Remarks PING Command
The PING command runs the echoback test using the ICMP protocol. When
the PING command is executed, an echo request packet is sent to the remote
node ICMP. Correct communications are confirmed when the returned
response packet is received normally. The echo reply packet is automatically
returned by the remote node ICMP. Refer to 9-2 PING Command.
Response Codes
Response code Description
0000 Normal (echo reply received from the remote node)
0205 Timeout error
1001 Command too large
1002 Command too small
1100 Zero destination address
220F PING command currently being executed
2211 High traffic at Unit; cannot execute service.
236
Command/Response Reference Section 11-3
Response Block
27 50
Command Response
code code
Parameters
Number of Records The number of records to write is specified between 0000 and 0020 (0 to 32
(Command) decimal) in the command. If this value is set to 0, the IP address table will be
cleared so that no records are registered.
IP Address Table Records Specify the IP address table records. The number of records specified must
(Command) be provided. The total number of bytes in the IP address table records is cal-
culated as the number of records x 6 bytes/record. The configuration of the
6 bytes of data in each record is as shown in the following diagram.
1 6 bytes
00
237
Command/Response Reference Section 11-3
Response Block
27 57
Command Response
code code
Parameters
IP Address (Command) Specify the local IP address of the Ethernet Unit using 4 pairs of hexadecimal
numbers in the range 00.00.00.00 to FF.FF.FF.FF (0.0.0.0. to
255.255.255.255 decimal). If 0.0.0.0 is specified, the local IP address set in
the allocated words in the DM Area is enabled.
Example: 150.31.2.83
96 1F 02 53
Subnet Mask (Command) Specify the local IP address of the Ethernet Unit using 4 pairs of hexadecimal
numbers in the range 00.00.00.00 to FF.FF.FF.FF (0.0.0.0. to
255.255.255.255 decimal).
Example: 255.255.255.255
FF FF FF 00
Response Codes
Response code Description
0000 Normal
1001 Command too large
1002 Command too small
Precautions
The local IP address and subnet mask set using this mask are written to the
CPU Bus Unit System Setup for the Ethernet Unit. For details, refer to 4-2
CPU Bus Unit System Setup.
The new local IP address and subnet mask settings will not be effective until
the PC is restarted or the Ethernet Unit is reset.
238
Command/Response Reference Section 11-3
Command Number of
code records
Response Block
27 60 6 bytes 6 bytes
Number of Stored The number of IP address table records stored at the time the command is
Records (Response) executed is returned as a hexadecimal number.
IP Address Table Records The number of IP address table records specified in the number of records
(Response) parameter is returned. The total number of bytes in the IP address table
records is calculated as the number of records x 6 bytes/record. The configu-
ration of the 6 bytes of data in each record is as shown in the following dia-
gram.
1 6 bytes
00
239
Command/Response Reference Section 11-3
Command Number of
code records
Response Block
27 61 8 bytes 8 bytes
Maximum Number of The maximum number of records that can be stored in the IP router table is
Stored Records returned. The maximum number of stored records is fixed at 0008 (8 records).
(Response)
Number of Stored The number of IP router table records stored at the time the command is exe-
Records (Response) cuted is returned.
IP Router Table Records The number of IP router table records specified in the number of records
(Response) parameter is returned. The total number of bytes in the IP router table records
is calculated as the number of records x 8 bytes/record. The configuration of
the 8 bytes of data in each record is shown below.
1 8 bytes
IP Network Address
The network ID from the IP address in hexadecimal. The network ID part cor-
responding to the address class (determined by the leftmost 3 bits; refer to 1-
7 IP Addresses) set here, is enabled.
Router IP Address
The IP address of a router connected to a network specified with IP
addresses.
Precautions
If the IP router table contains fewer records than the number specified in the
number of records parameter, all the records contained in the IP router table
when the command is executed will be returned and the command execution
will end normally.
Response Codes
Response code Description
0000 Normal
1001 Command too large
1002 Command too small
240
Command/Response Reference Section 11-3
Command
code
Response Block
27 62 48 bytes 184 bytes 184 bytes 12 bytes
ICMP Status (Response) Ten types (46 items) of ICMP status information occupying 4 bytes each are
returned in the following sequence. Each value is returned as an 8-digit hexa-
decimal value.
1,2,3... 1. The number of times the ICMP error routine was called. The ICMP error
routine uses ICMP packets to inform the source about errors. The routine
is called when an illegal packet is received (error in IP option processing
or error in relay processing) or if the object port does not exist when using
UDP.
2. Always 0.
241
Command/Response Reference Section 11-3
3. Always 0.
4. Total number of outputs of each packet type during ICMP output. The 19
statistical values are returned in the order shown below. Contents are de-
fined for 13 types only; all other types contain 0. Only #0, #3, #14, #16, and
#18 are counted by the Ethernet Unit.
4 bytes
242
Command/Response Reference Section 11-3
10. Total number of inputs of each packet type during ICMP input. The 19 sta-
tistical values are returned in the order shown below. Contents are defined
for 13 types only; all other types contain 0.
4 bytes
TCP Status (Response) Three types (46 items) of TCP status information occupying 4 bytes each are
returned in the following sequence. Each value is returned as an 8-digit hexa-
decimal value.
1) Connection Information (60 Bytes)
Fifteen items are returned in the following sequence:
243
Command/Response Reference Section 11-3
11. The number of times no ACK was returned within the resend timer set time.
(The resend timer sets the maximum time limit between the data being out-
put and ACK being returned.)
12. The number of times no window advertisement is received within the time
set on the duration timer. (The duration timer sets the maximum time limit
for a window advertisement to be received if the transmission window is
smaller than necessary and the resend timer is not set. If no window ad-
vertisement is received within the time limit, the number of segments per-
mitted by the transmission window are sent. If the transmission window is
set to 0, a window probe (1 octet of data) is sent before the timer restarts.)
13. The number of times no segment was sent or received within the time set
on the hold timer.
14. The number of times the hold packet is resent. (Always 0.)
15. The number of times the hold packet is sent without response before the
connection is cut off.
2) Send Information (40 Bytes)
Ten information items are returned in the following sequence:
244
Command/Response Reference Section 11-3
UDP Status (Response) Three items of UDP information occupying 4 bytes each are returned in the
following sequence. Each value is returned as an 8-digit hexadecimal value.
1,2,3... 1. The number of packets discarded because the size of the first short buffer
was smaller than the minimum size (28) of the IP header and UDP header
when the packet was stored.
2. The number of packets discarded due to an incorrect checksum in the UDP
header.
3. The number of packets discarded because the IP overall length in the IP
header was shorter than the UDP overall length in the UDP header.
Precautions
All the above values are set to 0 if network operation stops due to incorrect
settings in the system setup.
Counting will be stopped when a count reaches the maximum value. The
maximum values are as follows:
IP, ICMP, or UDP status: 7FFFFFFF (2,147,483,647 decimal)
TC status: FFFFFFFF (4,294,967,295 decimal)
Response Codes
Response code Description
0000 Normal
1001 Command too large
Command
code
Response Block
27 63 92 bytes
245
Command/Response Reference Section 11-3
2. Short Buffer Application by Type: Thirteen items are returned (52 bytes).
a) The number of short buffers used for storing communications data.
b) The number of short buffers used for protocol headers (TCP, UDP, IP,
ICMP, ARP)
c) The number of short buffers used in socket structures
d) The number of short buffers used as protocol control blocks
e) The number of short buffers used for routing tables
f) Not used (always 0)
g) Not used (always 0)
h) The number of short buffers used for IP fragment re-assembly queue
headers
i) The number of short buffers used for storing socket addresses
j) Not used (always 0)
k) The number of short buffers used for storing socket options
l) The number of short buffers used for storing access rights
m) The number of short buffers used for storing interface addresses
3. Long Buffer Application: Two items are returned (8 bytes).
a) The number of long buffers currently being used.
b) The number of long buffers in the system (fixed at 64 decimal).
4. Not Used: Always 0. (4 bytes)
5. Network Memory Application: Two items are returned.
a) The number of bytes used (in K bytes)
b) The percentage used.
6. Memory Exhaustion Log (12 bytes)
Counts for the following values indicate a high load on the Ethernet Unit.
These high loads may be caused by problems in communications, partic-
ularly FINS communications and UDP sockets. If these values are consis-
tently high, check your applications.
a) The number of times an attempt was made to secure a short buffer
without WAIT when there were no short buffers available.
b) The number of times an attempt was made to secure a short buffer
with WAIT when there were no short buffers available.
c) The number of times an attempt was made to release and secure a
short buffer already being used by another socket when there were no
short buffers available.
Precautions
All the above values are set to 0 if Ethernet communications functions are
stopped due to improper settings in the system setup.
These values are cleared when the Ethernet Unit is started or reset. Values
will be counted only until the maximum values are reached.
Response Codes
Response code Description
0000 Normal
1001 Command too large
246
Command/Response Reference Section 11-3
Command
code
Response Block
27 64 32 bytes 32 bytes
247
Command/Response Reference Section 11-3
Precautions
All the above values are set to 0 if Ethernet communications functions are
stopped due to improper settings in the system setup.
Response Codes
Response code Description
0000 Normal
1001 Command too large
Command
code
Response Block
27 65 6 bytes
00
248
Command/Response Reference Section 11-3
Command
code
Response Block
27 67 00
Parameters
Number of Addresses (Response)
The number of sets of FINS node numbers, IP addresses, and subnet masks
being returned. The Ethernet Unit is always 0001 (1 decimal).
FINS Node Number (Response)
Node number set on the Ethernet Unit (hexadecimal).
IP Address
The local IP address set in the CPU Bus Unit System Setup for the Ethernet
Unit is returned in order starting from the leftmost bytes in hexadecimal. If the
local IP address set in the allocated words in the DM Area is enabled, 0.0.0.0
is returned.
Subnet Mask (Response)
The subnet mask set in the CPU Bus Unit System Setup for the Ethernet Unit
is returned in order starting from the leftmost bytes in hexadecimal.
Response Codes
Response code Description
0000 Normal
1001 Command too large
249
Appendix A
Network Installation
Recommended Products
The following products are recommended for use with the CS1W-ETN01 Ethernet Unit.
CS1W-ETN01 (10Base-5)
Part Company Model
Transceiver Hirakawa Hewtech Corp. MTX-210TZ
Mitsubishi Cable Indus- ET-10081
tries,Ltd.
Transceiver cable Mitsubishi Cable Indus- Transceiver cables
tries,Ltd. (molded type)
24-VDC Power Supply OMRON S82J Series
251
Network Installation Appendix A
• Ground the external shield of the coaxial cable to 100 W or less using AWG 14 wire (cross-sectional area
of 2 mm2) or better and a ground cable length of 20 m or less. Ground each segment of the network at one
location only. Do not use the same ground for other equipment.
• The physical properties (e.g., minimum bending radius) of coaxial cable vary with the manufacturer. Follow
all recommendations and specifications of the manufacturer.
Environmental Precautions
• Do not install coaxial cables together with power cables.
• Do not install coaxial cable near sources of noise.
• Do not install coaxial cable in environments subject to excessive dirt, dust, oil mist, etc.
• Do not install coaxial cable in environments subject to high temperatures or high humidity.
Grounding
• Ground all devices requiring grounding to 100 W or less using AWG 14 wire (cross-sectional area of 2
mm2) or better and a ground cable length of 20 m or less. Electrical shock can occur between ungrounded
devices in the system. The lack of proper grounds can also corrupt data.
• Use one safety ground on each segment of the network.
• Inductive voltages can be generated due to lightning surges when coaxial cable is installed outdoors,
requiring special measures. Request outdoor installation from a professional.
252
Network Installation Appendix A
Ceiling Installation
Inspection opening
253
Network Installation Appendix A
Secured
wooden
board
Transceiver
Distribution panel
Metal duct
Duct
Corner box
Transceiver cable
Wire protector
Metal Ducts
1. Place the coaxial cable in metal ducts.
2. Place transceivers into metal boxes, placing a wooden board or other insulating board between the
box and the transceiver. The transceiver and the metal box must be electrically insulated from each
other.
3. If the transceiver cable is also in a noise-prone area, place it into a metal duct as well.
254
Network Installation Appendix A
4. Refer to the CS/CJ-series Programmable Controllers Operation Manual (W339) for information on
wiring inside distribution boxes.
4. Distribution box
Ethernet Unit
CS-series PC
Transceiver cable
Wooden board
1. Metal duct
Transceiver
2. Metal box for transceiver 2. Metal box for transceiver
Noise
Note 1. Cover all metal portions of cables with insulating tape to be sure they do not come into contact with
the metal ducts or boxes.
2. Securely ground all distribution boxes and metal boxes around transceivers. The lower the ground
resistance, the more effective the shields will be.
3. The twisted-pair cable for 10Base-T is not shielded, and the hub is designed for use in OA environ-
ments. In environments subject to noise, we recommend the use of 10Base-5 Ethernet.
255
Network Installation Appendix A
Multipoint Transceivers
Multipoint transceivers can be used to eliminate the need for coaxial cable (which is easily affected by noise)
and replace it with transceiver cable as shown in the following diagram. This will increase overall system resis-
tance to noise.
Note Up to two sets of multipoint transceivers can be used in a network. The length of the network will be lim-
ited to the maximum length of transceiver cable.
Transceiver cable
Node Node
Noise-prone area
Coaxial cable
Transceiver Transceiver
Segment 1 Segment 2
Transceiver Transceiver
Noise-prone area
Optical Optical
transceiver transceiver
Repeater Repeater
Optical fiber cable
256
Network Installation Appendix A
Outdoor Installations
The following example shows how optical fiber cable can be used to connect a network between two buildings,
eliminating possible adverse affects of lightning.
Segment 1 Segment 2
Coaxial cable
Coaxial cable
Transceiver Transceiver
Optical Optical
transceiver transceiver
Optical fiber cable
Repeater Repeater
Note Consult with the manufacturer for details on optical Ethernet devices.
257
Network Installation Appendix A
Stack Connections
• Connect the hubs using special cables or special racks.
• Normally there is no limit to the number of hubs in a stack, and each stack is treated as one hub. Some
hubs, however, are limited in the number of hubs per stack.
Hub
Transceiver/Hub
Contact outputs
258
Network Installation Appendix A
Cable Location
Separate the transceiver cable or twisted-pair cable connecting the Ethernet Unit as far from the wiring to the
Contact Output Units as possible. The coaxial cable must also be placed as far away from the Contact Output
Units and their wiring as possible.
Contact outputs
To transceiver/hub
Transceiver/Hub Measures
Attach several ferrite cores designed for EMI countermeasures on the transceiver cable or twisted-pair cable
near the transceiver/hub. The transceiver must also be placed as far away from the Contact Output Units and
their wiring as possible.
Ethernet Unit
Ferrite core
Transceiver/Hub
Transceiver
cable
259
Appendix B
Ethernet Network Parameters
261
Appendix C
Buffer Configuration
UDP socket
(see note 1)
reception
request buffers
(8 x 9,016 max.)
FINS reception
buffer (16,383
FINS processing bytes max.)
CPU Unit
buffers (192 x
Communications
2,020 bytes) Network
controller
FINS send
buffer (9,000
bytes max.)
FTP service
send buffer
(4,096 bytes)
IP packet
output queue
(50 max. x
1,500 bytes)
TCP socket send
request buffers (8
x 4,096 max.)
(see note 2)
263
Buffer Configuration Appendix C
Network Memory
Most of the buffers used for communications servicing by the Ethernet Unit are administered in a buffer config-
uration called network memory. Network memory consists of 196K bytes of memory divided into short and long
buffers. The use of short and long buffers is determined by the status of the various services when the Ethernet
Unit is running. The capacity of all buffers cannot be used due to limits in the mounted memory capacity. The
status of the short and long buffers can be accessed by execution the FINS command MEMORY STATUS
READ (2763).
Note 1. The status of UDP and TCP socket reception request buffers can be accessed by executing the FINS
command SOCKET STATUS READ (2764).
2. The status of UDP and TCP socket send request buffers can be accessed by executing the FINS
command SOCKET STATUS READ (2764).
264
Appendix D
TCP Status Transitions
The TCP socket status can be confirmed using the socket status data returned for the FINS command
SOCKET STATUS READ (2764).
CLOSED
ACTIVE OPEN
snd SYN
Passive OPEN CLOSE
LISTEN
CLOSE
rcv SYN
SEND
snd SYN,ACK
snd SYN
265
Appendix E
Auxiliary Area Data
The following table and descriptions cover the words and bits in the Auxiliary Area of PC memory that are
related to the Ethernet Unit.
Read-only Bits/Words
Word(s) Bit(s) Name Function Settings
A202 A20200 to Communications Bits A20200 to A20207 turn ON when a network 0: Network communi-
A20207 Port Enabled Flags instruction (SEND, RECV, CMND, or PMCR) can be cations running
executed with the corresponding port number. Bits 1: No network com-
00 to 07 correspond to communications ports 0 to 7. munications running
A203 to --- Communications These words contain the completion codes for the 0000: No error
A210 Port Completion corresponding port numbers when network Not 0000: Error code
Codes instructions (SEND, RECV, CMND, or PMCR) have
been executed. Words A203 to A210 correspond to
communications ports 0 to 7.
A219 A21900 to Communications Bits A21900 to A21907 turn ON when an error 0: Normal end
A21907 Port Error Flags occurred during execution of a network instruction 1: Error end
(SEND, RECV, CMND, or PMCR). Bits 00 to 07
correspond to communications ports 0 to 7.
A302 A30200 to CPU Bus Unit Bits A30200 through A30215 turn ON while the 0: Not initializing
A30215 Initializing Flags corresponding CPU Bus Units (Units #0 through 1: Initializing (System
#15, respectively) are initializing. The bits will turn will automatically turn
ON either when power is turned ON or when a CPU the flag OFF when ini-
Bus Unit Restart Bit (A50100 to A50115) is turned tialization has been
ON. completed.)
A402 A40203 CPU Bus Unit Set- Bit A40203 is turned ON when the CPU Bus Units 0: No setting error
ting Error Flag actually installed differ from the Units registered in 1: Setting error
(Non-fatal error) the I/O table. The ERR/ALM indicator on the front of
the CPU Unit will flash, but CPU operation will
continue.
The unit number of the CPU Bus Unit involved is
stored in word A427.
A40207 CPU Bus Unit Error Bit A40207 is turned ON when an error occurs 0: No unit number
Flag during the transmission of data between the CPU error
(Non-fatal error) and CPU Bus Units. The ERR/ALM indicator on the 1: Unit number error
front of the CPU Unit will flash, but CPU operation
will continue. The Unit where the error occurred will
stop.
The unit number of the CPU Bus Unit involved is
stored in word A422.
A403 A40300 to Memory Error When a memory error occurs, the Memory Error 0: Normal
A40308 Location Flag (A40115) is turned ON and one of the following 1: Error
flags is turned ON to indicate the memory area
where the error occurred.
A40300: User program
A40304: PC Setup
A40305: Registered I/O Table
A40307: Routing Table
A40308: CPU Bus Unit Settings
The ERR/ALM indicator on the front of the CPU Unit
will light and CPU operation will stop.
267
Auxiliary Area Data Appendix E
Read/Write Bits
Word Bits Name Description Settings
A501 A50100 to CPU Bus Unit Bits A50100 through A50115 can be turned ON to OFF to ON:
A50115 Restart Bits reset CPU Bus Units number #0 through #15, Unit restarted.
respectively. Automatically turned
The Restart Bits are turned OFF automatically when OFF by system after
restarting is completed. restart processing
The CPU Bus Unit Initializing Flags (A30200 to has been completed.
A30215) will turn ON when initialization of the Units
begins and turn OFF when it is completed.
268
Appendix F
CPU Bus Unit Allocations in the CPU Unit
The CPU Bus Units, including Ethernet Units, are allocated words in the CPU Unit’s CIO Area and DM Area
according to the unit numbers. This appendix is provided for easy reference. For details, refer to Section 4 Sys-
tem Setup and Memory Allocations.
269
CPU Bus Unit Allocations in the CPU Unit Appendix F
Area Configuration
Offset
Bit
15 8 7 0 Data direction Related communications services
n Unit Control Switch CPU Unit to Ethernet Unit Socket Services
n+1 (Refer to Section 6
UDP Socket No. 1 Status
Socket Services.)
n+2 UDP Socket No. 2 Status
n+3 UDP Socket No. 3 Status Mail Function
(Refer to Section 8 Mail.)
n+4 UDP Socket No. 4 Status
n+5 UDP Socket No. 5 Status
n+6 UDP Socket No. 6 Status
n+7 UDP Socket No. 7 Status
n+8 UDP Socket No. 8 Status
n+9 TCP Socket No. 1 Status Ethernet Unit to CPU Unit Socket Services
n+10 (Refer to Section 6
TCP Socket No. 2 Status
Socket Services.)
n+11 TCP Socket No. 3 Status
n+12 TCP Socket No. 4 Status
n+13 TCP Socket No. 5 Status
n+14 TCP Socket No. 6 Status
n+15 TCP Socket No. 7 Status
n+16 TCP Socket No. 8 Status
n+17 Service Status FTP Service, etc.
n+18 Error Status All error conditions
n+19 Socket Service Re- Socket Service Re- CPU Unit to Ethernet Unit Socket Services
quest Switches 2 quest Switches 1 (Refer to Section 6
Socket Services.)
n+20 Socket Service Re- Socket Service Re-
quest Switches 4 quest Switches 3
Opening Flag
Receiving Flag
Results Storage Error Flag
Sending Flag
TCP/UDP Open Flag
Socket Closed Flag
270
CPU Bus Unit Allocations in the CPU Unit Appendix F
Bit 08: Internode test flag (OFF: Test stopped, ON: Test running)
Note A transceiver is built into the CS1W-ETN11 and CJ1W-ETN11. If this bit turns ON, the Ethernet Unit has
malfunctioned.
Socket Service Request Switches 1 to 8 (CPU Unit to Ethernet Unit)
15 14 13 12 11 10 9 8
7 6 5 4 3 2 1 0
n+19 to n+22
271
CPU Bus Unit Allocations in the CPU Unit Appendix F
DM Area Allocations
Each Unit is allocated 100 words in the DM Area, as shown in the following table.
Unit No. Allocated words Unit No. Allocated words
(decimal) (decimal)
0 (0) D30000 to D30099 8 (8) D30800 to D30899
1 (1) D30100 to D30199 9 (9) D30900 to D30999
2 (2) D30200 to D30299 A (10) D31000 to D31099
3 (3) D30300 to D30399 B (11) D31100 to D31199
4 (4) D30400 to D30499 C (12) D31200 to D31299
5 (5) D30500 to D30599 D (13) D31300 to D31399
6 (6) D30600 to D30699 E (14) D31400 to D31499
7 (7) D30700 to D30799 F (15) D31500 to D31599
Area Configuration
Offset
Bit
15 8 7 0
m Internode test remote network address and node number
m+1 Internode test number of send bytes
m+2 Internode test response monitoring time
m+3 Internode test status
m+4 Number of internode test runs
m+5 Number of internode test timeout errors
m+6 Number of internode test response errors
m+7 Number of internode test send errors
m+8 Number of times internode test data did not match
m+9 TCP socket No. 1 connection status
Internode Test Remote Network Address and Node Number (CPU Unit to Ethernet Unit)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m Remote network address Remote node number
272
CPU Bus Unit Allocations in the CPU Unit Appendix F
Timeout
Error code Response error
Send error
Data does not match
Routing table error
Send parameter error
Number of Times Internode Test Data Did Not Match (Ethernet Unit to CPU Unit)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+8 Number of data disagreement errors (0000 to FFFF)
273
CPU Bus Unit Allocations in the CPU Unit Appendix F
The set values of the Local IP Address Switches (rotary switches 1 to 8) on the back of the Ethernet Unit are
read and stored here when the power is turned ON or the Ethernet Unit is restarted. If an incorrect address is
set, 0000 (Hex) will be stored here and the ERC indicator will flash. (Refer to Setting the Local IP Address.)
IP Address Display/Setting Area (CJ Series)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m+98 (1) (2) (3) (4)
m+99 (5) (6) (7) (8)
274
CPU Bus Unit Allocations in the CPU Unit Appendix F
Note 1. If a value other than 00.00.00.00 is set as the local IP address in the CPU Bus Unit System Setup,
even if an IP address is set in the allocated words in the DM Area, it will be overwritten with the setting
in the CPU Bus Unit System Setup.
2. If no local IP address is set in either the CPU Bus Unit System Setup or the allocated words in the
DM Area (m+98 and m+99), the Ethernet Unit will not be able to perform communications. Be sure
to set the local IP address in one of these areas. It is not possible, however, to set the following IP
addresses. If any of these values are set, the ERH indicator will flash.
• IP addresses where all network number bits are 0.
• IP addresses where all host number bits are 0.
• IP addresses where all subnet number bits are 0.
• IP addresses starting with 127 (7F Hex), e.g., 127.35.21.16.
275
Appendix G
ASCII Characters
Bits 1 to 4 Bits 5 to 7
Binary 0000 0001 0010 0011 0100 0101 0110 0111
Hex 0 1 2 3 4 5 6 7
0000 0 NUL DLE Space 0 @ P p
0001 1 SOH DC1 ! 1 A Q a q
0010 2 STX DC2 ” 2 B R b r
0011 3 ETX DC3 # 3 C S c s
0100 4 EOT DC4 $ 4 D T d t
0101 5 ENQ NAK % 5 E U e u
0110 6 ACK SYN & 6 F V f v
0111 7 BEL ETB ’ 7 G W g w
1000 8 BS CAN ( 8 H X h x
1001 9 HT EM ) 9 I Y i y
1010 A LF SUB * : J Z j z
1011 B VT ESC + ; K [ k {
1100 C FF FS , < L \ l |
1101 D CR GS - = M ] m }
1110 E SO RS . > N ^ n ~
1111 F SI US / ? O _ o DEL
277
Appendix H
Dimensions
CS1W-ETN01
279
Dimensions Appendix H
CS1W-ETN11
Unit: mm
280
Dimensions Appendix H
CJ1W-ETN11
31 65
2.7 ETN11
RUN ERC SD RD
345 UNIT
EF012
6789
ABCD No.
345 NODE
EF012
6789
ABCD No.
x161
345
EF012
6789
ABCD
x160
90
ETHERNET
2.7
Unit: mm
281
Appendix I
Maintenance
The Ethernet Unit makes up part of a network. Repair a defective Ethernet Unit as soon as possible as it can
have a negative effect on the entire network. We recommend that customers keep one or more spare Ethernet
Units to allow immediate recovery of the network.
283
Appendix J
Inspections
Carry out regular inspections to ensure the Ethernet Unit is functioning perfectly.
Items
Most of the parts that make up an Ethernet Unit are semiconductor components. None of the parts in the Unit
will wear out after a specific lifetime, but some parts may deteriorate due to extreme operating condition.
Therefore, it is important to inspect the Unit regularly.
Inspection Interval
Normally inspect once or twice per year. Choose the inspection period according to the severity of the operat-
ing conditions. New installation should be inspected more frequently until they are judged to be stable.
Inspection Items
Correct any of the items in the table below not conforming to the specified standard.
Item Details Standard
Environment Temperature around Unit 0 to 55°C
Humidity around Unit 10% to 90% (with no condensation)
Accumulated dust No accumulated dust
Mounting Ethernet Unit firmly attached No looseness
Transceiver cable connector fully pushed in No looseness
Condition of transceiver cable No visible abnormality
Twisted-pair cable connector fully pushed in No looseness
Condition of twisted-pair cable No visible abnormality
Standard Tools
• Flat-blade and Phillips screwdrivers
• Tester or digital voltmeter
• Industrial alcohol and a clean cloth
285
Index
FINS commands, 214
Numbers FTP commands, 168
10BASE-T communications
conversion adapters, 5 FINS, 16
twisted-pair cables, 5 FTP server, 16, 21
24-VDC power supply, 4 mail, 16, 21
connecting, 42 setting, 64
recommended products, 251 See also ARP communications
See also Ethernet communications
A See also FINS communications
See also ICMP communications
Address Resolution Protocol See also IP communications
See also ARP communications See also SMTP communications
addresses See also TCP communications
remote addresses, 96 See also UDP communications
ARP communications, 10 selecting, 18
socket services, 16, 19
ASCII characters, 277
testing, 186
B connections
troubleshooting, 203
bits connectors
addresses, 216, 267 pin layout, 39
error status, 71 Contact Output Units
power status, 70 installation, 258
Socket Service Request Switches, 122 interference with Ethernet, 258
Unit control switches, 68 precautions, 258
BROADCAST DATA SEND, 221 CONTROLLER DATA READ, 218
broadcast test CONTROLLER STATUS READ, 219
command, 221 CPU Bus Units
reading results, 221 flags, 267
BROADCAST TEST RESULTS READ, 221 Restart Bits, 268
buffers, 245, 261 System Setup, 51, 59
configuration, 263 current consumption, 7, 8
bye, 171 CX-Net, 45
CX-Programmer, 6, 45
C creating routing tables, 48
settings, 60
cables System Setup, 51
10BASE-T twisted-pair cables, 5
attaching transceivers, 252
coaxial, 5, 40 D
connections, 40 DA1, 98
installing outdoors, 251
DA2, 99
transceiver, 4
data areas
cd, 170
FINS communications, 216
CIO Area, 58
delete, 171
allocations, 67, 269
dimensions, 7, 8, 279
close, 171
dir, 169
CMND(490) instruction, 20, 81
DM Area, 58
requesting socket services, 104, 139
allocations, 73, 272
coaxial cables, 5
DNA, 98
installation precautions, 251
Terminators, 5
commands
287
Index
E F
EC Directives, xvii Factory Interface Network Service
echoback test, 186 See also FINS communications
EM File Memory, 163 File Transfer Protocol
EMC Directives, xvii See also FTP server
288
Index
289
Index
L-M O-P
lightning open, 169
optical Ethernet Systems, 257 optical Ethernet Systems, 256
Low Voltage Directives, xvii P/S indicator, 32
ls, 169 PC errors
mail, 17, 21 indicator, 32
application example, 182 PING, 53, 186, 236
contents, 179 comparison with internode test, 53
error mail, 180 echo test, 186
functions, 178 port numbers
periodic mail, 180 sockets, 105
sending, 180, 182 TCP port, 116
settings, 64 remote device, 117
status, 76, 181 UDP port, 116
triggers, 180 reading from Unit, 218
troubleshooting, 205 remote device, 117
user mail, 180
power supply, 7
main response code, 214
precautions
See also MRES
applications, xv
maintenance, 283 Contact Output Units, 258
mdelete, 171 EC Directives, xvii
memory areas environmental, 252
See alsodata areas general, xiv, 14
Memory Cards, 162 grounding, 251, 252
deleting files, 171 IEEE802.3 standards, 14, 39
displaying directories, 169 inductive voltages, 252
See also FTP server inspections, 285
transferring files from host, 171 installation, 14, 37, 38, 251
transferring files to host, 170, 171 coaxial cables, 251
MEMORY STATUS READ, 245 IP communications, 80
ISO 8802-3 standards, 39
mget, 170
operating environment, xv
mode settings replacing Units, 283
reading from Unit, 218 safety, xiv, 39
mounting Socket Service Request Switches, 112
Racks, 37, 38 socket services, 111
mput, 171 TCP communications, 108
MRES, 215 Terminators, 252
transceiver cables, 252
transceivers, 252
N UDP communications, 80, 109
networks wiring, 40, 41
network memory, 245, 264 Programming Console, 45
network numbers, 12 Programming Devices, 6
size, 12 connecting, 45
troubleshooting, 203 CX-Net, 45
node numbers CX-Programmer, 45, 51
converting to IP addresses, 63 Programming Console, 45
error indicator, 32 programs
setting, 34, 36 examples, 99
noise PROTOCOL STATUS READ, 241
Contact Output Units, 258
protocols
reduction, 254, 256
Address Resolution Protocol, 10
290
Index
291
Index
292
Revision History
A manual revision code appears as a suffix to the catalog number on the front cover of the manual.
Revision code
The following table outlines the changes made to the manual during each revision. Page numbers refer to the
previous version.
Revision code Date Revised content
1 February 1999 Original production
2 November 2000 CS1W-ETN11 (10Base-T) Ethernet Unit added.
Pages xi, 2 to 7, 10, 22 to 24, 27 to 31, 53 to 55, 171, 181, 194, 195, 223, 227,
229, 230, 241, 247, and 251: Information on CS1W-ETN11 added.
Page 2: Parenthetic information added under FINS Message Communications.
Page 6: Data given in “G” units removed from table.
Page 21: Minor changes made to first note.
Page 22: Minor changes in wording made to points 8 and 9.
Page 27: Note at bottom of page removed.
Page 32: Information about Programming Devices added.
Page 35: Information on CX-Programmer and CX-Net made.
Pages 38, 39, 50, 51, 52, 64, 141, and 151: Minor changes made to wording of
information on CX-Programmer.
Page 40: Information on startup tests added.
Pages 76, 77, and 78: Minor changes made to mathematical notation.
Page 83: References added in 2 places.
Page 92: Minor changes and additions made in several places.
Page 104: Wording of last 2 paragraphs changed.
Page 160: Information on mail send functions added.
3 May 2001 Information related to the CJ1W-ETN11 added throughout the manual. In addi-
tion, the following changes were made.
Page 22: Information on address conversion methods added.
Page 33: Text and graphic added to information on twisted-pair cable. Title
added to bottom graphic.
Page 43: Reference added.
Page 44: Minor change made to text at bottom of page.
Pages 48, 56, 249, 177: Changes made to graphics.
Page 52: Correction made to text.
Pages 102, 104, 146, 147, 149, 177: Changes made to tables.
Page 157: Change made to text in graphic.
Page 172: Information on internode test added.
Page 192: Minor change made to information on environment error.
Page 217: Minor change made to information on destination IP address.
Page 218: Minor change made to information on FINS node number and IP
address.
Page 252: Minor change made to wording of last paragraph.
Page 253: Subscript characters changed to standard characters in 4 places.
293
Revision History
294
OMRON CORPORATION
FA Systems Division H.Q.
66 Matsumoto
Mishima-city, Shizuoka 411-8511
Japan
Tel: (81)55-977-9181/Fax: (81)55-977-9045
Regional Headquarters
OMRON EUROPE B.V.
Wegalaan 67-69, NL-2132 JD Hoofddorp
The Netherlands
Tel: (31)2356-81-300/Fax: (31)2356-81-388
OMRON ELECTRONICS LLC
1 East Commerce Drive, Schaumburg, IL 60173
U.S.A.
Tel: (1)847-843-7900/Fax: (1)847-843-8568
OMRON ASIA PACIFIC PTE. LTD.
83 Clemenceau Avenue,
#11-01, UE Square,
Singapore 239920
Tel: (65)6835-3011/Fax: (65)6835-2711
Authorized Distributor:
Cat. No. W343-E1-05 Note: Specifications subject to change without notice Printed in Japan
Cat. No. W343-E1-05 CS/CJ Series CS1W-ETN01/CS1W-ETN11/CJ1W-ETN11 Ethernet Units OPERATION MANUAL