0% found this document useful (0 votes)
49 views70 pages

90210-1190DEC - CD - TCPIP Communication Manual

The Kawasaki Robot TCP/IP Communication Manual provides detailed instructions for using the Ethernet-connected TCP/IP communication function with the D Series Controller. It covers various topics including network configuration, setting IP addresses, and using the KCwinTCP remote terminal function. The manual emphasizes the importance of understanding safety protocols and proper operation procedures to prevent accidents and ensure effective communication with the robot system.

Uploaded by

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

90210-1190DEC - CD - TCPIP Communication Manual

The Kawasaki Robot TCP/IP Communication Manual provides detailed instructions for using the Ethernet-connected TCP/IP communication function with the D Series Controller. It covers various topics including network configuration, setting IP addresses, and using the KCwinTCP remote terminal function. The manual emphasizes the importance of understanding safety protocols and proper operation procedures to prevent accidents and ensure effective communication with the robot system.

Uploaded by

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

Kawasaki Robot Controller

D Series

TCP/IP
Communication
Manual

Kawasaki Heavy Industries, Ltd.

90210-1190DEC
D Series Controller
Kawasaki Robot TCP/IP Communication Manual

PREFACE

This manual gives instructions for using the 10BASE-T/100BASE-TX Ethernet-connected


TCP/IP communication function with the D Series Controller.

This manual provides as much detailed information as possible on the standard operating methods
for using this function. However, not every possible operation, condition or situation that should
be avoided can be described in full. Therefore, should any unexplained questions or problems
arise during robot operation, please contact Kawasaki Machine Systems. Refer to the contact
information listed on the rear cover of this manual for the nearest Kawasaki Machine Systems
office.

Read the D Controller Basic Manuals (including safety manual), delivered with the robot, without
fail together with this manual. Do not perform any procedure described herein until the contents
of this manual are fully understood.

1. This manual does not constitute a guarantee of the systems in which the robot is utilized.
Accordingly, Kawasaki is not responsible for any accidents, damages, and/or problems
relating to industrial property rights as a result of using the system.
2. It is recommended that all personnel assigned for activation of operation, teaching,
maintenance or inspection of the robot attend the necessary education/training course(s)
prepared by Kawasaki, before assuming their responsibilities.
3. Kawasaki reserves the right to change, revise, or update this manual without prior notice.
4. This manual may not, in whole or in part, be reprinted or copied without the prior written
consent of Kawasaki.
5. Store this manual with care and keep it available for use at any time. If the robot is
reinstalled or moved to a different site or sold off to a different user, attach this manual to the
robot without fail. In the event the manual is lost or damaged severely, contact Kawasaki.
All rights reserved. Copyright © 2008 Kawasaki Heavy Industries Ltd.

1
D Series Controller
Kawasaki Robot TCP/IP Communication Manual

SYMBOLS

The items that require special attention in this manual are designated with the following symbols.

Ensure proper and safe operation of the robot and prevent physical injury or property damage by
complying with the safety matters given in the boxes with these symbols.

! DANGER

Failure to comply with indicated matters can result in


imminent injury or death.

! WARNING

Failure to comply with indicated matters may possibly lead


to injury or death.

! CAUTION
Failure to comply with indicated matters may lead to
physical injury and/or mechanical damage.

[ NOTE ]

Denotes precautions regarding robot specification,


handling, teaching, operation and maintenance.

! WARNING
1. The accuracy and effectiveness of the diagrams, procedures, and detail
explanations given in this manual cannot be confirmed with absolute
certainty. Should any unexplained questions or problems arise, please
contact Kawasaki Machine Systems.
2. Safety related contents described in this manual apply to each individual
work and not to all robot work. In order to perform every work in safety,
read and fully understand the safety manual, all pertinent laws, regulations
and related materials as well as all the safety explanation described in each
chapter, and prepare safety measures suitable for actual work.

2
D Series Controller
Kawasaki Robot TCP/IP Communication Manual

CONTENT

Preface·············································································································································· 1

Symbols············································································································································ 2

1.0 Overview of Ethernet-connected TCP/IP Communication ················································· 5


1.1 Remote Terminal Function··································································································· 5
1.2 Socket Communication Function························································································· 5
1.2.1 TCP Communication Instructions························································································ 6
1.2.2 UDP Communication Instructions······················································································· 7
1.3 Support Specifications for TCP/IP Communication··························································· 8
1.4 File Transfer Function·········································································································· 8

2.0 Ethernet Network Configuration and Connection with Robot Controller··························· 9


2.1 Direct Connection without Hub··························································································· 9
2.2 Network Connection with Hub ··························································································10

3.0 Setting IP Address and Confirming Connection································································ 11


3.1 Setting IP Address and Subnet Mask ················································································· 11
3.2 Checking Connection to the Network················································································13

4.0 Using KCwinTCP Remote Terminal FUnction·································································15


4.1 What is KCwinTCP? ········································································································15
4.2 System Requirements for KCwinTCP··············································································15
4.3 Installing KCwinTCP and Registering Robot IP Address ·················································16
4.4 Operating KCwinTCP········································································································17
4.4.1 Daily Operations ················································································································ 17
4.4.2 Menu ·································································································································· 19
4.4.2.1 File(F)································································································································· 19
4.4.2.2 Com(munication) (C)········································································································· 20
4.4.2.3 View (V)····························································································································· 22
4.4.2.4 Help (H) ····························································································································· 22
4.4.3 Vertical/ Horizontal Scroll Bar··························································································· 22
4.4.4 Title Display······················································································································· 22
4.5 Notes and Restrictions in Using KCwinTCP····································································· 23
4.6 To Avoid Saving/Loading of Mistaken Robot Data···························································24

3
D Series Controller
Kawasaki Robot TCP/IP Communication Manual

5.0 Data Communication Instructions in UDP ········································································26


5.1 Communication Errors in UDP_SENDTO and UDP_RECVFROM ·······························31

6.0 Data Communication Instructions in TCP·········································································32


6.1 Communication Errors in Socket Communication····························································47
6.2 Sample Program Using Socket Communication Instructions ··········································· 49
6.2.1 When Robot is the Server-Side·························································································· 49
6.2.2 When Robot is the Client-Side ·························································································· 52

7.0 Save/Load Files using FTP Client Function ······································································54


7.1 Software Settings ···············································································································55
7.1.1 Settings on the robot controller·························································································· 55
7.1.2 Settings on Remote Host···································································································· 55
7.2 FTP auxiliary functions······································································································57
7.2.1 Aux. 0201 Save·················································································································· 57
7.2.2 Aux. 0202 Load ················································································································· 59
7.2.3 Aux. 0203 File configuration····························································································· 60
7.2.4 Aux. 0205 Delete file ········································································································· 61
7.2.5 Aux. 0206 Rename file ······································································································ 62
7.2.6 Aux. 0210 Autosave configuration ···················································································· 62
7.3 Communication Error codes which occur with the ftp client function······························65

8.0 Error Message ····················································································································66

4
D Series Controller 1. Overview of Ethernet-connected TCP/IP Communication
Kawasaki Robot TCP/IP Communication Manual

1.0 OVERVIEW OF ETHERNET-CONNECTED TCP/IP COMMUNICATION

To use the functions below, create an Ethernet network as shown in the diagram below by
connecting Ethernet port on main CPU board with external devices (e.g. PC) using
10BASE-T/100BASE-TX cable.

Controller Controller

PC

Hub

・Remote terminal function


・Socket communication function

1.1 REMOTE TERMINAL FUNCTION

By installing KCwinTCP, software provided by Kawasaki, in a Windows computer, operations


such as entering AS monitor commands from PC are made possible via Ethernet-connected
TCP/IP communication in addition to the RS232C communication (standard feature).

1.2 SOCKET COMMUNICATION FUNCTION

This communication function provides commands based on socket interface in TCP/IP


communication enabling data communication between robot controller and other devices.

Two types of communication instructions are provided:


1. TCP communication instructions
2. UDP communication instructions
In TCP communication, data is automatically re-sent when communication errors occur. It is
used in applications where certainty of the communication is important. In UDP
communication, data is not re-sent after an error. It is used when speed is important.

5
D Series Controller 1. Overview of Ethernet-connected TCP/IP Communication
Kawasaki Robot TCP/IP Communication Manual

1.2.1 TCP COMMUNICATION INSTRUCTIONS

Available TCP communication instructions:


・TCP_LISTEN Creates socket and waits for connection requests
・TCP_ACCEPT Checks if connection request is received
・TCP_CONNECT Creates a socket and sends connection request
・TCP_SEND Sends data string
・TCP_RECV Receives data string
・TCP_CLOSE Aborts socket communication
・TCP_END_LISTEN Ends waiting for connection request

Example: Robot as server

Robot Controller Personal Computer


AS Application program Process

Connect Connect
TCP_LISTEN TCP/IP TCP/IP socket()
connect()
TCP_ACCEPT

Ethernet Network
Send/receive data Send/receive data
TCP_RECV send()
TCP_SEND recv()

Disconnect Disconnect
TCP_CLOSE sockclose()
TCP_END_LISTEN

6
D Series Controller 1. Overview of Ethernet-connected TCP/IP Communication
Kawasaki Robot TCP/IP Communication Manual

Example: Robot as client

Robot Controller Personal Computer


AS Application Program

Connect
TCP/IP TCP/IP socket()
Connect blind()
TCP_CONNECT listen()
accept()
Send/receive data Ethernet network Send/receive data
TCP_ SEND recv()
TCP_ RECV send()

Disconnect Disconnect
TCP_CLOSE sockclose()

1.2.2 UDP COMMUNICATION INSTRUCTIONS

There are two UDP communication instructions: UDP_SENDTO (sends data) and
UDP_RECVFROM (receives data).
Personal Computer
Robot Controller
Process
AS Application Program

Send data
Receive data
sendto()
UDP_RECVFROM
UDP/IP UDP/IP

Ethernet network

UDP_SENDTO
recv_from()

7
D Series Controller 1. Overview of Ethernet-connected TCP/IP Communication
Kawasaki Robot TCP/IP Communication Manual

1.3 SUPPORT SPECIFICATIONS FOR TCP/IP COMMUNICATION

1. 10BASE-T/100BASE-TX Ethernet
2. Network connection transmission rate: 10Mbps/100Mbps
3. Connected using RJ045 Connector
4. Protocols: IP, ARP, RARP, ICMP, TCP, UDP, TELNET (Server)

1.4 FILE TRANSFER FUNCTION

The robot controller is equipped with FTP client function so that saving/loading can be done
for all types of data: robot, program, auxiliary data, error logs and all the data by using
(TCP/IP) communication in same way as a PC card. Operation is performed by auxiliary
function on teach pendant.

PC
Robot Controller Robot Controller
(R/C) (R/C)

Ethernet Ethernet
Cable Cable

Ethernet
Cable

Hub

File transfer
File transfer

i.e)
-AS taught data is saved from R/C to the server through LAN by instructions from R/C.
-AS taught data is loaded from the server through LAN to R/C by instructions from R/C.

8
D Series Controller 2. Ethernet Network Configuration and
Kawasaki Robot TCP/IP Communication Manual Connection with Robot Controller

2.0 ETHERNET NETWORK CONFIGURATION AND CONNECTION WITH ROBOT


CONTROLLER

This section explains how an Ethernet network is created using an example of connecting a PC
(external computer) with a robot controller.

The PC can be connected with the robot controller in two ways:


1. Connection of one computer to one controller without using a hub
2. Connection of two or more computer systems (including robot controllers) using Ethernet
via a hub.

2.1 DIRECT CONNECTION WITHOUT HUB

This diagram shows connection without hub.


Controller
PC

Ethernet
Cross cable

1KN/1QN Board
Ethernet (Ethernet Board:
Interface Board RJ45Connector need only for 1KA board.)
Main CPU Board
(1KA/1RA Board)

In this case, use Ethernet cross cable for connecting.

9
D Series Controller 2. Ethernet Network Configuration and
Kawasaki Robot TCP/IP Communication Manual Connection with Robot Controller

2.2 NETWORK CONNECTION WITH HUB

This diagram shows the Ethernet network using a hub for 10BASE-T/100BASE-TX
connection.

Transceiver Connect if
Ethernet cable necessary

Hub

Ethernet
Straight Cable

PC
To other robot controller, etc. Controller

In this case, use Ethernet straight cable for connection.

10
D Series Controller 3. Setting IP Address and Confirming Connection
Kawasaki Robot TCP/IP Communication Manual

3.0 SETTING IP ADDRESS AND CONFIRMING CONNECTION

To set the IP address and confirm connection, the robot controller and a Windows-based PC
have to be connected to the network. After connecting the hardware, an IP address for the
robot controller must be set on the network in order to use the TCP/IP communication
function.

3.1 SETTING IP ADDRESS AND SUBNET MASK

Register the IP address and the subnet mask for the controller before using the TCP/IP
communication function.

To set the IP address and subnet mask, execute NETCONF monitor command via teach
pendant or a KCwin/ KCwinTCP remote terminal screen on a RS232C-connected PC.

Example
>NETCONF ↵
IP address = 192.168.0.2
Change?(If not, press RETURN only)
123.123.123.123 ↵

IP address = 123.123.123.123
Change?(If not, press RETURN only) ↵

Host name =
Change?(If not, press RETURN only)
KAWASAKI ↵

Host name = KAWASAKI


Change?(If not, press RETURN only) ↵

Subnet mask = 255.255.240.0


Change?(If not, press RETURN only)
255.255.255.0 ↵

Subnet mask= 255.255.255.0


Change?(If not, press RETURN only) ↵

Gateway IP = 0.0.0.0

11
D Series Controller 3. Setting IP Address and Confirming Connection
Kawasaki Robot TCP/IP Communication Manual

Change?(If not, press RETURN only)


255.255.255.0 ↵

Gateway IP = 255.255.255.0
Change?(If not, press RETURN only) ↵

DNS server 1 IP = 0.0.0.0


Change?(If not, press RETURN only)
123.123.123.1 ↵

DNS server 1 IP = 123.123.123.1


Change?(If not, press RETURN only) ↵

DNS server 2 IP = 0.0.0.0


Change?(If not, press RETURN only)
123.123.123.2 ↵

DNS server 2 IP = 123.123.123.2


Change?(If not, press RETURN only) ↵

Domain name =
Change?(If not, press RETURN only)
kawasaki_robot ↵

Domain name = kawasaki_robot


Change?(If not, press RETURN only) ↵

MAC address = 00:09:0f:00:ff:01


(W1018)Turn control power ON/OFF to change network setting.
>

IP address can be set via teach pendant. See the Operation Manual for setting the IP address
via TP (Auxiliary function 0812 Network Setting).

After registering the IP address, reboot the robot controller by turning control power OFF →
ON.

12
D Series Controller 3. Setting IP Address and Confirming Connection
Kawasaki Robot TCP/IP Communication Manual

3.2 CHECKING CONNECTION TO THE NETWORK

Once the robot controller Ethernet-connected interface is opened and properly started, connect
a Windows PC to the same network and confirm the connection using the ping command in
MS-DOS Prompt screen. Before checking with ping command, the Windows PC needs to be
set for Ethernet connection (register IP address and subnet mask) and rebooted.
1. Open MS-DOS Prompt screen in a Windows PC.
2. In MS-DOS Prompt screen, enter:

>ping IP_address

IP_address is the IP address of the robot controller to be connected. If the connection is


functioning properly, the following message appears.

Example C:>ping 001.002.003.004


Pinging 001.002.003.004 with 32 bytes of data:
Reply from 001.002.003.004: bytes=32 time=53ms TTL=64
Reply from 001.002.003.004: bytes=32 time=5ms TTL=64
Reply from 001.002.003.004: bytes=32 time=24ms TTL=64
Reply from 001.002.003.004: bytes=32 time=11ms TTL=64
Ping statistics for 001.002.003.004:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 53ms, Average = 23ms

If the connection is not properly established, error messages such as timeout error will be
displayed.

Example C:>ping 001.002.003.005


Pinging 001.002.003.005 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 001.002.003.005:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

13
D Series Controller 3. Setting IP Address and Confirming Connection
Kawasaki Robot TCP/IP Communication Manual

This error can occur due to following causes. Check and correct the error and retry until
connection is successful.

1. The power for hub is not ON.


2. The network cable connector is faulty or not connected correctly.
3. Incorrect cable is used.
4. IP address setting for the robot is not correct.

Generally, there are LEDs on the hub or Ethernet connection interface devices. The signal
status can be checked by these LEDs. Use this information for troubleshooting when
connection does not succeed.

14
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

4.0 USING KCWINTCP REMOTE TERMINAL FUNCTION

While KCwin has only RS232C terminal function, this also has Ethernet-connected remote
terminal function. When installed on Windows PC, this software allows remote operation of
robots from PC. But robot controller to be used needs to be specified by IP address before the
terminal operation. When the robot is successfully connected, terminal operations such as
entering monitor commands are possible. After the necessary operations are finished, end the
connection using the designated instructions.

Three PCs can be connected to one controller at a time. On the other hand, when a controller
is connected to three PCs, remote terminal operations from other PC are not possible until that
connection is terminated.

Instructions for operating the KCwinTCP remote terminal function are explained below.

4.1 WHAT IS KCWINTCP?

KCwinTCP is terminal software for the Kawasaki robot controller. When a PC is installed
with this software and connected to controller by Ethernet connection, the following operations
are possible by TCP/IP communication.

・AS monitor command input from PC


・Saving/loading controller memory contents to/from PC etc.

4.2 SYSTEM REQUIREMENTS FOR KCWINTCP

Hardware PC with CPU of 80486 or more, and operating with Microsoft Windows

OS Microsoft Windows 95/98/NT4.0/2000/XP

Confirmed Toshiba PC Dynabook Satellite 2520 (Windows98)


operation Compaq Armada 1500C (Windows98)
models* IBM ThinkPad 365X (Windows95)
NOTE* Kawasaki is not responsible for use of KCwinTCP on unconfirmed hardware/OS.

15
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

4.3 INSTALLING KCWINTCP AND REGISTERING ROBOT IP ADDRESS

Install (copy) KCwinTCP provided by Kawasaki into the desired directory of your Windows
PC. After installing, double-click on the KCwinTCP icon. The window below appears.

Register the robot controllers to be connected. Select [Com]→[Options] from the menu bar.

In the window that appears, enter the IP address and the name for the robot controllers on the
network and click <OK>.

16
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

4.4 OPERATING KCWINTCP

4.4.1 DAILY OPERATIONS

1. Turn ON the controller. Do not initialize the controller. TELNET server function starts
and the controller is now waiting for connection from client PC.

2. Start KCwinTCP
Double-click on the KCwinTCP icon. KCwinTCP starts and a window appears. In this
window, select [Com] → [Sel Connection (E)] from the menu bar.

Select the IP address of the robot to be connected using the cursor keys. Click <OK>.

PC tries to connect with the specified IP address. When the connection is successfully
established, login: appears following several other messages. Enter “as” after this message,
and the robot will return a prompt.

17
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

Now, AS monitor commands can be entered from the PC.

When uploading or downloading teach data between PC and controller, enter SAVE/LOAD
monitor commands the same as in AS terminal.

・When executing SAVE command When executing LOAD command

After all operations are finished, abort the connection. Select [Communication] →
[Disconnect] from the menu bar.

18
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

4.4.2 MENU

4.4.2.1 FILE(F)

Open log file(O)

To save the characters displayed on screen as a log file, specify a file as above. (Default for
extension log files is .log)

Close log file(C)


Ends logging.

Exit(X)
Terminates KCwinTCP.

19
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

4.4.2.2 COM(MUNICATION) (C)

Connect(C)
Establishes connection with the robot whose IP address and port number were last used.

Sel(ect) Connect(ion)(E)

The IP addresses and names registered in [Options (O)] are displayed in a list. Select the IP
address and name of the robot to be connected and click <OK> to establish connection with
that robot.

IP address
Displays the selected IP address.

Name
Displays the selected name (nickname).

<OK>
Connects with the selected IP address.

<Cancel>
Terminates without making any connections.

Disconnect (D)
Terminates connection.

20
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

Options (O)
Registers the IP address and names of the robots on the network. Maximum of 256 robots
can be registered.

IP address
Enter the IP address of the robot to be connected.

Name
Enter the name (nickname) of the robot to be connected.

<Add>
Adds the content input in the IP address and name.

<Insert>
Inserts the content input in IP address and name where the cursor is.

<Edit>
Overwrites the selected IP address and name with new contents.

<Delete>
Deletes the selected IP address and name from the list.

<OK>
Overwrites contents and puts in effects all changes made to KCWINTCP.INI and terminates
the Option screen.

21
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

<Cancel>
Terminates the screen without saving the changed contents. (KCWINTCP.INI is not
overwritten.)

4.4.2.3 VIEW (V)

Font (F)
Selects the font of the characters used on the screen.

SCREEN (W)
Sets the number of scroll buffers, colors of the screen and text.

4.4.2.4 HELP (H)

Contents (C)
Opens the table of contents for KCwinTCP operation instructions.

About KCwin (A)


Displays KCwinTCP version information.

4.4.3 VERTICAL/ HORIZONTAL SCROLL BAR

The vertical scroll bar appears when the data exceeds the number of rows in the screen.
Maximum of 200 rows can be displayed using the scroll bar.

4.4.4 TITLE DISPLAY

The following information is shown on the title bar.

22
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

Example

[192.168.29.128: econ]
The current client is shown in the format [client IP address: name]. When no connection is
established, nothing is displayed here.

[C:¥KCWINTCP]
If only the file name is specified in AS language LOAD/SAVE command, the data will be
saved/ loaded to/ from this directory.

[Logging]
This is displayed while the screen data is being saved to the log file.

4.5 NOTES AND RESTRICTIONS IN USING KCWINTCP

When connection is aborted during an execution of a monitor command, that command (e.g.
EDIT) should first be terminated in the robot controller using ABORT.

Do not disconnect from the KCwinTCP side until the command has been executed. If you
have disconnected by mistake, immediately re-connect and check if that command was
executed properly.

When the connection is aborted from the robot side (i.e. the OS displays a disconnection
message), KCwinTCP automatically cuts off connection. If it does not cut off automatically,
manually disconnect KCwinTCP.

AS commands FDIRECTORY, FDELETE, FORMAT are not supported in KCwinTCP (Use


Windows Explorer to perform such operations.)

23
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

4.6 TO AVOID SAVING/LOADING OF MISTAKEN ROBOT DATA

Because more than one robot is connected to the network, there is the chance that a wrong
robot data may be loaded to the robot. Also, data from a wrong robot may overwrite a saved
file.

To avoid this, KCwinTCP checks if the data is correct before loading.

At the beginning of the data, the IP address data is stored when saving the file. (See line
starting with .NETCONF below).

.***************************************************************************
.*=== AS GROUP === : AS_01000107 2003/01/23 12:05
.*USER IF AS : UAS01000107 2003/01/23 12:01
.*USER IF TP : UTP01000107 2003/01/23 12:02
.*ARM CONTROL AS : AAS01000107 2003/01/22 17:47
.*USER IF AS MESSAGE FILE : MAS000107EN 2003/01/22 16:41
.*USER IF TP MESSAGE FILE : MTP000107EN 2003/01/22 16:42
.*ARM DATA FILE : ARM01000107 2003/01/22 16:16
.*USER IF IPL : UIP01190000 2002/12/25
.*ARM CONTROL IPL : AIP01170000 2003/01/09
.*=== SERVO GROUP === : SV_02000005 2003/02/05 17:24
.*ARM CONTROL SERVO : ASV010000-1 2003/02/04 12:03
.*SRV DATA FILE : ASP010000-1 2003/01/29 09:10
.*ARM CONTROL SERVO CONT. : ARMSH Ver1.2.3 Dec-05-2001 ZX165U ; (shi
.* [Shipment setting data]
.*There is no Shipment setting data.
.***************************************************************************
.NETCONF
123.123.123.123,"KAWASAKI",255.255.255.0,255.255.255.0,123.123.123.1,123.123.123.2,"kawasaki
_robot"
.ROBOTDATA1
ZROBOT.TYPE 10 11 6 1 -421 FS010N-A001 ( 2003-02-06 14:36 )
ZSYSTEM 1 5 1 -106
ZLINEAR 0 0 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
179
CONT_CODE 701 -10516
ZZERO 268435456 268435456 268435456 268435456 268435456 268435456 268435456
268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456
268435456 268435456 268435456 536870911

24
D Series Controller 4. Using KCwinTCP Remote Terminal Function
Kawasaki Robot TCP/IP Communication Manual

KCwinTCP checks if the IP address in the line beginning with .NETCONF is the same as the
IP address of the controller. If they are not the same, KCwinTCP asks whether loading
should be continued or not. Check if the data is correct and enter 9 to continue, and 0 to
terminate.

25
D Series Controller 5. Data Communication Instructions in UDP
Kawasaki Robot TCP/IP Communication Manual

5.0 DATA COMMUNICATION INSTRUCTIONS IN UDP

The following instructions enable data communication between robot controller and computer
system via Ethernet UDP/IP.

UDP_SENDTO .........Program Instruction to send data


Sends the specified character string data based on UDP/IP. This instruction creates socket,
sends data and closes the socket in one sequence.

UDP_RECVFROM ........Program Instruction to receive data


Receives and stores data in the specified character string array based on UDP/IP. This
instruction creates socket, receives data and closes the socket in one sequence.

Example

Keyword Parameter

UDP_SENDTO variable for returned value, IP address array variable, …

Parameters marked with can be omitted.

Always enter a space between the keyword and the first parameter.

↵ represents the Enter (Return) key in the examples.

26
D Series Controller 5. Data Communication Instructions in UDP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
UDP_SENDTO variable for returned value, IP address array variable,
port number, character string variable array for sending data,
number of elements, timeout

Function
Sends data string based on UDP protocol. The data to be sent is specified in a character string
variable array. This instruction creates socket, sends data and closes socket in one sequence.
If communication error occurs, the error code is stored in the returned value storage variable.
However, program execution does not stop.

Parameter
Variable for returned value
· Specifies variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 5.1 for details on communication error codes.

IP address array variable


· Specifies the first element of the array variable storing the IP address of the destination
computer system. The IP address is stored in 8 bits increments to each element of the array
variable.
· Data beyond 0 - 255 is regarded as error. The first data must be between 0 - 247, if not an
error occurs.

Port number
· Specifies the port number that indicates the channel of the other end of the connection
(process). The socket is bound to this port number.
· Acceptable range is 8192 - 65535, otherwise error occurs.

Character string variable array for sending data


· Specifies the first element of the character string array that stores the data to be sent.
· Array elements are sent in order from first to last.
· Change the data to be sent into character string format. Numeric data can be sent once
transformed into character string format. Ensure the encoding format is consistent with that
in the recipient (big endian/little endian, etc.).

27
D Series Controller 5. Data Communication Instructions in UDP
Kawasaki Robot TCP/IP Communication Manual

· The maximum amount of data that can be sent in execution of one instruction is 1472 bytes.

Number of elements
· Specifies the number of elements to send in the character string variable array.
· These array elements are sent to the recipient in order of index number.

Timeout
· Specifies the time (seconds) to wait before outputting timeout error when connection is not
established. Default is 1 second.
· When a timeout error occurs, the error code is stored in the returned value storage variable.
· Timeout error does not stop AS program execution.

Example

Increasing the count whenever robot operation is performed.


.PROGRAM pg1
:
Motion instructions
:
count = count + 1
$cnt[0]=$ENCODE(/D,count)
CALL send(.$cnt[])
.END

Sending the number of motions robot performed.


.PROGRAM send(.$cnt[])
UDP_SENDTO ret,ip[0],49152,.$cnt[0],1,2
IF ret<>0 THEN
TYPE “ERROR!”
HALT
END
.END

28
D Series Controller 5. Data Communication Instructions in UDP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
UDP_RECVFROM variable for returned value, port number,
character string variable array for received data, number of elements,
timeout, IP address array variable, Max. number of bytes

Function
Receives and stores data in the character string variable array based on UDP protocol. This
instruction creates socket, receives data, and closes socket in one sequence. If a
communication error occurs, the error code is stored in the returned value storage variable, and
program execution does not stop.

Parameter
Variable for returned value
· Specifies variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 5.1 for details on communication error codes.

Port number
· Specifies the port number that indicates the channel of the other end of the connection
(process). The socket is bound to this port number.
· Acceptable range is 8192 – 65535, otherwise error occurs.

Character string variable array for received data


· Specifies the first element of the character string variable array that stores the received data.
· Data is received as continuous character data of 1 byte each. When receiving numeric data
(transformed into character string data), ensure the encoding format is consistent with the
sender (big endian/ little endian, data segmentation etc).
· The maximum amount of data that can be received in one instruction is 1472 bytes.

Number of elements
· Sets the variable to substitute the number of elements in the received character string variable
array.
· Should be specified as a variable.

29
D Series Controller 5. Data Communication Instructions in UDP
Kawasaki Robot TCP/IP Communication Manual

Timeout
· Specifies the time (seconds) to wait before outputting timeout error when connection is not
established. The default setting is 1 second.
· When a timeout error occurs, the error code is stored in the returned value storage variable.
· Timeout error does not stop AS program execution.

IP address array variable


· Specifies the first element of the array variable to store the IP address of the node that sent the
data. The 32 bits in the IP address is divided into 4 elements with 8 bits each, and each
element is stored in the array elements in the specified array.

Maximum number of bytes


· Specifies the maximum number of bytes that can be stored in an element of the character
string variable array.
· Acceptable range is 1 – 255, otherwise error occurs. Default setting is 255 bytes.

Example

Robot activated by value .start_flg.


.PROGRAM pg1
CALL rcv(.start_flg)
IF .start_flg == 1 THEN
:
Motion instructions
:
END
.END

Operating the robot based on operations received from another robot


.PROGRAM rcv(.start_flg)
UDP_RECVFROM ret,49152,$cnt[0],p,1,ip[0],255
IF ret<>0 THEN
TYPE “ERROR!”
HALT
END
num = VAL($cnt[0])
IF num%10 == 0 THEN
.start_flg = 1
ELSE
.start_flg = 0
END
.END

30
D Series Controller 5. Data Communication Instructions in UDP
Kawasaki Robot TCP/IP Communication Manual

5.1 COMMUNICATION ERRORS IN UDP_SENDTO AND UDP_RECVFROM

Code Error message Description Countermeasure


TCPIP) Socket open Failed to open socket when executing Do not execute too many of this
failure. CODE=XX UDP_SENDTO/UDP_RECVFROM. instruction. Fix incorrect
E4019 Dst.IP=XX.XX.XX.XX Too many sockets may have been parameter.
opened. Or, parameter error e.g. wrong CODE shows the SUB error code
IP address. of TCP/IP package.
TCPIP) Socket close Failed to close socket when executing Check for problems in node at the
failure. CODE=XX UDP_SENDTO/UDP_RECVFROM. other end of connection or in the
E4020 Dst.IP=XX.XX.XX.XX Possible problem along Ethernet or at connection line. Fix accordingly.
other end of connection. CODE shows the SUB error code
of TCP/IP package.
TCPIP)Communication Communication error during execution of Check for problems in node at the
Error. CODE=XX UDP_SENDTO/UDP_RECVFROM. other end of connection or in the
E4021 Dst.IP=XX.XX.XX.XX Possible problem along Ethernet or at connection line. Fix accordingly.
other end of connection. CODE shows the SUB error code
of TCP/IP package.
TCPIP)Too Long Tried to send data longer than the limit Fix data to be within limit size and
E4022 Message. while executing UDP_SENDTO/ re-try the program.
UDP_RECVFROM.
TCPIP)Cannot reach Could not connect with the host when Check if port number or IP address
the Host executing UDP_SENDTO/ is correct and correct it if it is
UDP_RECVFROM. There is no host wrong. Check for problems in
E4023 with this IP address on the network. node at the other end of connection
Port number or IP address may be or in the connection line. Fix
wrong. Or, possible problem along accordingly.
Ethernet or at other end of connection.
TCPIP)Communication Timeout occurred during execution of Check for problems in node at the
Time Out. UDP_SENDTO/UDP_RECVFROM. other end of connection or in the
E4024
Dst.IP=XX.XX.XX.XX Possible problem along Ethernet or at connection line. Fix accordingly.
other end of connection.
TCPIP)Connection Connection was aborted while executing Check for problems in node at the
aborted. UDP_SENDTO/UDP_RECVFROM. other end of connection or in the
E4025
Possible problem along Ethernet or at connection line. Fix accordingly.
other end of connection.
TCPIP)No Buffer Communication error occurred during Stop some TCP/IP applications
Space. execution of UDP_SENDTO/ working at the same time. Reboot
UDP_RECVFROM. TCP/IP system the controller.
E4026
resource (queue, buffer) may be lacking.
Or, possible problem along Ethernet or at
other end of connection.
TCPIP)Bad Socket. Could not connect when executing Check port number or IP address
UDP_SENDTO/UDP_RECVFROM. and correct if necessary. Check
E4027 Port number or IP address may be for problems in node at the other
wrong. Or, possible problem along end of connection or in the
Ethernet or at other end of connection. connection line. Fix accordingly.

31
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

6.0 DATA COMMUNICATION INSTRUCTIONS IN TCP

The following program instructions are provided to allow data transmission between robot
controller and other computer systems via Ethernet TCP.

TCP_LISTEN ........Program Instruction to start waiting for connection request (used by


server-side to start communication service)
Creates socket, binds it to the specified port number and waits for connection request to the
socket. This is used when robot controller is used as the server.

Check if connection request is received using the below TCP_ACCEPT instruction.

TCP_ACCEPT ........Program Instruction to check connection request (used by server-side to


start communication service)
Checks if the specified port has received connection request for socket communication. This
instruction is completed when the specified port receives connection request.

Use TCP_ACCEPT after creating a socket using TCP_LISTEN. After connection is confirmed
by this command, use the TCP_SEND and TCP_RECV instructions below to send/ receive data.

TCP_CONNECT .......Program Instruction to request connection (Used by client-side to start


communication service)
Creates socket and binds it to the specified port number. Then, connection request for socket
communication is send to the specified node, and connection is established. Use
TCP_CONNECT when robot is the client.

After connecting via TCP_CONNECT, use TCP_SEND and TCP_RECV instructions to send/
receive data to/ from the server.

TCP_SEND .......... Program Instruction to send data


Sends the specified character string data based on TCP protocol.

Use TCP_SEND after connecting via TCP_ACCEPT or TCP_CONNECT instructions.

TCP_RECV .......... Program Instruction to receive data


Receives data and stores them in the specified character string variable based on TCP protocol.

Use TCP_RECV after connecting via TCP_ACCEPT or TCP_CONNECT instructions.

32
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

TCP_CLOSE ......... Program Instruction to abort connection (Used to terminate communication


service)
Closes the current socket connection. To close sockets created by TCP_LISTEN instruction,
use TCP_END_LISTEN instruction below.

TCP_END_LISTEN ......... Program Instruction to abort connection


Closes socket currently waiting for connection request. To close sockets that are already
connected, use the above TCP_CLOSE instruction.

Example

Keyword Parameter

TCP_ ACCEPT variable for returned value, port number, timeout, …

Parameters marked with can be omitted.

Always enter a space between the keyword and first parameter.

↵ represents the Enter (Return) key in the examples.

33
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_LISTEN variable for returned value, port number

Function
Program Instruction to start waiting for connection request (used by server-side to start
communication service)

Creates socket, binds it to the specified port number, and waits for connection request to that
socket. If communication error occurs during execution, the error code is stored in the
returned value storage variable and program execution does not stop.

Parameter
Variable for returned value
· Specifies variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In this
case, the program execution results in error and stops.
· See 6.1 for details on communication error codes.

Port number
· Specifies the port number that indicates the channel of the other end of the connection. The
socket is bound to this port number.
· Acceptable range is 8192 – 65535, otherwise error occurs.

34
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_ ACCEPT variable for returned value, port number, timeout,
client IP address array variable

Function
Program Instruction to check connection request (used by server-side to start communication
service)

Checks if the connection request for socket communication has been received by the specified
port, and if it has, establishes connection. Connection is completed when this instruction
terminates normally. If communication error occurs during execution, the error code is stored
in the specified returned value storage variable and program execution does not stop.

Parameter
Variable for returned value
· Sets the variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 6.1 for details on communication error codes.

Port number
· Specifies the port number that indicates the channel of the other end of the connection
(process). The socket is bound to this port number.
· Acceptable range is 8192 – 65535, otherwise error occurs.

Timeout
· Specifies the time (seconds) to wait before outputting timeout error when connection is not
established. Default is 1 second. Acceptable range is 0 - 60, otherwise error occurs. If
not specified, 1 is assumed.
· When a timeout error occurs, the error code is stored in the returned value storage variable.
· Timeout error does not stop AS program execution.

Client IP address array variable


· Specifies array variable that stores the IP address of the client (32 bits) when successfully
connected.

35
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

· The IP address is stored in 8 bit increments to each element in the array variable in order
starting from the start of the IP address.

Example
IP address is stored in the array variable elements ipa[0] through ipa[3], when the connection is
established with computer “192.168.0.3”.

ipa[0] : 192
ipa[1] : 168
ipa[2] : 0
ipa[3] : 3

36
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_CONNECT variable for returned value, port number,
server IP address array variable, timeout

Function
Program Instruction to request connection (Used by client-side to start communication service)

Creates socket and binds to the specified port number. Then, connection request is sent to the
specified node, and connection is established. The node is determined by the IP address of
the server. Waiting time to establish the connection is 60 seconds. (fixed)

If communication error occurs during execution, the error code is stored in the returned value
storage variable and program execution does not stop.

Parameter
Variable for returned value
· Specifies variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication error occurs (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 6.1 for details on communication error codes.

Port number
· Specifies the port number that indicates the channel of the other end of the connection
(process). The socket is bound to this port number.
· Acceptable range is 8192 – 65535, otherwise error occurs.

Server IP address array variable


· Specifies array variable that stores the IP address of the server (32 bits) when successfully
connected.
· The IP address is stored in 8 bit increments to each element in the array variable in order from
the start of the IP address.

Timeout
· Specifies the time (seconds) to wait before outputting timeout error when connection is not
established. Default is 1 second. Acceptable range is 0 - 60, otherwise error occurs. If
not specified, 1 is assumed.

37
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

· When a timeout error occurs, the error code is stored in the returned value storage variable.
· Timeout error does not stop AS program execution.

Example
IP address is stored in the array variable elements ipa[0] through ipa [3], when the connection
is established with computer “192.168.0.3”.

ipa[0] : 192
ipa[1] : 168
ipa[2] : 0
ipa[3] : 3

38
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_SEND variable for returned value, socket ID number,
character string variable array for sending data, number of elements,
timeout

Function
Program Instruction to send data

Sends data based on TCP protocol. The data to be sent is specified as character string
variable array.

If communication error occurs, the error code is stored in the returned value storage variable
and program execution does not stop.

Parameter
Variable for returned value
· Sets variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 6.1 for details on communication error codes.

Socket ID number
· Specifies the socket ID number obtained by TCP_ACCEPT or TCP_CONNECT instructions.

Character string variable array for sending data


· Specifies the first element of the character string array that stores the data to be sent.
· Array elements are sent in order from first to last.
· Change the data to be sent into character string variable. Numeric data can be sent once
transformed into character string format. Ensure that the encoding format is consistent with
the recipient (big endian/little endian, etc.).
· The maximum amount of data that can be sent in execution of one instruction is 4096 bytes.

Number of elements
· Specifies the number of elements to send in the character string variable array.
· The specified number of elements are sent to the recipient in order of index number.

39
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Timeout
· Specifies the time (seconds) to wait before outputting timeout error when connection is not
established. Default is 1 second. Acceptable range is 0 - 60, otherwise error occurs. If
not specified, 1 is assumed.
· When a timeout error occurs, the error code is stored in the returned value storage variable.
· Timeout error does not stop AS program execution.

40
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_RECV variable for returned value, socket ID number,
character string variable array for received data, number of elements,
timeout, max. number of characters

Function
Program instruction to receive data

Receives data based on TCP protocol, and stores it in the specified character string variable
array.

If communication error occurs, the error code is stored in the returned value storage variable
and program execution does not stop.

Parameter
Variable for returned value
· Specifies variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 6.1 for details on communication error codes.

Socket ID number
· Specifies the socket ID number obtained by TCP_ACCEPT or TCP_CONNECT instruction.

Received data storage character string variable array


· Specifies the first element of the character string variable array that stores the received data.
· Data is received as continuous character data of 1 byte each. When receiving numeric data
(transformed into character string data), ensure that the encoding format is consistent with the
sender (big endian/ little endian, data segmentation etc).
· The maximum amount of data that can be received in one instruction is 4096 bytes.

Number of elements
· Sets the variable to substitute the number of elements in the received character string variable
array.
· Should be specified as a variable.

41
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Timeout
· Specifies the time (seconds) to wait before outputting timeout error when connection is not
established. Default is 1 second. Acceptable range is 0 - 60, otherwise error occurs. If
not specified, 1 is assumed.
· When a timeout error occurs, the error code is stored in the returned value storage variable.
· Timeout error does not stop AS program execution.

Maximum number of characters


· Specifies the maximum number of bytes stored in an element of the character string variable
array.
· Acceptable range is 1 – 255, otherwise error occurs.
· Default setting is 255 bytes.

Example
When character string “abcdefghijklmnopqrstuvwxyz” is received, this data is stored in array
elements $recv_dt[0] through $recv_dt[3] of the received data storage character string variable
array as shown below. The number of elements is specified as “rcv_cnt”, and the maximum
number of characters in the element is specified as 10.

$recv_dt[0]:”abcdefghij”
$recv_dt[1]:”klmnopqrst”
$recv_dt[2]:”uvwxyz”
rcv_cnt :3

42
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_CLOSE variable for returned value, socket ID number

Function
Program Instruction to abort connection (Used to terminate communication service)

Cuts off connection for socket communication and closes socket. If communication error
occurs, the error code is stored in the returned value storage variable, and program execution
does not stop.

When TCP_CLOSE execution is stopped by communication error etc., the connection may not
be completely disconnected. In this case, execute TCP_CLOSE instruction again. This will
internally shutdown (force CLOSE) the connection.

Parameter
Variable for returned value
· Sets variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 6.1 for details on communication error codes.

Socket ID number
· Specifies the socket ID number obtained by TCP_ACCEPT or TCP_CONNECT instruction.

43
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_END_LISTEN variable for returned value, port number

Function
Program Instruction to abort connection

Ends waiting for connection request on the socket specified by TCP_LISTEN and closes that
socket. If communication error occurs, the error code is stored in the returned value storage
variable, and program execution does not stop.

Parameter
Variable for returned value
· Specifies variable that stores the execution results.
· 0 is stored when execution completes normally.
· Error code is stored when communication error occurs. However, program execution does
not halt at communication error.
· Error code is not stored when non-communication errors occur (e.g. parameter error). In
this case, the program execution results in error and stops.
· See 6.1 for details on communication error codes.

Port number
· Specifies the socket currently waiting for connection request (socket specified in
TCP_LISTEN instruction).

44
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Program Instruction
TCP_STATUS Returned value variable, Port number array variable, Socket ID
array variable, Error code array variable, Sub error code array
variable, IP address character array variable

Function
Stores to the specified variables, the status of the sockets used in the TCP communication
instructions. Data are stored in order of sockets ID No., as controlled within the robot
controller. The data with the same array number in each parameter are data from the same
socket. If there is an error in the parameter, the program execution stops.

Parameter
Returned value variable
・Stores the number of sockets used.
・The data is not stored when there is an error in the parameter.

Port number array variable


・Stores the port number of the sockets used.
・Only stores data specified by TCP_LISTEN, TCP_CONNECT instructions. The data for the
socket specified by TCP_ACCEPT instruction is stored as 0.

Socket ID array variable


・Stores the socket ID of the socket in use.

Error code array variable


・Stores the error codes for the communication errors that occurred recently.
・These may include internal TCP/IP package error codes not explained in 6.10.

Sub error code array variable


・Stores the description codes for the error codes.
・SUB error codes for TCP/IP package

IP address character array variable


・Stores the IP address of the connected device in character string.
Example: 192.168.0.1
・Only stores data specified by TCP_ACCEPT, TCP_CONNECT instructions.

The data for the socket specified by TCP_LISTEN instruction is stored as “0.0.0.0”.

45
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Example of stored data


・Status of the socket

Port number Socket ID Error code Description code IP Address


8192 1 0 0 0;Socket specified by
TCP_LISTEN
0 2 0 0 192.168.0.2; Socket specified by
TCP_ACCEPT
49152 3 0 0 192.168.0.5; Socket specified by
TCP_CONNECT
49153 4 -21670 90 192.168.0.4; Example of a socket
in error status

・TCP_STATUS instruction
TCP_STATUS sock_cnt, port_no[0], sock_id[0], err_cd[0], sub_cd[0], $ip_adrs[0]

・Contents of stored data


sock_cnt :4
port_no[0] : 8192
port_no[1] : 0
port_no[2] : 49152
port_no[3] : 49153
sock_id[0] : 1
sock_id[1] : 2
sock_id[2] : 3
sock_id[3] : 4
err_cd[0] : 0
err_cd[1] : 0
err_cd[2] : 0
err_cd[3] : -21670
sub_cd[0] : 0
sub_cd[1] : 0
sub_cd[2] : 0
sub_cd[3] : 90
$ip_adrs[0] : 0.0.0.0
$ip_adrs[1] : 192.168.0.2
$ip_adrs[2] : 192.168.0.5
$ip_adrs[3] : 192.168.0.4

46
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

6.1 COMMUNICATION ERRORS IN SOCKET COMMUNICATION

The following errors may be detected during execution of socket communication instructions,
but will not stop the execution of the program*. All errors are recorded in the error log.

NOTE* Program execution halts if error occurs when the controller is in the middle of
processing TCP_ACCEPT.

Code Error message Description Countermeasure

TCPIP) Socket open Failed to open socket when executing Do not execute too many of this
failure. CODE=XX TCP_LISTEN/TCP_CONNECT. Too instruction. Fix incorrect
E4019 Dst.IP=XX.XX.XX.X many sockets may have been opened. parameter. CODE shows the
X Or, parameter error e.g. wrong IP address. SUB error code of TCP/IP
package.
TCPIP) Socket close Failed to close socket when executing Check for problems in the node at
failure. CODE=XX TCP_CLOSE/TCP_END_LISTEN. the other end of connection or in
Dst.IP=XX.XX.XX.X Possible problem along Ethernet or at the the connection line. Fix
E4020
X other end of connection. accordingly. CODE shows the
SUB error code of TCP/IP
package.
TCPIP)Communicati Communication error during execution of Check for problems in the node at
on Error. CODE=XX TCP_SEND/TCP_RECV. Possible the other end of connection or in
Dst.IP=XX.XX.XX.X problem along Ethernet or at the other end the connection line. Fix
E4021
X of connection. accordingly. CODE shows the
SUB error code of TCP/IP
package.
TCPIP)Too Long Tried to send data longer than the limit Fix data so the size is within limit
E4022
Message. while executing TCP_SEND. size and re-try the program.
TCPIP)Cannot reach Could not connect with the host when Check if port number or IP
the Host executing TCP_CONNECT. There is no address is correct and correct if
host with this IP address on the network. necessary. Check for problems
E4023
Port number or IP address may be wrong. in the node at the other end of
Possible problem along Ethernet or at the connection or in the connection
other end of connection. line. Fix accordingly.
TCPIP)Communicati Timeout occurred during execution of Check for problems in the node at
on Time Out. instructions based on TCP. Possible the other end of connection or in
E4024
Dst.IP=XX.XX.XX.X problem along Ethernet or at the other end the connection line. Fix
X of connection. accordingly.
TCPIP)Connection Connection was aborted while executing Check for problems in the node at
aborted. TCP_CONNECT/TCP_SEND/TCP_RECV the other end of connection or in
E4025 /TCP_ACCEPT. Possible problem along the connection line. Fix
Ethernet or at the other end of connection. accordingly.
TCPIP)No Buffer Communication error occurred during Abort some TCP/IP applications
Space. execution of TCP_SEND/TCP_RECV. working at the same time.
E4026 TCP/IP system source (queue, buffer) may Reboot the controller.
be lacking. Or, possible problem along
Ethernet or at the other end of connection.
TCPIP)Bad Socket. Could not connect when executing Check port number or IP address
TCP_CONNECT. Port number or IP and correct if necessary. Check
E4027 address may be wrong. Possible problem for problems in the node at the
along Ethernet or at the other end of other end of connection or in the
connection. connection line. Fix accordingly.
TCP)This port is not Failed to open socket when executing Check if port number and correct
in LISTEN (SOCK). TCP_ACCEPT. Or failed to close socket if necessary.
E4056 when executing TCP_END_LISTEN.
May have specified socket not created by
TCP_LISTEN.

47
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

Code Error message Description Countermeasure

TCP)Illegal Socket Communication error occurred during Check socket ID number or port
ID execution of TCP_SEND/TCP_RECV. number and correct if necessary.
Or, failed to close socket when executing Check order of program
E4057 TCP_CLOSE/TCP_END_LISTEN. execution, and correct if
May have specified socket ID number or necessary.
port number of socket not created. Or,
the order of program execution is wrong。
TCP)Cannot create Failed to open socket when executing Avoid executing too many
a socket. TCP_LISTEN/TCP_CONNECT. Too instructions at a time. Correct
many sockets are opened. Or, the same parameter. Close port
E4055 port is used too many times. previously used via
TCP_CLOSE/TCP_END_LISTEN
before using it again.

48
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

6.2 SAMPLE PROGRAM USING SOCKET COMMUNICATION INSTRUCTIONS


6.2.1 WHEN ROBOT IS THE SERVER-SIDE

.PROGRAM main() ;Communication main program


port = 49152
max_length = 255
tout_open = 60
tout_rec = 60
CALL open_socket ;Connecting communication
IF sock_id < 0 THEN
GOTO exit_end
END
text_id = 0
tout = 60
eret = 0
rret = 0
$sdata[1] = "001"
CALL send(eret,$sdata[1]) ;Instructing processing 1
IF eret < 0 THEN
PRINT "CODE 001 ERROR END code=",eret
GOTO exit
END
CALL recv ;Receiving the result of processing 1
IF rret < 0 THEN
PRINT "CODE 001 RECV ERROR END code=",rret
GOTO exit
END
eret = 0
$sdata[1] = "002"
CALL send(eret,$sdata[1]) ;Instructing processing 2
IF eret < 0 THEN
PRINT "CODE 002 ERROR END code=",eret
GOTO exit
END
CALL recv ;Receiving the result of processing 2
IF rret < 0 THEN
PRINT "CODE 002 RECV ERROR END code=",rret
GOTO exit
END
exit:
CALL close_socket ;Closing communication
exit_end:
.END

49
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

.PROGRAM open_socket() ;Starting communicatin


er_count =0
listen:
TCP_LISTEN retl,port
IF retl<0 THEN
IF er_count >= 5 THEN
PRINT "Connection with PC is failed (LISTEN). Program is stopped."
sock_id = -1
goto exit
ELSE
er_count = er_count+1
PRINT "TCP_LISTEN error=",retl," error count=",er_count
GOTO listen
END
ELSE
PRINT "TCP_LISTEN OK ",retl
END
er_count =0
accept:
TCP_ACCEPT sock_id,port,tout_open,ip[1]
IF sock_id<0 THEN
IF er_count >= 5 THEN
PRINT "Connection with PC is failed (ACCEPT). Program is stopped."
TCP_END_LISTEN ret,port
sock_id = -1
ELSE
er_count = er_count+1
PRINT "TCP_ACCEPT error id=",sock_id," error count=",er_count
GOTO accept
END
ELSE
PRINT "TCP_ACCEPT OK id=",sock_id
END
exit:
.END
.PROGRAM send(.ret,.$data) ;Communication Sending data
$send_buf[1] = .$data
buf_n = 1
.ret = 1
TCP_SEND sret,sock_id,$send_buf[1],buf_n,tout
IF sret < 0 THEN
.ret = -1
PRINT "TCP_SEND error in SEND",sret
ELSE
PRINT "TCP_SEND OK in SEND",sret
END
.END
.PROGRAM recv() ;Communication Receiving data
.num=0
TCP_RECV rret,sock_id,$recv_buf[1],.num,tout_rec,max_length
IF rret < 0 THEN
PRINT "TCP_RECV error in RECV",rret
$recv_buf[1]="000"
ELSE
IF .num > 0 THEN
PRINT "TCP_RECV OK in RECV",rret
ELSE
$recv_buf[1]="000"
END
END
.END

50
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

.PROGRAM close_socket() ;Closing communication


TCP_CLOSE ret,sock_id ;Normal socket closure
IF ret < 0 THEN
PRINT “TCP_CLOSE error ERROE=(”,ret,” ) “,$ERROR(ret)
TCP_CLOSE ret1,sock_id ;Forced closure of socket (shutdown)
IF ret1 < 0 THEN
PRINT "TCP_CLOSE error id=",sock_id
END
ELSE
PRINT "TCP_CLOSE OK id=",sock_id
END
TCP_END_LISTEN ret,port
IF ret < 0 THEN
PRINT "TCP_CLOSE error id=",sock_id
ELSE
PRINT "TCP_CLOSE OK id=",sock_id
END
.END

51
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

6.2.2 WHEN ROBOT IS THE CLIENT-SIDE


.PROGRAM main() ;Communication main program
port = 49152
ip[1] = 192
ip[2] = 168
ip[3] = 0
ip[4] = 2
max_length = 255
tout_open = 60
tout_rec = 60
eret = 0
ret = 0
CALL open_socket ;Connecting communication
IF sock_id < 0 THEN
GOTO exit_end
END
text_id = 0
tout = 60
WHILE (1) DO
ret = 0
CALL recv ;Receiving instruction data from PC
IF ret < 0 THEN
PRINT "Communication error code=",ret
GOTO exit
ELSE
CASE ret OF
VALUE 0:
text_id = val($mid($recv_buf[1],1,3)) ;Taking in instruction number
ANY :
END
END
IF text_id > 0 THEN
CALL com_test ;Processing of each instruction
IF eret < 0 THEN
goto exit
END
END
END
exit:
CALL close_socket ;Disconnecting communication
exit_end:
.END
.PROGRAM com_test() ;Processing per separate instruction data
CASE text_id OF
VALUE 0: ;No instructions
GOTO break_exit
VALUE 1: ;Instructing processing 1
;Separate processing
VALUE 2: ;Instructing processing 2
;Separate processing
VALUE 3: ;Instructing processing 3
;Separate processing
any :
GOTO break_exit
END
$end_buf[1] = $recv_buf[1] + " OK"
CALL send(eret,$end_buf[1]) ;Sending end processing
break_exit:
.END

52
D Series Controller 6. Data Communication Instructions in TCP
Kawasaki Robot TCP/IP Communication Manual

.PROGRAM open_socket() ;Starting communication


.er_count =0
connect:
TCP_CONNECT sock_id,port,ip[1],tout_open
IF sock_id<0 THEN
IF .er_count >= 5 THEN
PRINT "Connection with PC failed. Program is stopped."
ELSE
.er_count = .er_count+1
PRINT "TCP_CONNECT error id=",sock_id," error count=",.er_count
GOTO connect
END
ELSE
PRINT "TCP_CONNECT OK id=",sock_id
END
.END
.PROGRAM recv() ;Communication Receiving data
.num=0
TCP_RECV ret,sock_id,$recv_buf[1],.num,tout_rec,max_length
IF ret < 0 THEN
PRINT "TCP_RECV error in RECV",ret
$recv_buf[1]="000"
ELSE
IF .num > 0 THEN
PRINT "TCP_RECV OK in RECV",ret
ELSE
$recv_buf[1]="000"
END
END
.END
.PROGRAM send(.ret,.$data) ;Communication Sending data
$send_buf[1] = .$data
buf_n = 1
.ret = 1
send_rt:
TCP_SEND sret,sock_id,$send_buf[1],buf_n,tout
IF sret < 0 THEN
.ret = -1
PRINT "TCP_SEND error in SEND",sret
ELSE
PRINT "TCP_SEND OK in SEND",sret
END
.END
.PROGRAM close_socket() ;Closing communication
TCP_CLOSE ret,sock_id ;Normal socket closure
IF ret < 0 THEN
PRINT “TCP_CLOSE error ERROE=(”,ret,” ) “,$ERROR(ret)
TCP_CLOSE ret1,sock_id ;Forced closure of socket (shutdown)
IF ret1 < 0 THEN
PRINT "TCP_CLOSE error id=",sock_id
END
ELSE
PRINT "TCP_CLOSE OK id=",sock_id
END
.END

53
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.0 SAVE/LOAD FILES USING FTP CLIENT FUNCTION

The functions below are provided to enable saving/loading of robot data using the FTP Client
Function via Ethernet connection between the robot controller and an external computer
system.

(1) Aux.0201: Save


Saves internal robot data to an external computer system.
(2) Aux.0202: Load
Loads internal robot data from an external computer system.
(3) Aux.0203: File list
Displays file information on the external computer system.
(4) Aux.0205: Delete file
Deletes files on the external computer system.
(5) Aux.0206: Rename file
Changes the name of the file in the external computer.
(6) Aux.0210: Autosave configuration
Sets/Displays the information of auto-save to the external computer.
(7) Aux.0812: Network setting
Sets/Displays the information of the local controller.
(8) Aux.0815: FTP server setting
Sets/Displays the information of connection to the external computer.

“2: FTP server” from a device list can not be selected in the following auxiliary functions.
Aux.0204 : Initialize
Aux.0207 : Copy file
Aux.0208 : Set verifying function
Aux.0209 : Set default device

[ NOTE ]
< Selecting FTP server >
Enable server function in Aux.0815: FTP sever setting; otherwise,
device list 2: FTP server can not be selected.

54
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.1 SOFTWARE SETTINGS

7.1.1 SETTINGS ON THE ROBOT CONTROLLER

Sets the items below for the robot controller by “Aux. 0812 Network setting”. The data
below is saved or loaded as robot data.

IP address Input XXX in decimal.


Initial setting: 192.168.0.2
Subnet mask Input XXX in decimal.
Initial setting: 255.255.255.0
Gateway IP address Input XXX in decimal.
Initial setting: 0.0.0.0

7.1.2 SETTINGS ON REMOTE HOST

Sets the items below for the FTP server by “Aux. 0815 FTP server setting”. The data below
is saved or loaded as auxiliary data.

55
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

Server Function Select Enable/Disable server function.


Initial setting: Disable
IP address Input XXX in decimal.
Initial setting: 192.168.0.1
User name Input characters starting with alphabet. (max. 24 characters.)
User name can not be omitted.
Password Input characters starting with alphabet. (max. 24 characters.)
The data is displayed with “*”
Password can not be omitted.
Path Input on 3 lines (max. 24 characters/line) (max.72 characters in
total)
Backspace(Delete) space at the end on each line
Path can not be omitted.
i.e) When the host is Windows, C:¥ftp¥ or C:/ftp/
When the host is UNIX, /home/ftp/
Account Input characters starting with alphabet. (max. 24 characters.)
The data is displayed with “*”.
Account can not be omitted.
Transfer mode Select ASCII or BINARY.
Default: ASCII
Character code Select SJIS(shift JIS) code or EUC code.
Default: SJIS
Command to get file name Select LIST or NLST.

56
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.2 FTP AUXILIARY FUNCTIONS

7.2.1 AUX. 0201 SAVE

Through the FTP server, data and programs in memory are stored into a file in the directory on
the path set via “Aux. 0815 FTP server setting”.

In the screen below, select the type of data to be saved by cursor or the function number.

Data to be saved (File extensions are displayed in [ ] when file are saved.)
1. All data [.as]
2. All data (only in specified program) [.as]
3. Program [.pg]
4. Robot data [.rb]
5. System data [.sy]
6. Auxiliary data [.au]
7. Interface panel data [.if]
8. Error logging [.el]

57
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

Next, enter the file name in the screen below.

File name Enter characters starting with alphabet. (max.: 8)


File extensions are automatically added to the data to be saved.
Device Selects device. 0: PC card or 2: FTP server
Initial setting: 0: PC card

[ NOTE ]
< Limit on the number of characters that can be used for file names in the FTP server >
The maximum number of characters is 16 when saving a file name. However, if file
names displayed in the Windows FTP server directory exceed 8 characters, the
remaining characters may be truncated and appear as (~) . Name files with 8 characters
or less when using this kind of server.

58
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.2.2 AUX. 0202 LOAD

Loads data stored in file units in the directory on the path via “Aux. 0815 FTP server setting”
to memory.

Select loading method, all data or specified data only, in the screen below by function number
or cursor.

Next, file list in the directory according to the path set by “Aux. 0815 FTP server setting” is
displayed below. Select the file to be read by cursor and press ENTER key.

Similar screen appears when pressing: “2. Specified data”. (Only changing the display of the
first line.)

59
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.2.3 AUX. 0203 FILE CONFIGURATION

Displays a list of the file names stored in the directory, path set by “Aux. 0815 FTP server
setting”.

60
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.2.4 AUX. 0205 DELETE FILE

Deletes the file selected by cursor from the directory, path set by “Aux. 0815 FTP server
setting”.

61
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.2.5 AUX. 0206 RENAME FILE

Changes the file name defined by Source file name to the file name defined by Dest. File name
from among the files stored in the directory (path set by “Aux. 0815 FTP server setting”).

Source file name Enter the file name including extension.


Input characters starting with alphabet. (max.: 8)
Dest. file name Enter the file name including extenstion.
Input characters starting with alphabet. (max.: 8)

7.2.6 AUX. 0210 AUTOSAVE CONFIGURATION

Auto-saving is a function that automatically saves data from the robot controller to the remote
host daily at a specified time and by a specified procedure.

Autosaving is excuted according to specified procedure. Data below is saved/ loaded as


auxiliary data.

62
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

Autosave Set execution of Auto saving function: ENABLE/DISABLE.


Initial setting: DISABLE.
Day of week Select the day to execute autosaving.
Time Input the time to start autosaving.
Hour: 0 to 23
Min.: 0 to 59
Device Select device.
0: PC card 2: FTP server
Initial setting: 0: PC card
Save file name Input characters starting with alphabet. (max.: 8)
Initial setting: FILE0.as
Save data Select data to be saved.
1. All data
2. All data (only in specified program)
3. Program
4. Robot data
5. System data
6. Auxiliary data
7. Interface panel data
8. Error logging
Specified program Specify program to be saved. This function is available when selecting
the following in save data screen.
2. All data (only in specified program)
3. Program

Data is automatically saved to the directory specified by the path in “Aux. 0815 FTP server
setting” under the conditions set in “Aux. 0210 Autosave configuration”. Processing conditions
are indicated on next page.

63
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

(1) Start autosaving everyday at specified time.


Start autosaving process everyday at the specified time.

(2) Start autosaving everyday on the specified day.


Start autosaving process on only specified day at set time.

(3) Start when dedicated signal is input


Starts autosaving process at the specified time, when dedicated signal set in condition 1 to 3 in
“Aux. 0602 Dedicated input signal” is input.

[Selects Save Data] screen appears by selecting items in save data.

2.All data (only in specified program) or 3. Program is selected, boxes to choose programs are
displayed on the right side of the specified program.

64
D Series Controller 7. Save/Load files using FTP client function
Kawasaki Robot TCP/IP Communication Manual

7.3 COMMUNICATION ERROR CODES WHICH OCCUR WITH THE FTP CLIENT
FUNCTION

Even if errors relating to the save/load function by the FTP function are detected, only a
warning is displayed without them being an error. However, the communication errors are
recorded in the error log. Errors are detected in the following cases.:

-Information for the LAN setting is left unset during start-up.


-There is a malfunction in the automatic backup.
-There is an error on manually saving/loading.

Error Code Error Message Explanation Counter-measures


Device is not ready. Designated directory does not exist. After verifying the directory path to be
(Occurs only when auxiliary functions referenced, check if Aux.0815 FTP
P2008
relating to FTP are attempted.) server setting is set correctly, and reset
as necessary.
SAVE/LOAD in progress. Because save/load is already being executed After saving/loading has been
P2076 by another operation, save/load could not be completed by the other server, try to
done. re-execute.
Communication time out Execution is terminated because there is no Verify that the communication cable is
error reply from the FTP server. (Occurs only connected properly and re-execute.
E4009
when auxiliary functions relating to FTP are
attempted.)
FTP)Data receive Failure to receive the teach data via LAN→ Verify that the communication cable is
error(code=%d) Memory (Manually LOAD) or failure on connected properly and re-execute.
E4028 receiving LAN file directory list information.
A misconnection of the communication cable
is the probable cause.
FTP)Data send Failure to transmit the teach data via Memory Verify that the communication cable is
error(code=%d) →LAN (Manually SAVE). A misconnection connected properly and re-execute.
E4029
of the communication cable is the probable
cause.
FTP)Failed to disconnect Failure to terminate when completing Re-execute after carrying out these
with FTP server(code=%d) communication with the FTP server. measures:
The following are considered as causes: 1. Verify that the communication cables
E4031 1. Communication cable is not connected connected properly.
correctly. 2. Reboot the remote host FTP server.
2. The remote host FTP server is OFF or is in
an abnormal condition.
FTP)Failed to connect with The connection failed when communication Re-execute after carrying out these
FTP Server (code=%d) with the FTP server was started. measures:
1. code=26 : the designated address does 1. Verify the IP address of the remote
not exist on the network host. Correct the address setting via
Aux.0815 FTP server setting.
2. code=64 : communication cable is not 2. Verify that the communication cable
E4033
connected properly is connected properly.
3. Confirm the user name and
3. code=530 : failed to login to FTP server password on the remote host.
Correct the user name and password
for the LAN remote host save/load
settings via Aux.0815.
FTP)Failed AUTO-SAVing Some kind of error occurred during auto Carry out counter measures on the error
save. The error that occurred is displayed displayed immediately after the
E4037
immediately after this message and is message: FTP)AUTO-SAVing failed.
recorded in the error log.

65
D Series Controller 8. Error Message
Kawasaki Robot TCP/IP Communication Manual

8.0 ERROR MESSAGE

Code Error Message Description Countermeasure


TELNET) SEND error. Error occurred when sending data by TCP/IP. Check for problems in node at end
CODE=XX Possible problem along communication line, or of connection or in the connection
E4013 connection was aborted or closed. line. Fix accordingly.

TELNET) RECV error. Error occurred when receiving data by TCP/IP. Check for problems in node at end
CODE=XX Possible problem along communication line, or of connection or in the connection
E4014 connection was aborted or closed. line. Fix accordingly.

TELNET) IAC receive error. Error occurred when receiving data by TCP/IP. Check for problems in node at end
CODE=XX Possible problem along communication line, or of connection or in the connection
E4015 connection was aborted or closed. line. Fix accordingly.
Check the KCwinTCP in the PC at
other end of connection.
TELNET) Close failure. Error occurred in LISTEN/ACCEPT function Stop some TCP/IP applications
CODE=XX in TCP/IP, and attempt to close the socket working at the same time. Reboot
failed. TCP/IP system resources (queue, the controller.
E4016 buffer) may be lacking. Or, possible problem CODE shows the SUB error code
along communication line, or in node at other of TCP/IP package.
end of connection.
TELNET) Main socket close Error occurred in LISTEN/ACCEPT function Stop some TCP/IP applications
failure. CODE=XX in TCP/IP, and tried to close the main socket working at the same time. Reboot
but could not. TCP/IP system source (queue, the controller.
E4017 buffer) may be lacking. Or, possible problem CODE shows the SUB error code
along communication line, or in node at other of TCP/IP package.
end of connection.

TELNET) System error. The parameter in IPADDRESS command is Set the parameter in IPADDRESS
CODE=XX wrong. correctly.
E4018 CODE shows the SUB error code
of TCP/IP package.

TCPIP) Socket open failure. Failed to open socket when executing Do not execute too many of this
CODE=XX UDP_SENDTO/UDP_RECVFROM/TCP_LIS instruction. Fix incorrect
Dst.IP=XX.XX.XX.XX TEN/TCP_CONNECT. Too many sockets parameter.
E4019 may have been opened. Or, parameter error CODE shows the SUB error code
e.g. wrong IP address. of TCP/IP package.

TCPIP) Socket close failure. Failed to close socket when executing Check for problems in node at end
CODE=XX UDP_SENDTO/UDP_RECVFROM/TCP_CL of connection or in the connection
Dst.IP=XX.XX.XX.XX OSE/TCP_END_LISTEN. There may be line. Fix accordingly.
problem with the Ethernet or at the other end of CODE shows the SUB error code
E4020
the connection. of TCP/IP package.

TCPIP)Communication Error. Communication error during execution of Check for problems in node at end
CODE=XX UDP_SENDTO/UDP_RECVFROM/TCP_SE of connection or in the connection
Dst.IP=XX.XX.XX.XX ND/TCP_RECV. Possible problem along line. Fix accordingly.
E4021 communication line, or connection was aborted CODE shows the SUB error code
or closed. of TCP/IP package.

TCPIP)Too Long Message. Tried to send data longer than the limit while Fix data so the size is within limit
executing size and re-try the program.
E4022 UDP_SENDTO/UDP_RECVFROM/TCP_SE
ND.

66
D Series Controller 8. Error Message
Kawasaki Robot TCP/IP Communication Manual

Code Error Message Description Countermeasure


TCPIP)Cannot reach the Host. Could not connect with the host when Check port number or IP address
executing UDP_SENDTO/ and correct if necessary. Check
UDP_RECVFROM/TCP_CONNECT. There for problems in node at end of
is no host with this IP address on the network. connection or in the connection
E4023 Port number or IP address may be wrong. line. Fix accordingly.
Possible problem along communication line, or
connection was aborted or closed.

TCPIP)Communication Time Timeout occurred during execution of Check for problems in node at end
Out. Dst.IP=XX.XX.XX.XX instructions based on TCP. Possible problem of connection or in the connection
E4024
along communication line, or connection was line. Fix accordingly.
aborted or closed.
TCPIP)Connection aborted. Connection was aborted while executing Check for problems in node at end
UDP_SENDTO/UDP_RECVFROM/TCP_CO of connection or in the connection
NNECT/TCP_SEND/TCP_RECV/TCP_ACC line. Fix accordingly.
E4025
EPT. Possible problem along communication
line, or connection was aborted or closed.

TCPIP)No Buffer Space. Communication error occurred during Stop some TCP/IP applications
execution of UDP_SENDTO/ working at the same time. Reboot
UDP_RECVFROM/TCP_SEND/TCP_RECV. the controller.
E4026 TCP/IP system source (queue, buffer) may be
lacking. Or, possible problem along
communication line, or connection was aborted
or closed.
TCPIP)Bad Socket. Could not connect when executing Check port number or IP address
UDP_SENDTO/UDP_RECVFROM/TCP_CO correct if necessary. Check for
NNECT. Port number or IP address may be problems in node at end of
E4027
wrong. Possible problem along connection or in the connection
communication line, or connection was aborted line. Fix accordingly.
or closed.
TCP)This port is not in Failed to open socket when executing Check port number and correct if
LISTEN (SOCK). TCP_ACCEPT. Or failed to close socket necessary.
E4056 when executing TCP_END_LISTEN. May
have specified socket not created by
TCP_LISTEN.
TCP)Illegal Socket ID Communication error occurred during Check socket ID number or port
execution of TCP_SEND/TCP_RECV. number and correct if necessary.
Or, failed to close socket when executing Check order of program execution,
E4057 TCP_CLOSE/TCP_END_LISTEN. and correct if necessary.
May have specified socket ID number or port
number of socket not created. Or, the order of
program execution is wrong.
TCP)Cannot create a socket. Failed to open socket when executing Avoid executing too many
TCP_LISTEN/TCP_CONNECT. Too many instructions at a time. Correct
sockets are opened. Or, the same port is used parameter. Close port previously
E4055 too many times. used using
TCP_CLOSE/TCP_END_LISTEN
before using it again.

67
D Series Controller 8. Error Message
Kawasaki Robot TCP/IP Communication Manual

MEMO

68
Kawasaki Robot Controller D Series
TCP/IP Communication MANUAL

March 2003 : 1st Edition


January 2007 : 2nd Edition
December 2008 : 3rd Edition

Publication : KAWASAKI HEAVY INDUSTRIES, LTD.

90210-1190DEC

All rights reserved. Copyright © 2008 KAWASAKI HEAVY INDUSTRIES, LTD.

You might also like