Computer Link Module - 63gm2d7h
Computer Link Module - 63gm2d7h
User’s Manual
LG Programmable Logic Controller
Computer Link Module
K7F-CUEA
MASTER-K K4F-CUEA
K3F-CU2A
K3F-CU4A
LG Industrial Systems
Chapter 1 Introduction
1 Introduction
This manual describes the computer link (Cnet) system of MASTER-K series. The Cnet network
system means PLCs of network communicate through the computer link module.
The MASTER-K Cnet module has following features;
A frame editor software that are based on MS-Windows 95/98 is provided. User can
write an user-defined protocol for communication with other manufacturer’s PLCs.
Supports RS-232C and RS-485 channels and they can operate stand-alone mode or
interlocking mode.
A 128kbyte flash memory is equipped for user protocol data storage.
Supports a LGIS’s dedicated protocol for easy and simple setup of the network between
LGIS products such as PMU.
Supports a multi-drop function that maximum 32 station can be joined into a network.
With a built-in modem communication function, it can control a remote PLC by dedicated
protocol, KGL-WIN connection, or user-defined protocol.
Supports various communication speed (baud rate) from 300bps to 153,600bps (RS-
422)
RS-422 channel provides 1:1, 1:N, or N:M communication modes.
Full duplex (RS-422) and half-duplex (RS-485) are available.
In a main base board, multiple Cnet modules can be mounted. (K200S : 2 modules,
K300S : 4 modules, K1000S : 8 modules)
Provides powerful self-diagnosis functions and loop-back test function.
1-1
Chapter 1 Introduction MASTER-K
The following table shows communication modules of MASTER-K series. Please refer the table
when configure a MK network system.
Network Catalog
Master / Slave Cable type Applicable PLC system
type number
K3F-FUEA K200S
K4F-FUEA K300S
Twisted pair
Master (FMM) K7F-FUEA K1000S
G0L-FUEA IBM compatible PC
Optical fiber K7F-FUOA K1000S
K3F-RBEA K200S
MK Fnet
K4F-RBEA K300S
Twisted pair
Slave (FSM) K7F-RBEA K1000S
G0L-SMxA Stand-alone
Optical fiber K7F-RBEA K1000S
Twisted pair G0L-FREA Stand-alone
Option (FOU)
Optical / twisted pair G0L-FEOA Stand-alone
K3F-CU2A K200S
Master / slave Twisted pair K3F-CU4A K200S
MK Cnet
(selectable) or RS-232C cable K4F-CUEA K300S
K7F-CUEA K1000S
Remark
1. There is a limitation on the maximum module numbers that are mountable on a base
board. Refer the following table for details
Module type Fnet Cnet
K200S Max. 2 modules Max. 2 modules
K300S Max. 4 modules Max. 4 modules
K1000S Max. 4 modules Max. 8 modules
2. Communication modules can be mounted on main base board only.
3. Master/slave can be selected with parameter setting.
1-2
Chapter 2 Terminology
2 Terminology
This chapter will describe the meaning of terms used in this manual.
Receive Transmission
76543210 76543210
2-1
Chapter 2 Terminology MASTER-K
2) Parallel transmission
In parallel transmission, 8bits (1byte) are transmitted at once through 8 communication
lines. It provides faster transmission speed, and higher communication reliability, but
installation cost are increased in geometrical series by transmission distance.
1
0
Transmission Receive
1
1
0
0
1
ENQ(h05)
PARITY
PARITY
PARITY
PARITY
PARITY
PARITY
PARITY
START
START
START
START
START
START
START
STOP
STOP
STOP
STOP
STOP
STOP
STOP
O
R
K
A
Direction of transmission
2-2
Chapter 2 Terminology MASTER-K
2.1.4 Protocol
This is a rule that specifies how two or more devices communicate more efficiently and
reliably. Generally, it defines following features;
Establishment of communication
Connection between devices
The structure of data exchange format
Re-transmission when an error occurred
Switching transmit/receive
Character synchronization between devices
2.1.6 Node
It indicates a point that a data line is branched into two or more lines in the network tree
structure. Generally, a network consists of multiple nodes. Also, the term ‘station’ has
same meaning.
2.1.7 Packet
It is a compound word of ‘package’ and ‘bucket’ and a data transmission unit of a ‘packet
exchange system’. In this system, the data is divided into a specific length unit, and a
header is added. A ‘header + divided data’ is called as a packet.
2.1.8 Port
A port means a data input/output gate of data transmission devices. In Cnet serial
communication, a port means RS-232C or RS-422/485 port.
2.1.9 RS-232C
RS-232C is one of serial communication standards that are established by EIA. It defines
the communication interface between modem and a computer (or other devices), and it
can be used for direct connection without modem (null-modem). The demerit of RS-232C
is that a transmission distance is short and only 1:1 connection is possible.
2-3
Chapter 2 Terminology MASTER-K
2.1.10 RS-422/485
It is a standard of serial communication that is made up for demerits of RS-232C standard.
It supports long transmission distance and 1:N connection. The difference of RS-422 and
RS-485 is the number of signal lines. The RS-422 has 4 signal lines such as TX(+), TX(-),
RX(+), and RX(-), and RS-485 has 2 signal lines (+ and –). Because of transmit and
receive line is separated, RS-422 can perform full-duplex communication, but the RS-485
performs half-duplex communication because transmit and receive share one signal line.
2.1.11 BCC
The BCC stands for ‘Block Check Character’. To check a transmitting data contains error
or not, a transmitting station calculates BCC from data and adds the BCC at the bottom of
data. Then, the receiving station can determine whether an error occurred by comparing
the BCC with transmitted data.
KGLWIN KGLWIN
MODEM
Physical connection
Physical connection
RS-232C
MODEM
PLC A PLC B
2-4
Chapter 2 Terminology MASTER-K
2.1.13 Frame
The frame is a structure definition of data transmission. It consists of a segment (station
number, instruction, structured data, and/or execution result), control code for
synchronization, parity bit, and BCC for error detection. The frame of MASTER-K Cnet is
as following picture.
Request frame
Station No
Instruction
BCC
EOT
Station No
Instruction
Execution result
BCC
ACK
ETX
Header Segment Tail
Response frame
2-5
Chapter 3 Specifications
3 Specifications
3.1 General specifications
The following table shows the general specifications of MASTER-K series.
No Item Specifications Remark
Operating ambient
1 0 ~ 55 (32 ~ 131 °F)
temperature
Storage ambient
2 -25 ~ 70 (-13 ~ 158 °F)
temperature
Operating ambient
3 5 ~ 95%RH, non-condensing
humidity
Storage ambient
4 5 ~ 95%RH, non-condensing
humidity
Occasional vibration
Frequency Acceleration Amplitude Sweep count
10f<57 Hz - 0.075 mm 10 times in each
57 f150 Hz 9.8 (1G) - direction for X, Y, Z
Vibration
5 IEC 1131-2
resistance Continuos vibration
Frequency Acceleration Amplitude
10f<57 Hz - 0.035 mm 10 times in each
57f150 Hz 4.9 (0.5G) - direction for X, Y, Z
Remark
3-1
Chapter 3 Specifications MASTER-K
Items Specifications
Remark
1) RS-422 and RS-485 can be selected with the basic parameter of frame editor.
2) To use modem function, set the ‘type’ of basic parameter as ‘dial-up modem’ or ‘dedicated
modem’ in frame editor.
3) In stand-alone mode, RS-232C and RS-422/485 channels can have different data structures.
4) It is not allowed to change operation mode while the Cnet module is operating.
5) Only RS-422/485 channel of K300S/1000S Cnet version 1.3 (or later) can be use 76,800 and
153,600 bps. The maximum baud rate of K200S is 38,400.
3-2
Chapter 3 Specifications MASTER-K
3.3.1 K3F-CU2A
RS-232C
3-3
Chapter 3 Specifications MASTER-K
3.3.2 K3F-CU4A
RS-422/485
3-4
Chapter 3 Specifications MASTER-K
3.3.3 K4F-CUEA
K4F-CUEA
RUN/BPS RUN/BPS
TX/BPS TX/BPS
RX/BPS RX/BPS
ACK/DATA ACK/DATA
NAK/PARITY NAK/PARITY
ERR/EVEN-ODD ERR/EVEN-ODD
MODEM/STOP RS-485/STOP
SYS-RUN SYS-RUN
RS-232C RS-422
SD
SG
FG
3-5
Chapter 3 Specifications MASTER-K
3.3.4 K7F-CUEA
MODE
RS-232C
RS-422
RDA
RDB
SDA
SDB
SG
FG
3-6
Chapter 3 Specifications MASTER-K
When communicate with RS-422 or RS-485 channel, twisted pair cable should be used in
consideration of transmit distance and speed. The following table shows the recommended
cable specification of communication cable. Please make sure use the recommended cable or
equivalent cable complying with the following specifications.
y Type : Low capacitance LAN interface cable
y Catalog number : LIREV-AMESB
y Specification : 2P × 22AWG ( D / 0.254 TA )
y Manufacturer : LG Cable Co. Ltd.
1) Electrical characteristics
Item Unit Characteristic Test condition
Conductor resistance Ω / km 59 or less Normal condition
Stands 1 minute at
Dielectric strength V / 1 min Normal condition
500VDC
Insulation resistance MΩ - km 1,000 or more Normal condition
Electrostatic capacity pF / m 45 or less Frequency : 1kHz
Characteristic impedance Ω 120 ± 12 Frequency : 10MHz
2) Appearance characteristics
Item Solid cable Standard cable
No. of cores pair 2 2
Specification AWG 22 22
Conductor
Composition No. / mm 1 / 0.64 7 / 0.254
Outer diameter mm 0.64 0.76
Thickness mm 0.55 0.55
Insulator
Outer diameter mm 1.64 1.76
3) Structure of cable
Conducto
Insulator
AL/MYLER
Ground Line
Braided material
3-7
Chapter 3 Specifications MASTER-K
When communicate via RS-422 or RS-485 channel, terminal resistors should be added at the
ends of network wiring. The terminal resistor prevents a distortion of signal caused from
reflected wave of cable. The terminal resistor should have the same resistance with the
characteristic impedance of cable. If you use the recommended cable or equivalent, please
connect two 120Ω, 1/2W resistors at the ends of network.
SG SG SG SG
FG FG FG FG
SG SG SG SG
FG FG FG FG
3-8
Chapter 4 Operation of Cnet module
1) K7F-CUEA / K4F-CUEA
Switch Operation mode
Mode switch Remarks
position RS-232C RS-422
0 User-defined User-defined
Interlocking mode 1)
1 Dedicated Dedicated
2 User-defined User-defined
7 8 Stand-alone mode
3 Dedicated Dedicated
6 9
4 User-defined Dedicated
5 0 5 Dedicated User-defined
Stand-alone mode 2)
6 KGL-WIN User-defined
4 1 7 KGL-WIN Dedicated
3 2 Loop-back Loop-back Self-diagnosis
8 Press the ‘display’
Flash memory write 3), 4)
button at the power-on
9 On-line 4) On-line mode change
Remark
1) In the interlocking mode, the RS-232C channel operates as main channel and the RS-422
channel operates as the data path. The data structure of RS-422 channel is set as that of RS-
232C channel.
2) In stand-alone mode, RS-232C and RS-422 channel can operates in different operation modes.
3) To enter into the flash memory write mode, press the ‘display’ button and turn on the power of
Cnet module. (It doesn’t need to hold the display button) Otherwise, the Cnet will operate as
the loop-back mode.
4) Available if the O/S version of Cnet is v2.0 or later
4-1
Chapter 4 Operation of Cnet module MASTER-K
2) K3F-CU2A / K3F-CU4A
Switch
Mode switch Operation mode Remarks
position
0 User-defined
1 Dedicated
7 8 2 KGL-WIN
6 9
3 Loop-back
4
5 0
5
Reserved Not used
4 1 6
3 2 7
8 Flash memory write
Cnet v2.0 or later
9 On-line
4-2
Chapter 4 Operation of Cnet module MASTER-K
RS-232C channel
RS-232C cable
TX
RX
PLC
CPU RS-422 channel
RS-422 cable
TX
RX
Data Flow
Remark
1. In the interlocking mode, the data structure is set as that of RS-232C channel. The setting
of RS-422 channel is ignored.
2. In the interlocking mode, the modem can not be connected to the RS-232C channel. It is
only available in the stand-alone mode. If the RS-232C channel is set as modem
connection in the interlocking mode, the RS-232C channel operates as null modem mode.
3. K200S (K3F-CU2A / K3F-CU4A) does not support interlocking mode.
4-3
Chapter 4 Operation of Cnet module MASTER-K
RS-232C channel
RS-232C cable
TX
RX
PLC
CPU RS-422 channel
RS-422 cable
TX
RX
Remark
1. The change of mode switch position is not effected until the power of Cnet is cycled. Please
turn off the Cnet module whenever change the mode switch setting.
2. In stand-alone mode, the data structure of RS-232C and RS-422 channels should be
written and downloaded separately with frame editor before starts the operation.
4-4
Chapter 4 Operation of Cnet module MASTER-K
Signal direction
Pin
Name Function External Description
No. Cnet
device
DTC reports the carrier detection to
1 CD Carrier detect
the DTE
Received
2 RxD Received data signal
data
Transmitted
3 TxD Transmitted data signal
data
Data terminal DTE reports communication ready
4 DTR
ready to the DTC
Signal
5 SG Ground pin for signal
ground
Data set DCE reports communication ready
6 DSR
ready to the DTE
Request to DTE request data transmission to
7 RTS
send the DCE
DCE reports data transmission
8 CTS Clear to send
ready to the DTE
DCE reports the ringing tone
9 RI Ring
reception to the DTE
DTE : Data Terminal Equipment
DCE : Data Communication Equipment
The RS-232C channel can communicate through direct or modem connection. When
communicate through modem, the ‘type’ of basic parameter should be set as ‘dial-up
modem’ or ‘dedicated modem’ in the frame editor. When the Cnet module is directly
connected to external device, the ‘type’ should be set as ‘null-modem’.
However, if the operation mode is interlocking mode, only null-modem type is available.
4-5
Chapter 4 Operation of Cnet module MASTER-K
If an external device uses CD signal (use handshake function), connect Cnet module
and external device as following table.
4-6
Chapter 4 Operation of Cnet module MASTER-K
If the external device does not use CD signal (no handshake function), connect the
Cnet module and external device as following table. In general, personal computers
are typical devices that don’t care CD signal.
When connect two Cnet modules without handshake function, please connect as
following table.
4-7
Chapter 4 Operation of Cnet module MASTER-K
Signal direction
Pin No. Name Function
Cnet External devices
1 RDA Received data (+)
2 RDB Received data (–)
3 SDA Transmitted data (+)
4 SDB Transmitted data (–)
5 SG Signal ground
6 FG Frame ground
1) RS-422
To use RS-422 protocol, set the ‘type’ as ‘RS-422’ in basic parameter. The following table
shows that how to connect Cnet module and external devices.
Cnet module
Connection and signal direction External devices
Pin No. Name
1 RDA RDA
2 RDB RDB
3 SDA SDA
4 SDB SDB
5 SG SG
6 FG FG
4-8
Chapter 4 Operation of Cnet module MASTER-K
2) RS-485
To use RS-485 communication (multi-drop), select ‘RS-485’ in the ‘type’ of basic
parameter setting. The following table shows the connection diagram of RS-485 network.
Cnet module
Connection and signal direction External devices
Pin No. Name
1 RDA RDA
2 RDB RDB
3 SDA SDA
4 SDB SDB
5 SG SG
6 FG FG
Remark
Some old Cnet modules produced before March of 1997 may have different pin-out. The A
(RDA, SDA) and B (RDB, SDB) are exchanged in those Cnet modules. Therefore, please
connect as following figure when the old Cnet modules don’t operate correctly.
[RS-422] [RS-485]
Old Cnet module Current Cnet module Old Cnet module Current Cnet module
or other devices or other devices
RDA RDA RDA RDA
SG SG SG SG
FG FG FG FG
4-9
Chapter 4 Operation of Cnet module MASTER-K
Remark
1) Only RS-422 channel of K300S and K1000S Cnet version 1.3 (or later) supports 76,800
and 153,600 bps. The Cnet module of K200S provides max. 38,400 bps.
2) In interlocking mode, the Cnet module will operate in null-modem mode even though the
parameter is set as dial-up modem or dedicated modem
4-10
Chapter 4 Operation of Cnet module MASTER-K
4-11
Chapter 4 Operation of Cnet module MASTER-K
6) Input a modem initializing command if the ‘dial-up modem’ or ‘dedicated modem’ type is
selected. The default command is ‘ATZ’, but other initializing command may be required
according network condition. Please refer the following table.
Remark
Each commands can be used in combination. For example, ‘ATX1’ and ‘ATM1’ commands
can be used as ‘ATX1M1’.
7) Set other parameters such as baud rate, data bit, stop bit, etc.
8) After parameter setting is finished, download parameters to the Cnet module by each
channel. At first, connect the CPU module and PC with KGL-WIN cable. (Do not connect
Cnet module with PC)
4-12
Chapter 4 Operation of Cnet module MASTER-K
9) Choose Option – Port in menu, then the following screen will appear. Select the COM
port that are connected to the KGL-Win cable, and press ‘OK’ button.
10) Choose Online – Connect in menu to connect frame editor to the CPU. If the
connection is successful, the following massage will be displayed.
If the connection fails, there are two error messages according to the cause of failure.
There is no response within a specified time. (Time-out error)
If the above message window is displayed, it means that PC and CPU module are not
connected or the connection cable is bad. Please check the connection between PC and
CPU module.
4-13
Chapter 4 Operation of Cnet module MASTER-K
If the above message window is displayed, it means that there is a crash between the
designated COM port and other device. It could be a peripheral such as mouse or a
software that uses COM port such as KGL-WIN. Please check the COM port
configuration, and remove the crashing device or software.
11) After the connection is completed, choose Online – Write in menu to write parameters
to the Cnet module.
Choose the slot number at which the Cnet module is mounted, and select ‘Basic
Parameters’ in the option. Press ‘Write’ button to start downloading.
Remark
If there is a user-defined frame to be downloaded, select ‘Frames’ in option items. Then only
the user-defined frame will be downloaded to Cnet module. If the ‘All’ item is selected, both of
parameters and user-defined frame will be downloaded.
4-14
Chapter 4 Operation of Cnet module MASTER-K
The following message will appears when the parameter is downloaded successfully.
12) The Cnet module will stop operation automatically after the parameters download is
completed. Therefore, the Cnet module should be started by user. To start the Cnet module,
choose Online – Change Comm. in menu, then select the slot number and channel type
(RS-232C or RS-422). Press the ‘start’ button to start the Cnet operation.
4-15
Chapter 4 Operation of Cnet module MASTER-K
1) Choose Online – connect to connect the frame editor to the CPU module.
2) After the connection is completed, choose Online – Read in menu. The following
message window will appear.
Select the slot number at which the Cnet module is mounted, channel to be read (RS-
232C or RS-422), and what information to be read (parameter, frames, or both). Then
press ‘Read’ button and the read data will be displayed.
4-16
Chapter 4 Operation of Cnet module MASTER-K
The Cnet module of which O/S version is v2.0 or later supports the on-line mode. In the on-line
mode, use can change the operation mode of Cnet module via frame editor software, and it
doesn’t need to cycle the power of Cnet module after changing the mode setting switch.
Therefore, it is possible to change operation mode while the Cnet module is running.
The features of on-line mode are as following;
Mode switch position of on-line mode : 9
Set the operation mode separately for each channels (RS-232C, RS-422)
User can change the operation mode of local / remote1) Cnet module
The operation mode setting is stored in built-in flash memory, so the operation
mode is kept while the power of Cnet module is off.
Supports a new operation mode, ‘Library mode’, and this operation mode can be
entered in the on-line mode only.
1) Position the mode setting switch of Cnet module at ‘9’, and turn the power on.
2) Connect the frame editor (version 2.0 or later) to the CPU by choosing Online –
Connect. After the connection is completed, choose Online – Mode in menu. The following
screen will be displayed.
4-17
Chapter 4 Operation of Cnet module MASTER-K
4-18
Chapter 4 Operation of Cnet module MASTER-K
8) The Cnet module v2.0 (or later) supports a ‘Library Mode’. In library mode, the Cnet
module operates according to a library that are downloaded to the Cnet module. Please refer
the chapter 6.1.7 for details.
Caution
Make sure to download a library file to the Cnet module before change the operation mode to
the library mode. If the operation mode is changed to library mode without downloaded library,
the Cnet module will malfunction. It will not operate normally until a library is downloaded at
the flash memory write mode.
9) The downloaded operation mode is stored in flash memory, and the Cnet module will
start with the previously downloaded operation mode when it is turned on.
10) The downloaded operation mode is valid only when the mode setting switch is at ‘9’
position. Otherwise, the Cnet module operates with the mode designated by switch setting.
11) To read the operation mode of Cnet module, choose the slot number and press the
‘Read’ button. The following screen will be displayed after reading is completed.
12) The operation mode reading is available in all operation modes of Cnet, except ‘Loop-
back’ and ‘Flash memory write’ mode.
Remark
The Cnet module will stop operation about 1 second after the operation mode is changed.
4-19
Chapter 4 Operation of Cnet module MASTER-K
Both of local and remote Cnet modules should be at the online mode.
Only RS-232C connection is available. If two Cnet modules are connected via RS-
422/485 channel, operation mode change is not available.
It is available to read the operation mode of remote Cnet module.
After the operation mode is changed, the Cnet module will stop about 1 second,
then restart operation in the new operation mode.
The RS-232C channel setting of two Cnet modules (local and remote) should be
same.
The version of Cnet O/S and frame editor must be v2.0 or later.
Output module
Power module
Power module
Input module
Input module
CPU module
Cnet module
CPU module
Cnet module
RS-232C, RS-232C,
Onlne mode Onlne mode
Dedicated Dedicated
MODEM MODEM
Dedicated
network line
4-20
Chapter 4 Operation of Cnet module MASTER-K
The procedure to change the operation mode of remote Cnet module is as following;
1) Set the operation mode switch of local and remote Cnet module at the ‘9’ position (online
mode) and turn on the power of both systems.
2) Check the RS-232C communication between local and remote Cnet module. If they
operates well, connect the frame editor to the CPU module of local system and then choose
Online – Mode in menu of frame editor. (Refer the chapter 4.4.1 for details) The following
screen will be displayed.
3) Select the slot number at which the local Cnet module is mounted. (Do not select the slot
number of remote module). Set the location as ‘Remote’, and set the operation mode to be
downloaded to the remote Cnet module.
4) After setup is finished, press ‘Write’ button to change the operation mode of remote Cnet
module.
4-21
Chapter 4 Operation of Cnet module MASTER-K
The Cnet module of which O/S is 1.7 or earlier operates as only slave station in dedicated
mode. When two MASTER-K Cnet modules communicate, therefore, one Cnet module
set as master station and another module set as slave station. Then the master module
should be set as user-defined mode, and download a LGIS’s dedicated protocol written
with frame editor.
With the Cnet v2.0 or later, Cnet module can operate as master station in the dedicated
mode. Therefore, only basic parameter setting is required when two MK Cnet modules
communicate each other. (No protocol downloading).
The ‘Write’ and ‘Read’ instructions are used for dedicated communication between MK
Cnet modules, and have following features.
Supports independent programming for RS-232C and RS-422 channel
Read / write multiple blocks (max. 110 bytes) is available by using continuous read
/ write instruction of dedicated protocol.
The communication status is stored at the designated memory area.
Remark
1. When a master station communicates with multiple slave stations via RS-422 channel, write
sequence program as each instruction does not execute at the same time. Otherwise, the
transmitted / received data may be conflicted.
2. To use ‘Read’ and ‘Write’ instruction, the O/S of master station should be v2.0 or later.
However, the O/S of slave station can be 1.7 or earlier.
3. Both of RS-232C channel of master and slave station should be set as the dedicated mode.
4-22
Chapter 5 System configuration
5 System configuration
Master K PLC
P C I O C
W P N U L
R U T M
RS-232C
RS-422
IBM Compatible
Network devices
Type Device name Mode setting Station number
PC Built-in RS-232C – –
MASTER-K PLC K7F-CUEA 3 0 ~ 31
5-1
Chapter 5 System configuration MASTER-K
P C I O C P C I O C
W P N U L W P N U L
R U T M R U T M
RS-232C RS-232C
RS-422 RS-422
Network devices
Type Device name Mode setting Station number
MASTER-K PLC K7F-CUEA 2 0 ~ 31
Other manufacturer’s PLC – – –
5-2
Chapter 5 System configuration MASTER-K
IBM Compatible
MODEM
MODEM
P C I O C P C I O C
W P N U L W P N U L
R U T M R U T M
RS-232C RS-232C
RS-422 RS-422
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC Built-in RS-232C – –
MASTER-K PLC K7F-CUEA 2 0 ~ 31
Other manufacturer’s PLC – – –
5-3
Chapter 5 System configuration MASTER-K
RS-232C Interface
IBM Compatible
P C I O C P C I O C
W P N U L W P N U L
R U T M R U T M
RS-232C RS-232C
RS-422 RS-422
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC Built-in RS-232C – –
MASTER-K PLC K7F-CUEA 5 0 ~ 31
Other manufacturer’s PLC – – –
5-4
Chapter 5 System configuration MASTER-K
RS-232C Interface
IBM Compatible
MODEM
MODEM
P C I O C P C I O C P C I O C
W P N U L W P N U L W P N U L
R U T M R U T M R U T M
RS-232C RS-232C RS-232C
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC Built-in RS-232C – –
MASTER-K PLC # 0 K7F-CUEA 3 0
MASTER-K PLC # 1 K7F-CUEA 3 1
5-5
Chapter 5 System configuration MASTER-K
RS-232C Interface
IBM Compatible
P C I O C P C I O C P C I O C
W P N U L W P N U L W P N U L
R U T M R U T M R U T M
RS-232C RS-232C RS-232C
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC Built-in RS-232C – –
MASTER-K PLC # 0 K7F-CUEA 3 0
MASTER-K PLC # 1 K7F-CUEA 3 1
5-6
Chapter 5 System configuration MASTER-K
RS-232C Interface
IBM Compatible
MODEM
MODEM
P C I O C P C I O C P C I O C
W P N U L W P N U L W P N U L
R U T M R U T M R U T M
RS-232C RS-232C RS-232C
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC Built-in RS-232C – –
MASTER-K PLC # 0 K7F-CUEA 5 0 ~ 31
Other manufacturer’s PLC # 1 – – –
5-7
Chapter 5 System configuration MASTER-K
RS-232C Interface
IBM Compatible
P C I O C P C I O C P C I O C
W P N U L W P N U L W P N U L
R U T M R U T M R U T M
RS-232C RS-232C RS-232C
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC Built-in RS-232C – –
MASTER-K PLC # 0 K7F-CUEA 5 0 ~ 31
Other manufacturer’s PLC # 1 – – –
5-8
Chapter 5 System configuration MASTER-K
PC #1 Master-K PLC #2 PC #N
P C I O C
W P N U L
R U T M
RS-232C
RS-422
IBM Compatible IBM Compatible
P C I O C P C I O C P C I O C
W P N U L W P N U L W P N U L
R U T M R U T M R U T M
RS-232C RS-232C RS-232C
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC # 1 Built-in RS-232C – –
MASTER-K PLC # 2 K7F-CUEA 3 1
PC # N Built-in RS-232C – –
MASTER-K PLC # 1 K7F-CUEA 5 0
MASTER-K PLC # 2 K7F-CUEA 3 1
5-9
Chapter 5 System configuration MASTER-K
P C I O C P C I O C
W P N U L W P N U L
R U T M R U T M
RS-232C RS-232C
RS-422 RS-422
IBM Compatible
P C I O C P C I O C P C I O C
W P N U L W P N U L W P N U L
R U T M R U T M R U T M
RS-232C RS-232C RS-232C
RS-422 Interface
Network devices
Type Device name Mode setting Station number
PC # 1 Built-in RS-232C – –
Other manufacturer’s PLC # 2 – – –
5-10
Chapter 6 User-defined communication
6 User-defined communication
6.1 Introduction
Because of the difference between the protocols of each manufacturer’s communication module,
it is impossible to build a network system that the MASTER-K Cnet module and other
manufacturer’s communication module communicate with their own protocol.
In order to communicate the other communication device, the MASTER-K Cnet module should
have the protocol of the device to communicate with.
The frame editor is software used for writing a user-defined protocol and downloading it to the
MK Cnet module. Each user-defined protocols (hereafter, call it as Frame) have a names, and
they are used in a sequence program with SND and RCV instructions.
In this chapter, it is described how to use the frame editor software package and SND / RCV
instructions.
6-1
Chapter 6 User-defined communication MASTER-K
Channel selecting
radio button
Basic parameter
and modem
initializing
command setting
Shows
information of
user-defined
frame
Frame list
6-2
Chapter 6 User-defined communication MASTER-K
2) Menu configuration
Main Sub
Functions Remark
menu menu
New Create a new frame file (*.frm)
Open Load a frame file
Save Save current frame setting as a file (overwrite)
File Save as Save current frame setting as a new file
Available with the
Load a library for communication with other
Open Lib frame editor v2.0 or
manufacturer’s device.
later
Exit Quit frame editor software
Connect Connect frame editor to the PLC CPU module
Disconne
Disconnect frame editor from the CPU module
ct
Read (upload) the parameter and frame data from
Read
the Cnet module
Online Write (download) the parameter and frame data to
Write
the Cnet module
Change Run or stop the operation of each channels (RS-
Comm. 232C / RS-422)
Available with the
Change the operation mode of Cnet module via
Mode frame editor v2.0 or
RS-232C channel. (Remote mode change)
later
Option Port Select a COM port that communicate with
Receive
Monitor the data that the Cnet module receive
Frame
Monitor
Send Only the RS-232C
Monitor the data that the Cnet module send
Frame channel is available
6-3
Chapter 6 User-defined communication MASTER-K
(RS-232C) (RS-422)
Modem
Station number initializing
(0 ~ 31) command
6-4
Chapter 6 User-defined communication MASTER-K
6-5
Chapter 6 User-defined communication MASTER-K
Input a frame name. The name can be consist of all characters such as alphabet or
numbers. It is used for an identifier in the sequence program.
Select the direction of data. When write sending frame, choose ‘Send’ as following
figure 6.5
6-6
Chapter 6 User-defined communication MASTER-K
Set a header of frame. In general, a control character such as ENQ (Enquire, ASCII
code h05), STX (Start text, ASCII code h02), or ACK (Acknowledge, ASCII code h06)
is used for a header. However, it could be a number, other character, or a combination
of them. The start and end of header should be ‘[‘ and ‘]’ as following figure 6.6
Set a data to be sent according to segment. The data frame is divided by segment to
distinguish fixed data area (Constant) and variable data area (Array). The required
data of the segment set as array is inputted in the sequence program. The maximum
size of constant segment is 30 bytes, and the array segment is 240 bytes in ASCII
format. The following figure 6.7 shows an example of segment setting.
When the constant segment is set as HEX type, the data should be set as 2 or even
bytes (example : 11, 1234, FFAC03, 68AB32CD, etc)
The name of array segment should be given as only ‘SD1.’.
The size of array segment is determined as byte unit. When the data format of array
segment is set as ASCII, input the number of characters at the size. (For example, If
the SD1. is ‘ABCD’, the size should be 5.) When the data format of array segment is
set as HEX, the size is the half of number of hexadecimal data. (h1234 = 2 bytes)
Remark
When a segment is assigned as hexadecimal constant, you can not input ‘h0x00’ format.
(example : h0100, h0A00, or h0000) Please use array type if it is need to input ‘h0x00’.
6-7
Chapter 6 User-defined communication MASTER-K
Set a tail of frame. The tail is consist of control characters, numbers, or alphabets like
header. Moreover, the tail can include a BCC check code for error detection. The
following figure 6.8 shows an example of tail setting.
To use the BCC check function, write ‘[BCC]’ at the tail and setting BCC by pressing
the BCC setting button. (see the figure 6.9)
Remark
There are 3 method to mask the BCC such as &(AND), ^(XOR), and |(OR). For example, &FF
means to perform AND operation with BCC and hFF.
6-8
Chapter 6 User-defined communication MASTER-K
Remark
The ‘h’ of ASCII data means the data is hexadecimal format. When write frame, do not use ‘h’.
6-9
Chapter 6 User-defined communication MASTER-K
Low High
Frame STX 0 0 F F 2 4 5 0 1 0
ASCII h05 h30 h30 h46 h46 h32 h34 h35 h30 h31 h30
Frame 2 0 6 3 5 0 ETX BCC1 BCC2
ASCII h32 h30 h36 h33 h35 h30 h04 h34 h41
6 bytes follows ‘00FF’ are received data from external device. (h245010206350). To
receive the data, write a receiving frame as following;
Select a frame number at the frame list.
Input a frame name after the screen as the figure 6.4 appeared.
Set the direction of data. To receive data from external device, select ‘Receive’.
Set a header of frame. It is similar with that of sending frame. In this example, input
[STX] to the header.
Set each segments of frame. When a segment is set as array, use only the ‘RD1.’ for
variable name.
Set the tail of frame.
If it is need to return a response to the external device immediately, write a name of
immediate response frame. The immediate response frame is sent to the external
device by Cnet module, and it is registered at the frame list as sending frame. See the
figure 6.12 for an example of immediate response frame.
Remark
The immediate response frame can have constant segment only. If it contains an array
segment, a communication error will occur.
6-10
Chapter 6 User-defined communication MASTER-K
6-11
Chapter 6 User-defined communication MASTER-K
Run the frame editor, and connect to Cnet module by choosing Online-Connect in
menu. If the connection is completed successfully, the message as the figure 6.14 will
appear. Before trying connection, make sure to quit the other software using COM
port such as KGL-WIN.
OK
Choose Online-Write in menu. Then the screen of the figure 6.15 will appear.
6-12
Chapter 6 User-defined communication MASTER-K
Select the slot at which the Cnet module is mounted, and items to be written
(parameter, frame, or both). Channel to be written is selected in the basic parameter
setting. (See the figure 6.1)
After setting is completed, press the ‘Write’ button. Then the following confirmation
dialog box will appear. (figure 6.16) Press ‘OK’ to download data.
After downloading is completed, switch the Cnet module to RUN mode by choosing
Online – Change Comm. in menu as following figure 6.18
Remark
When downloading the new frame or parameter, the Cnet module is switched to the STOP
mode automatically. For more reliable operation of Cnet module, however, we recommend to
switch the Cnet module to STOP mode before starting download.
6-13
Chapter 6 User-defined communication MASTER-K
Select the slot at which the Cnet module is mounted, and choose the channel and
data type to be read. Then, push ‘Read’ button to upload data.
6-14
Chapter 6 User-defined communication MASTER-K
6.2.6 Monitoring
To check the network operating status, it is need to monitor the actual transmitted data
between Cnet and other devices. A protocol analyzer is generally used for monitoring, but
it is very expensive and need to connect between Cnet module and other device.
The frame editor provides a monitoring function, and it is possible to monitor sending /
receiving data without additional cost or device.
Select the slot at which the Cnet module is mounted, and channel to be monitored.
Then press ‘OK’ button.
6-15
Chapter 6 User-defined communication MASTER-K
After the following screen (figure 6.21) appeared, press ‘Start’ button to start
monitoring.
Monitoring start
Monitoring stop
Close monitoring
window
6-16
Chapter 6 User-defined communication MASTER-K
The following screen shows the frame editor is monitoring received frame.
6-17
Chapter 6 User-defined communication MASTER-K
Select Monitor – Send Frame in menu. The following screen will appear, and select
the basic parameter such as baud rate, data bit, parity bit, and stop bit. Then, press
‘OK’ button.
6-18
Chapter 6 User-defined communication MASTER-K
After the following screen appeared, press ‘Start’ button to start monitoring. The
function of each buttons are similar with that of receive frame monitoring window. (see
the figure 6.22)
To see the send frame data in detail, press the ‘Stop’ button, and change the monitor
mode to ‘View’ mode.
Remark
Send frame monitoring is available with only RS-232C channel. When monitoring RS-422
channel, use RS422-RS232C converter.
6-19
Chapter 6 User-defined communication MASTER-K
sl O
Fnam O O O O O O O
SND snd O O O O O O O 11 O
n O O
SS O O O O O O O
Operand setting
SND sl Fnam snd n SS Slot number of Cnet module is
sl mounted & Type of channel
The configuration of ‘sl’ (RS232C or RS422)
Lower 8 bits (CD) : Slot No. of Cnet Fnam The name of frame (8 words)
AB CD
module snd Start address of device that
Higher 8 bits (AB) : Type of channel stores source data to be sent
h00 : RS232C n Numbers of byte to be sent
h01 : RS422
SS Device at which the link status
is stored
1) Functions
Sends ‘n’ bytes which begin with the device specified as [snd ] to the Cnet module that
mounted on the slot ‘sl’. The name of frame is stored as ASCII format into 8 words which
begin with the device [ Fnam ]. The link status is stored at the device specified as [ SS ].
The maximum size of data block to be sent is 256 bytes.
2) Program example
Program that send 10 bytesm (5 words) from D1234 and frame name (8 words from
D0000) to the Cnet module at slot 3, channel 0 (RS232C). The link status is stored at
K015 word.
6-20
Chapter 6 User-defined communication MASTER-K
sl O
Fnam O O O O O O O
RCV snd O O O O O O O 11 O
n O
SS O O O O O O O
Operand setting
RCV sl Fnam rcv n SS sl Slot number of Cnet module is
mounted & Type of channel
The configuration of ‘sl’ (RS232C or RS422)
Lower 8 bits (CD) : Slot No. of Cnet Fnam The name of frame (8 words)
AB CD
module rcv Start address of device that
Higher 8 bits (AB) : Type of channel stores source data to be sent
h00 : RS232C Numbers of byte to be read
n
h01 : RS422
SS Device at which the link status
is stored
1) Functions
Receives data from the Cnet module mounted on the slot ‘sl’ with the frame of which
name is stored as ASCII format into 8 words which begin with the device [ Fnam ], then
stores the data from the device specified as [ rcv ], and the length of data is stored at [n]
The link status is stored at the device specified as [ SS ].
The maximum size of data block to be sent is 256 bytes.
2) Program example
Program that receive data from channel 1 (RS-422) of the Cnet module at slot 5, with the
frame of which name is stored at 8 words from D0100, and stores received data to the
block which begin with D0200. The number of received data (bytes) are stored at D1000,
and the link status is stored at K016 word.
6-21
Chapter 6 User-defined communication MASTER-K
sl O
St O O O O O O O O O
D O O O O* O O O O
READ 13 O
S O O O O O O O O O
n O O
SS O O O O* O O O O
READ sl st D S n SS
Operand setting
Slot number on which the Cnet Station number of remote station
sl St
module is mounted and comm. channel. (4 words)
Start address of master station Start address of remote station at
D S
at which read data is stored which data to be read
Device at which the link status is
n Numbers of word to be read SS
stored
Configuration of ‘St’
Upper 2 words Lower 2 words
Channel selection
Station number
0: RS-232C 1: RS-422
* Available only when do not use computer link module or data link module
1) Functions
Reads ‘n’ words which begin with the address [ S ] of the remote station that has station
number ‘St’ through the Cnet or Fnet module mounted at the slot ‘sl’, and store the read
data to the block which begin with the address [ D ] of the master station. The link status
is stored at the address ‘SS’ of the master station.
6-22
Chapter 6 User-defined communication MASTER-K
[S] [D]
Cnet
Cnet
module
module
Station
Slot No. [ SS ] Link status
= ‘sl’
No =’St’
An instruction error occurs when the assress [ S+n ] or [ D+n ] is out of the range of
specified device.
Execution conditions
Input condition
READ
Executed only once Executed only once
2) Program example
Program that read 20 words which begin with D0200 of remote station (Station No. of
FUEA module is stored at 4 words block begin with D0010) through the FUEA module of
slot number 2, and store the read data to the block which begin with D0300. The link
status is stored at the M020 word. Assume that the value of D0010 ~ D0013 is h0000
001D 0000 0000 (Station number : h1D, Channel : RS-232C)
D020 D030
0
20 words 20 words
Cnet Cnet
module module
at
Station slot No. M020 Link status
No =h1D = 02
6-23
Chapter 6 User-defined communication MASTER-K
sl O
St O O O O O O O O O
D O O O O* O O O O
WRITE 13 O
S O O O O O O O O O
n O O
SS O O O O* O O O O
WRITE sl st D S n SS
Operand setting
Slot number on which the Cnet Station number of remote station
sl St
module is mounted and comm. channel. (4 words)
Start address of master station Start address of remote station at
D S
at which source data is stored which data to be stored
Device at which the link status is
n Numbers of word to be written SS
stored
Configuration of ‘St’
Upper 2 words Lower 2 words
Channel selection
Station number
0: RS-232C 1: RS-422
* Available only when do not use computer link module or data link module
1) Functions
Transmits the data block (n words) begin with [D] of master station to the data block (n
words) begin with [S] of remote station. Data transmission is performed via a Cnet (or
Fnet) module mounted at the slot ‘sl’ of master station. The station number of remote
station and communication channel is assigned by ‘St’ (4 words). After communication is
completed, the status is stored at the [SS] of master station.
6-24
Chapter 6 User-defined communication MASTER-K
[S] [D]
Cnet
Cnet
module
module
at
Station
Slot No. [ SS ] Link status
= ‘sl’
No =’St’
An instruction error occurs when the assress [ S+n ] or [ D+n ] is out of the range of
specified device.
Execution conditions
Input condition
WRITE
Executed only once Executed only once
2) Program example
Program that writes 20 words which begin with D0200 of remote station (Station No. of
FUEA module is stored at 4 words block begin with D0010) through the FUEA module of
slot number 2, and store the read data to the block which begin with D0300. The link
status is stored at the M020 word. Assume that the value of D0010 ~ D0013 is h0000
001D 0000 0001 (Station number : h1D, Channel : RS-422)
D0200 D0300
20 words 20 words
Cnet Cnet
module module
at
Station slot No. M020 Link status
No =h1D = 02
6-25
Chapter 6 User-defined communication MASTER-K
6.4.1 Introduction
To communicate with other manufacturer’s PLC without writing an user-defined frame, the
‘Library mode’ is added to the MASTER-K Cnet module v2.0. In the library mode, the
Cnet module will communicate with other manufacturer’s device according to the library
downloaded to the Cnet module, and no frame setting is required. (Set basic parameters
only)
The following figure 6.52 shows an example of system configuration.
C
P C O n
I e
W P U
N t
R U T
RS-232C
RS-422
1. AB DH+
2. Modbus RTU/ASCII
The frame editor includes two libraries for AB Data Highway and MODBUS. With these
libraries, the MASTER-K Cnet module can operate as a ‘Server’ station. It can not
operate as ‘Client’.
Remark
Make sure a library file is downloaded to the Cnet module before changing the operation
mode of Cnet module to the ‘Library mode’. The Cnet module will be malfunctioned
immediately if a library mode is selected without downloaded library file. The Cnet module will
operate normally after downloading a library file.
6-26
Chapter 6 User-defined communication MASTER-K
Network
Select a library file, and press ‘OK’ button. Then select Online – Flash Memory – Write
in the menu. Type the slot number at which the Cnet module is mounted, and press
‘Write’ button.
6-27
Chapter 6 User-defined communication MASTER-K
When the following message appears, check the slot number or operation mode of Cnet
module.
It is also available to read information of library file previously downloaded in the flash
memory. Select Online – Flash Memory – Information in menu, then following screen
will appear. Choose the slot number at which the Cnet module is mounted, then press the
‘Read’ button.
6-28
Chapter 6 User-defined communication MASTER-K
After library is downloaded successfully, disconnect the frame editor and turn off the
power of PLC system. Then set the operation mode of Cnet module to ‘Online’ mode, turn
on the power of PLC system, and connect the frame editor.
Remark
To use ‘Library mode’, the Cnet module should be set as ‘Online mode’. The library
mode only can be available through online mode selection. Please refer the chapter 4.4
for details.
Select Online – Mode in menu, then following screen will appear. Choose communication
channel (Stand-alone / Interlocking) and operation mode for each channels (RS-232C /
RS-422).
Remark
Do NOT quit frame editor or turn off the PC while a library file is being downloaded to
the Cnet module. It may cause a fatal error to the Cnet module by damaging the O/S
data of Cnet module.
6-29
Chapter 6 User-defined communication MASTER-K
C
P C O n
I
W P U e
N t
R U T
RS-232C
RS-422
1) Basic specifications
Character setting : Start / Stop / Data / Parity setting (using frame editor)
Supports AB DH+ full duplex protocol
Baud rate : 300 ~ 38,400 bps.
Supported control symbols
Symbol Type Description
DLE STX Control Start symbol of message (Client)
DLE ETX BCC / CRC Control End symbol of message (Client)
DLE ACK Control Receiving completion message (Server)
DLE NAK Control Receiving failure message (Server)
DLE ENQ Control Request symbol of re-send response frame
(Client)
APP DATA Data User data (h00 ~ h0F or h11 ~ h1F)
DLE DLE Control A hexadecimal data of h0x10
BCC check : 2’s complement value of the sum of application data excludes message
start / end symbols. It follows after the end symbol of application data.
6-30
Chapter 6 User-defined communication MASTER-K
5) Other features
Maximum size of a frame : 110 bytes
Supports both of ‘logical binary addressing’ and ‘ASCII addressing’
6-31
Chapter 6 User-defined communication MASTER-K
C
P C O n
I
W P U e
N t
R U T
RS-232C
RS-422
Modbus ASCII/RTU
1) Basic specifications
Character : Start / Stop / Data / Parity can be set with frame editor.
Baud rate : 300 ~ 38,400 (independent setting for RS-232C and RS-422 channels)
Station number : 1 ~ 31
6-32
Chapter 6 User-defined communication MASTER-K
03070 M191E
03071 M191F
3xxxx M000 word is not used
Word Mxxxx + 1
4xxxx xxxx : 0 ~ 190
6-33
Chapter 7 Dedicated communication
7 Dedicated communication
7.1 Introduction
MASTER-K Cnet module includes a dedicated protocol for communication with external devices.
It enables that an external device reads/writes data from/to the MASTER-K PLC through Cnet
module if the external device send a data frame complying with the dedicated protocol. The
features of dedicated protocol is as following;
RS-232C and RS-422 channels can communicate independently according to mode
setting.
Multi-drop network is available by assigning a station number to Cnet modules. (Max.
32 station can be connected.)
Error check (BCC check) is available (Optional)
Cnet: mode 3
External device
Request
Response
To use dedicated communication, set the mode switch of Cnet module as following table.
Switch Operation mode
Remarks
position RS-232C RS-422
1 Dedicated Dedicated Interlocking mode
3 Dedicated Dedicated
4 User-defined Dedicated
Stand-alone mode
5 Dedicated User-defined
7 KGL-WIN Dedicated
4)
9 On-line On-line mode change
Remark
7-1
Chapter 7 Dedicated communication MASTER-K
Remark
The following table describes several control codes. They are importantly used in
dedicated or other serial communication, so they should be well acquainted.
Hex
Code Original word Description
value
ENQ (Header) h05 Enquire Start of request frame
ACK (Header) h06 Acknowledge Start of ACK response frame
NAK (Header) h15 Not acknowledge Start of NAK response frame
EOT (Tail) h04 End of text End or request frame
ETX (Tail) h03 End of transmission End of response frame
7-2
Chapter 7 Dedicated communication MASTER-K
Instruction
Main command Command type
Item Description
ASCII ASCII
Symbol Symbol
code code
h72 Read a single bit or word
Single r (R) SS h5353
(h52) from PLC
Read
Remark
1. The CPU doesn’t care capital or small letter in frame except main command. For example,
‘%MW100’ and ‘%mw100’ have same meaning. However, if the main command is written in
small letter, the BCC check will be executed.
2. When read or write a bit, the last digit of address should be a capital letter.
Example) %mx001f (X)
%mx001F (O)
7-3
Chapter 7 Dedicated communication MASTER-K
% M W 0 1 2 3
Device number
Data type
Device type
Start of data
7-4
Chapter 7 Dedicated communication MASTER-K
Remark
When read or write S device, address should be assigned in word type although step
controllers are handled as bit type. See following examples for details.
1) Turn on S00.07 : Write 07 (decimal) to the %SW0000
2) Turn on S05.15 : Write 15 (decimal) to the %SW0005
3) Clear S10 set : Write 00 to the %SW0010
4) Read S23 set : Read the %SW0023. Returned ASCII value shows which bit
is turned on among 00 ~ 99 of the assigned set.
(If the S23.47 is on, the CPU will return h3437 = 37)
Remark
In the above examples, device numbers are consist of 4 digits and it is the recommended
format of MASTER-K series. However, 2 ~ 8 digits are allowed to express a device number.
Example) %MX01 = %MX001 = … = %MX0000001 = %MX00000001
%DW31 = %DW031 = … = %DW0000031 = %DW00000031
7-5
Chapter 7 Dedicated communication MASTER-K
Length of
Format Station Main Instruction Number of Frame
Header device Device definition Tail
name number instruction type blocks check
definition
Frame …
ENQ h20 R (r) SS h01 h06 %MW100 EOT BCC
example
ASCII
h05 h3230 h52 (h72) h5353 h3031 h3036 h254D57313030 h04
value
1 block
(Max. 16 blocks available)
BCC : When the main instruction is small character (r), the lower byte of summation
from ENQ to EOT is converted into ASCII format and added to frame as BCC check.
Number of blocks : It indicates how many blocks ( block : length of device definition +
device definition ) are following, and maximum number of blocks is 16. Therefore, the
range of block number is h01 ~ h10 (ASCII code : h3031 ~ h3130).
Length of device definition : It indicates that the device definition include ‘%’ occupies
how many bytes after converted to ASCII code (1byte = 2 ASCII codes). The
available range is h01 ~ h10 ( ASCII format : h3031 ~ h3130 )
Example : %MW000 = h06
%MX0000 = h07
Device definition : It indicates an actual address to be read. It should be consist of ‘%’,
device type (capital or small letter), and numbers only.
Remark
1. The ‘h’ is added to show the numeric data is hexadecimal format. When you write frame,
please do not add ‘h’ to actual numeric data.
2. All blocks in one frame should have same data type. If the data type of first block is bit and
that of second is word, an error will occurs.
7-6
Chapter 7 Dedicated communication MASTER-K
1 block
(Max. 16 blocks available)
Station number, main instruction, instruction type, and number of blocks are same as
the request format.
When the main instruction is small character (r), the lower byte of summation from
ACK to ETX is converted into ASCII format and added to frame as BCC check.
The length of data indicates that the following data occupies how many bytes before
converted to ASCII code. It is determined on basis of the data type included in
request format.
In data area, the contents of assigned device are stored after converted to ASCII
code.
Example : When the contents is h48B0, the ASCII code will be h34384230
Remark
Although the data type is bit, the data should be a byte because the minimum data unit is a
byte. If the content of bit is 0, the data is h00 (ASCII code : h3030) and if the content is 1, the
data is h01(ASCII code : h3031).
7-7
Chapter 7 Dedicated communication MASTER-K
Station number, main instruction, and instruction type are same as the request format.
When the main instruction is small character (r), the lower byte of summation from
NAK to ETX is converted into ASCII format and added to frame as BCC check.
The error code is expressed as 2 byte of hexadecimal format ( 4bytes of ASCII
codes) and indicates the type of error. Please refer the error code table for details.
5) Example
Read the contents of first word of P area ( P000 ) and 21th word of M area ( M020 ) from
the PLC of that station number is h01. Assume the contents of P000 is h1234, and M020
is h3456. ( No BCC check )
7-8
Chapter 7 Dedicated communication MASTER-K
Length of
Format Station Main Instruction Number of Frame
Header device Device definition Tail
name number instruction type data check
definition
Frame
ENQ h10 R (r) SB h06 %MW100 h02 EOT BCC
example
ASCII
h05 h3130 h52 (h72) h5342 h3036 h254D57313030 h3032 h04
value
BCC : When the main instruction is small character (r), the lower byte of summation
from ENQ to EOT is converted into ASCII format and added to frame as BCC check.
Length of device definition : It indicates that the device definition include ‘%’ occupies
how many bytes after converted to ASCII code (1byte = 2 ASCII codes). The
available range is h01 ~ h10 ( ASCII format : h3031 ~ h3130 )
Example : %MW000 = h06
%PW0000 = h07
Device definition : It indicates an actual address to be read. It should be consist of ‘%’,
device type (capital or small letter), and numbers only.
Number of data : It indicates that how many words will be read from the start address.
The range is h01 ~ h3C (1 ~ 60).
Remark
The continuous reading command does not support bit data type.
7-9
Chapter 7 Dedicated communication MASTER-K
Station number, main instruction, and instruction type are same as the request format.
When the main instruction is small character (r), the lower byte of summation from
ACK to ETX is converted into ASCII format and added to frame as BCC check.
Number of data : It indicates that the following data occupies how many bytes in
hexadecimal format (before converted to ASCII code). It can be obtained by
multiplying data type (1 word = 2 byte) and number of data in the request format.
Station number, main instruction, and instruction type are same as the request format.
When the main instruction is small character (r), the lower byte of summation from
NAK to ETX is converted into ASCII format and added to frame as BCC check.
The error code is expressed as 2 byte of hexadecimal format ( 4bytes of ASCII
codes) and indicates the type of error. Please refer the error code table for details.
7-10
Chapter 7 Dedicated communication MASTER-K
10) Example
Read the contents of 2 words from the first word of M area (M000), and the station
number of PLC is 10 (h0A). Assume that the content of M000 is h1234 and M0001 is
h5678.
7-11
Chapter 7 Dedicated communication MASTER-K
Length of
Format Station Main Instruction Number of Frame
Header device Device definition Tail
name number instruction type blocks check
definition
Frame …
ENQ h20 W (w) SS h01 h06 %MW100 EOT BCC
example
ASCII
h05 h3230 h57 (h77) h5353 h3031 h3036 h254D57313030 h04
value
1 block
(Max. 16 blocks available)
BCC : When the main instruction is small character (w), the lower byte of summation
from ENQ to EOT is converted into ASCII format and added to frame as BCC check.
Number of blocks : It indicates how many blocks ( block : length of device definition +
device definition ) are following, and maximum number of blocks is 16. Therefore, the
range of block number is h01 ~ h10 (ASCII code : h3031 ~ h3130).
Length of device definition : It indicates that the device definition include ‘%’ occupies
how many bytes after converted to ASCII code (1byte = 2 ASCII codes). The
available range is h01 ~ h10 ( ASCII format : h3031 ~ h3130 )
Example : %MW000 = h06
%MX0000 = h07
Device definition : It indicates an actual address where data is written. It should be
consist of ‘%’, device type (capital or small letter), and numbers only.
Data : This area contains the data to be written in ASCII code format. The length of
data is determined on basis of data type. If the data type is word, the length is 2 byte
(1word) and if the data type is bit, the length is 1 byte.
Example : Write 0 to a bit device : h00
Write 1 to a bit device : h01
Write h0001 to a word device : h0001
Write h1234 to a word device : h1234
7-12
Chapter 7 Dedicated communication MASTER-K
Remark
1. The ‘h’ is added to show the numeric data is hexadecimal format. When you write frame,
please do not add ‘h’ to actual numeric data.
2. All blocks in one frame should have same data type. If the data type of first block is bit
and that of second is word, an error will occurs.
Format
Header Station number Main instruction Instruction type Tail Frame check
name
Frame
ACK h20 W (w) SS ETX BCC
example
ASCII
h06 h3230 h57 (h77) h5353 h03
value
Station number, main instruction, and instruction type are same as the request format.
When the main instruction is small character (w), the lower byte of summation from
ACK to ETX is converted into ASCII format and added to frame as BCC check.
Station number, main instruction, and instruction type are same as the request format.
When the main instruction is small character (w), the lower byte of summation from
NAK to ETX is converted into ASCII format and added to frame as BCC check.
The error code is expressed as 2 byte of hexadecimal format ( 4bytes of ASCII
codes) and indicates the type of error. Please refer the error code table for details.
7-13
Chapter 7 Dedicated communication MASTER-K
5) Example
Write h1234 to the first word of P area ( P000 ) of the PLC of that station number is h01.
( No BCC check )
7-14
Chapter 7 Dedicated communication MASTER-K
BCC : When the main instruction is small character (w), the lower byte of summation
from ENQ to EOT is converted into ASCII format and added to frame as BCC check.
Length of device definition : It indicates that the device definition include ‘%’ occupies
how many bytes after converted to ASCII code (1byte = 2 ASCII codes). The
available range is h01 ~ h10 ( ASCII format : h3031 ~ h3130 )
Example : %MW000 = h06
%PW0000 = h07
Device definition : It indicates an actual start address where data is written. It should
be consist of ‘%’, device type (capital or small letter), and numbers only.
Number of data : It indicates that how many words to be written from the start
address assigned by device definition. If the number of data is 5, for example, it
means that the length of data is 5 words. The range is 0 ~ 60 words (h00 ~ h3C)
Data : This area contains the data to be written in ASCII code format.
Remark
The continuous writing command does not support bit data type.
7-15
Chapter 7 Dedicated communication MASTER-K
Station number, main instruction, and instruction type are same as the request format
When the main instruction is small character (w), the lower byte of summation from
ACK to ETX is converted into ASCII format and added to frame as BCC check.
Station number, main instruction, and instruction type are same as the request format.
When the main instruction is small character (w), the lower byte of summation from
NAK to ETX is converted into ASCII format and added to frame as BCC check.
The error code is expressed as 2 byte of hexadecimal format ( 4bytes of ASCII
codes) and indicates the type of error. Please refer the error code table for details.
7-16
Chapter 7 Dedicated communication MASTER-K
5) Example
Write hAA15 and h056F to the P000 and P001 of station number h01. (Without BCC)
7-17
Chapter 7 Dedicated communication MASTER-K
BCC : When the main instruction is small character (x), the lower byte of summation
from ENQ to EOT is converted into ASCII format and added to frame as BCC check.
Registration number : Max. 10 numbers can be registered. If a registration number is
already exist, the old registration number is replaced with new one.
Registration format
The registration format is same as the read single/continuous device command, but
the header, station number, EOT, and BCC is not included. See the following
examples for details.
a) Read single device
Main Instruction Number of Length of device
Device definition
instruction type blocks definition
…
R (r) SS h01 h06 %MW100
h52 (h72) h5353 h3031 h3036 h254D57313030
1 block
(Max. 16 blocks available)
7-18
Chapter 7 Dedicated communication MASTER-K
Station number, main instruction, and registration number are same as the request
format.
When the main instruction is small character (x), the lower byte of summation from
ACK to ETX is converted into ASCII format and added to frame as BCC check.
Station number, main instruction, and registration number are same as the request
format.
When the main instruction is small character (x), the lower byte of summation from
NAK to ETX is converted into ASCII format and added to frame as BCC check.
The error code is expressed as 2 byte of hexadecimal format ( 4bytes of ASCII
codes) and indicates the type of error. Please refer the error code table for details.
7-19
Chapter 7 Dedicated communication MASTER-K
5) Example
Register monitoring number 1 (Read D000 of station number 1)
7-20
Chapter 7 Dedicated communication MASTER-K
1 block
(Max. 16 blocks available)
7-21
Chapter 7 Dedicated communication MASTER-K
Station number, main instruction, and registration number are same as the request
format.
When the main instruction is small character (y), the lower byte of summation from
NAK to ETX is converted into ASCII format and added to frame as BCC check.
The error code is expressed as 2 byte of hexadecimal format ( 4bytes of ASCII
codes) and indicates the type of error. Please refer the error code table for details.
5) Example
Execute the registration number 1 of station number 1. Assume that reading single device
(D000, word) is already registered as number 1 and the contents of D000 is h3202. (No
BCC check)
7-22
Chapter 7 Dedicated communication MASTER-K
BCC : When the main instruction is small character (r), the lower byte of summation from
ENQ to EOT is converted into ASCII format and added to frame as BCC check.
Station number, main instruction, and instruction type is same as those of the request
format.
When the main instruction is small character (r), the lower byte of summation from
ACK to ETX is converted into ASCII format and added to frame as BCC check.
Status data : The status data is consist of 20 byte of hexadecimal numbers. When the
PLC returns, it is converted to the ASCII code, and its size is doubled (40 bytes). See
the next page for detail of status data configuration.
7-23
Chapter 7 Dedicated communication MASTER-K
Æ Byte
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Not used Error Not used CPU Key / Not used O/S CPU
code mode Flash version type
CPU type
CPU type Code
K200S A (K3P-07AS) h3A
K200S B (K3P-07BS) h3B
K200S B (K3P-07CS) h3C
K300S A (K4P-15AS) h33
K300S B (K4P-07AS) h37
K1000S (K7P-30AS) h32
1 2
Key / Flash
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
Not used Not used
CPU mode (Use only lower 4 bits) : Turn on one bit according to the operation
mode of master CPU.
bit 3 bit 2 bit 1 bit 0
DEBUG PAUSE STOP RUN
7-24
Chapter 7 Dedicated communication MASTER-K
Station number, main instruction, and instruction type is same as those of the request
format.
When the main instruction is small character (r), the lower byte of summation from
NAK to ETX is converted into ASCII format and added to frame as BCC check.
The error code is expressed as 2 byte of hexadecimal format ( 4bytes of ASCII
codes) and indicates the type of error. Please refer the error code table for details.
5) Example
Read the CPU status of station number 1. (No BCC check)
7-25
Chapter 8 Dedicated modem communication
Cnet module has a long distance communication function using public telephone line. This
function enables long distance communication via public line by connecting external modem in
Cnet module and calling/receiving phone.
When using modem for communication, line connection status may be not good depending on
modem's performance and public telephone line, so failure in communication may occur. Also
even if being on connection, disconnection may occur. For reliable modem communication,
therefore, the modem conformed to the following recommended specifications must be used.
The modems tested so far are as follows, and use of other modem than these may cause
problem in connection.
8-1
Chapter 8 Dedicated modem communication MASTER-K
1) Installation of modem
Before use, connect the modem meets the above specifications and the RS-232C port of
Cnet module with RS-232C cable. [Figure 6.39] shows modem connection example.
The connecting sequence of Cnet module and modem is as follows :
Connect recommended external modem of 6.3.1 and RS-232C port of Cnet module
with RS-232C interface cable.
Connect the interface cable connected following to connecting method pin of Figure
4.4 to RS-232C port of Cnet module and DTE connection terminal of modem.
Connect telephone line to line terminal of modem.
Verify initialization of modem after PLC power-on and modem power-on.
C
P C O L
I
W P U M
N RS-232C
R U T
IBM Compatible
Public line
Modem Modem
When modem cannot be normally initialized, verify that the switch value of operation
mode has been set to stand-alone mode(2 or more).
When operation mode has been set to stand-alone mode, verify that the connection
state of RS-232C interface cable is OK or modem initialization command has been
correctly set, and after modifying restart it.
8-2
Chapter 8 Dedicated modem communication MASTER-K
The above table shows modem connectable operation modes. As shown in Table, modem
connection is available in not interlocking but stand-alone mode only. When modem connection
after setting to interlocking mode, the communication by using a modem operated by null
modem is impossible. Attention must be paid to this point.
8-3
Chapter 8 Dedicated modem communication MASTER-K
8-4
Chapter 8 Dedicated modem communication MASTER-K
If, after connection completion, writing is selected, the following dialog box is
displayed. At this time, select basic parameters in communication option, select the
slot number which Cnet module is mounted, and click on the writing button.
After basic parameter writing is selected, the dialog box that confirms the operation
cancel of Cnet module as shown in [Figure 8.5]. At this time, select OK to download
the basic parameter to Cnet module.
8-5
Chapter 8 Dedicated modem communication MASTER-K
If, after writing basic parameter, operation switch is selected, the following dialog box
is displayed. At this time, select slot number and communication run to start the RS-
232C channel.
If the LEDs of No.’0’ 'RUN', 6 'MODEM', and 7 'SYS-RUN' are ON after starting
channel, it means that writing basic parameters has been normally completed.
If the states of LEDs are abnormal, verify that channel operation mode is stand-alone
mode. If channel mode is normal, verify the slot number.
When all LEDs are in normal state, connect modem to computer link following 8.3.2,
how to install modem, power-on modem, and verify the initialization of modem.
When normal, No.'1' 'TX' LED flashes once, and the modem is initialized. When the
modem has not been initialized, No.'1' 'TX' LED flashes continuously at interval of 1
sec., and the modem is not initialized.
When No.’1’ LED 'TX' flashes at interval of 1 sec., it means that the modem has not
been initialized. At this time, verify that the modem settings are fit. If fit, verify that RS-
232C interface cable has been correctly connected.
8-6
Chapter 8 Dedicated modem communication MASTER-K
1) Introduction
This is a function so that PLC can remotely perform preparing program, downloading of
user program, debugging program, and monitoring, etc. without moving physical
connection of KGLWIN in network system connected via Cnet module.
Especially, when KGLWIN and PLC are distant away each other, this function enables
easy access to PLC CPU by KGLWIN remote connection via public line using dialing
function and remote connection function of KGLWIN, and modem connection function of
computer link.
MASTER-K PLC
KGLWIN
C
P C O L
I
W P U M
N
R U T
RS-232C interface
RS-422
IBM Compatible
Public line
Modem Modem
Figure 8.7 shows an example of remote connection by connecting modem to IBM-PC and
Cnet link module.
Using KGLWIN communication service enables easy access to a remote PLC without
moving. In addition, even if PLC is placed in position difficult to access, because access
to remote PLC is possible, difficulty of program is dissolved. This function enables
reduction of time and efforts for installation and modification.
For the details on KGLWIN communication service, see MASTER-K Mnet/Fnet technical
manual.
8-7
Chapter 8 Dedicated modem communication MASTER-K
Set the operation mode setting switch on the front of computer link module to '6' or '7'
to set RS-232C channel to KGLWIN mode.
After connecting modem to computer link module, connect it to telephone line, and
power on.
After execution of KGLWIN, select modem of ‘Method of Connection’ menu.
If the dialog box is displayed like figure, click on the OK button after setting the data
required.
Select [Connect] at on-line menu. When setting of COM port of modem is incorrect,
or the connection with modem is error, error message is displayed. At this time, verify
COM port or modem connection.
Help
8-8
Chapter 8 Dedicated modem communication MASTER-K
At this time, it means that the 1st step connection has been completed, it is a same
status as linking with RS-232C connection cable. All functions of on-line menu can be
used.
Remarks
1) How to use KGLWIN after remote connection is the same as of local connection. For the
details, see 6.3, KGLWIN communication service of MASTER-K Mnet/Fnet User's Manual.
2) The state of PLC control via modem depends on the performance of modem and the state
of telephone line. Thus, if the state of telephone line is bad, the connection may be
disconnected. At this time, reconnection must be tried not immediately but after waiting for
30 seconds. Try connection again from (1).
8-9
Chapter 8 Dedicated modem communication MASTER-K
Computer link module has a long distance communication function using dedicated line with
external dedicated modem. Also this has a function to control dedicated modem, and a data
communication function using the dedicated line.
Performance of the dedicated modem communication using Cnet module is determined by the
performance of dedicated modem and the state of dedicated line. Because low performance
modem or bad line becomes a cause of performance deterioration, the modem fit to the
following recommended specifications must be used for reliable communication.
1) Installation of modem
Before use, connect the modem meets the above specifications to Cnet module with
RS-232C cable. Figure 6.42 shows an example of modem connection.
The connecting sequence of computer link module and modem is as follows :
Connect recommended external modem of 6.4.1 and RS-232C channel of Cnet
module with RS-232C cable.
Connect the cable connected following to connecting method of Figure 4.4 to RS-
232C channel of Cnet module and DTE connection terminal of modem.
Connect dedicated telephone line to line terminal of modem.
Set the operation mode switch of computer link to the position required, after that
power on, and set communication type to dedicated modem mode by using frame
editor.
Verify that the modem is initialized after power-on of modem.
8-10
Chapter 8 Dedicated modem communication MASTER-K
C
P C O L
I
W P U M
N
R U T
RS-232
IBM Compatible
Dedicated Dedicated
modem modem
Dedicated line
When modem cannot be normally initialized, verify that the switch value of operation
mode has been set to stand-alone mode(2 or more), and that the communication type
is has been set to dedicated modem communication by using frame editor.
When channel mode and communication type has been correctly set, verify that the
connection state of RS-232C cable is OK.
When the cable connection is OK, verify that setting of modem is correct by seeing
modem manual.
8-11
Chapter 8 Dedicated modem communication MASTER-K
[ K3F-CU2A / K3F-CU4A ]
The above table shows modem connectable operation modes. As shown in Table, modem
connection is available in not interlocking but stand-alone mode only. When modem connection
after setting to interlocking mode, the communication by using a modem operated by null
modem is impossible. Attention must be paid to this point.
8-12
Chapter 8 Dedicated modem communication MASTER-K
8-13
Chapter 8 Dedicated modem communication MASTER-K
If, after connection completion on-line menu, writing is selected, the following dialog
box is displayed. At this time, select basic parameters in communication option, select
the slot number which Cnet module is mounted, and click on the writing button.
If basic parameter writing is selected, the dialog box that confirms the operation
cancel of Cnet module as shown in Figure 8.12. At this time, select OK to download
the basic parameter to Cnet module.
After writing basic parameter, operation switch is selected, the following dialog box is
displayed. At this time, select slot number and communication run to start the RS-
232C channel.
8-14
Chapter 8 Dedicated modem communication MASTER-K
If the LEDs of No.’0’ 'RUN', 6 'MODEM', and 7 'SYS-RUN' are lit by verifying LED
indication after starting channel, it means that writing basic parameters has been
normally completed.
If the states of LEDs are abnormal, verify that channel operation mode is stand-alone
mode. If channel mode is normal, verify that the slot number fits to the mounting No.
of computer link module.
When all LEDs are in normal state, connect modem to computer link following 6.4.2,
how to install modem, power-on PLC and modem, and verify the normal operation of
modem.
If modem operates abnormally, modify settings of modem operation by seeing
modem manual, and then reconnect.
Set the operation mode setting switch on the front of computer link module to '6' or '7'
to set RS-232C channel to KGLWIN mode.
After connecting modem to computer link module, connect it to telephone line, and
power on.
After execution of KGLWIN, select modem of ‘Method of Connection’ menu.
OK Cancel Help
8-15
Chapter 8 Dedicated modem communication MASTER-K
If the dialog box is displayed like figure, click on the OK button after setting the data
required.
Some of specification of communications are fixed as following, and they can not changed.
Remote 1 / Remote 2 means the connection status. When connection is performs through
modem, default status is remote 1. When connect other PLC through the communication
module (Fnet / Cnet) mounted at the remote PLC, set the depth of connection as ‘Remote 2’.
When the connection is completed, the following message is displayed at the status bar.
Remarks
1) How to use KGLWIN after remote connection is the same as of local connection. For the
details, see 6.3, KGLWIN communication service of MASTER-K Mnet/Fnet User's
Manual.
2) The state of PLC control via modem depends on the performance of modem and the
state of telephone line. Thus, if the state of telephone line is bad, the connection may be
disconnected. At this time, reconnection must be tried not immediately but after waiting
for 30 seconds. Try connection again from (1).
8-16
Chapter 9 Example programs
9 Example Programs
C Request C
P C L O P C O L
I I
W P M U Response W P U M
N N
R U T R U T
RS-232C
RS-422
RS-422 INTERFACE
The following table shows how to write, download, and execute an user-defined frame to
communicate with MITSUBISH PLC.
9-1
Chapter 9 Example programs MASTER-K
Receive frame
Protocol : [STX] 0 0 F F A 1 2 B [ETX]
Description
Station number : 00
PLC number : FF (Self-station)
Data : hA12B
9-2
Chapter 9 Example programs MASTER-K
The following three figures (6.27, 6.28, and 6.29) show examples of user-defined frames
written for MITSUBISHI’s dedicated protocol.
The following figure 6.28 shows an example of send frame setting. In the segment 1, the
station number, PLC number, command, waiting, and device type is assigned. In the
segment 2, the D area address to be read is assigned as ‘array’ type variable ‘SD1.’.
When write a sequence program, the address of D area should be stored in ‘SD1.’ as 2
bytes string (range : 0000 ~ 9999) format. Finally, the length of data to be read is
assigned as constant. (in this example, h01)
In the segment 1 of receiving frame, the station number and PLC number is assigned as
constant format. Then, the memory address of MASTER-K PLC at which the received
data to be stored is assigned as array variable ‘RD1.’ It will be designated in sequence
program with ‘RCV’ instruction.
9-3
Chapter 9 Example programs MASTER-K
9-4
Chapter 9 Example programs MASTER-K
The following figure 6.30 and 6.31 show examples of sequence program.
Store the name of sending frame (‘send’) in D010 ~ D017 (8 words). The name is
stored as following;
D017 D016 D015 D014 D013 D012 D011 D010
0 0 0 0 0 0 0 0 0 0 0 0 s e n d
Assign the address of PLC#2 to be read. In this example, h0000 (D0000) will be read.
Send the frame ‘send’ at every 0.5 second.
Assign the slot number at which the Cnet module is mounted, and communication
channel. (h0101 : slot 1, RS-422)
Assign the start address of data block at which the name of frame is stored.
Assign the start address of data block at which the sending data (SD1.) is stored.
Assign the number of bytes to be sent.
Assign the address at which the communication status is stored (1 word).
Bit 0 : Done signal (No error : 1 scan on, Error : keep on state)
Bit 1 : Error signal (Normal : off, Error : on)
Bit 2 ~ 7 : Not used
Bit 8 ~ F : Error code (hexadecimal format)
M020 : Store the numbers of data transmission
M021 : Store the number of error occurrence
9-5
Chapter 9 Example programs MASTER-K
Remark
For reliability of RCV instruction, please use those input conditions with RCV instruction as
shown in above example.
L121 : Turns on per 1 scan when the 1st frame of RS-422 is received at the slot 1.
M100 : Turn on per 1 scan when the RCV instruction is executed normally.
M101 : Turn on when an error occurs during communication.
9-6
Chapter 9 Example programs MASTER-K
2) No-protocol mode
In this example, it will be described how to write frame to communicate with the AJ71C24
via ‘No-protocol mode’ of MITSUBISHI. Let’s assume that the MASTER-K PLC reads
D0049 of PLC#2, and sends D0100 to PLC#2. The D0100 of PLC#1 is increased by 1
every 0.5 seconds.
The frame structure is as following;
Send frame
Protocol : [ENQ] 0 0 F F W R 0 xxxx [ETX]
In this example, only ‘xxxx’ is valid for communication. The previous data
( [ENQ]00FFWR0 ) is used for dummy data filling the protocol format.
Receive frame
Protocol : (No header) xxxx (No tail)
xxxx : the received data
The following figures (figure 6.32 ~ 6.34) show how to write an user-defined protocol for
‘No-protocol’ mode communication with AJ71C24.
9-7
Chapter 9 Example programs MASTER-K
9-8
Chapter 9 Example programs MASTER-K
9-9
Chapter 9 Example programs MASTER-K
Remark
For reliability of RCV instruction, please use those input conditions with RCV instruction as
shown in above example.
L121 : Turns on per 1 scan when the 1st frame of RS-422 is received at the slot 1.
M100 : Turn on per 1 scan when the RCV instruction is executed normally.
M101 : Turn on when an error occurs during communication.
9-10
Chapter 9 Example programs MASTER-K
The following figure 6.37 shows the sequence program of PLC#2. Please refer the
MITSUBISHI’s user’s manual for details.
9-11
Chapter 9 Example programs MASTER-K
C Request C
P C L O P C L O
I I
W P M U Response W P M U
N N
R U T R U T
RS-232C INTERFACE
Increase the P002 of PLC#1, and transmit it to the P002 of PLC#2. The sending frame is
named as ‘A’ and downloaded to the CLM#1, then the receiving frame ‘B’ is downloaded
to the CLM#2.
9-12
Chapter 9 Example programs MASTER-K
9-13
Chapter 9 Example programs MASTER-K
9-14
Chapter 9 Example programs MASTER-K
9-15
Chapter 9 Example programs MASTER-K
9-16
Chapter 9 Example programs MASTER-K
C Request C
P C L O P C L O
I I
W P M U Response W P M U
N N
R U T R U T
RS-422 INTERFACE
Increase the P002 of PLC#1, and transmit P002 ~ P006 (10 bytes) to the P002 ~ P006 of
PLC#2. The CLM#1 is mounted on the slot 0 and station number is 0. The CLM#2 is
mounted on the slot 1 and station number is 1.
9-17
Chapter 9 Example programs MASTER-K
9-18
Chapter 9 Example programs MASTER-K
9-19
Chapter 9 Example programs MASTER-K
9-20
Chapter 9 Example programs MASTER-K
C Request C
P C L O P C L O
I I
W P M U Response W P M U
N N
R U T R U T
RS-232C INTERFACE
The following example shows a program that send 1 word from P004 of master station
(PLC#1) to the P002 of slave station (PLC#2 : station number 1), and receive P002 of
PLC#2 to the P005 of master station (PLC#1). The RS-232C channel of Cnet module
mounted on the slot 0 is used for communication. The communication status of WRITE
instruction is stored at M012 word.
9-21
Chapter 9 Example programs MASTER-K
The following figure shows how to set basic parameters at master station and slave
station. (No frame setting is required)
9-22
Chapter 9 Example programs MASTER-K
C Request C
P C L O P C L O
I I
W P M U Response W P M U
N N
R U T R U T
RS-422 INTERFACE
The following example shows a program that send 1 word from P004 of master station
(PLC#1) to the P002 of slave station (PLC#2 : station number 1), and receive P002 of
PLC#2 to the P005 of master station (PLC#1). The RS-422 channel of Cnet module
mounted on the slot 0 is used for communication. The communication status of WRITE
instruction is stored at M012 word.
9-23
Chapter 9 Example programs MASTER-K
The following figure shows how to set basic parameters at master station and slave
station. (No frame setting is required)
9-24
Chapter 11 Installation and maintenance
11-1
Chapter 11 Installation and maintenance MASTER-K
11-2
Chapter 11 Installation and maintenance MASTER-K
11-3
Chapter 11 Installation and maintenance MASTER-K
9) When long distance of communication cable is required, wire the cable in order to be
apart from power line or inductive noise.
10) If LED operation is abnormal, see chapter 12 troubleshooting in this manual to verify
abnormal cause. When problems occur continuously even if measuring, contact Service
station.
11-4
Chapter 11 Installation and maintenance MASTER-K
Start
Power on :
1) Confirm input power.
2) Confirm communication cable connection.
3) Power on.
4) Confirm the lighting of power LED for power module.
5) Confirm LED states of CPU module.
If it is abnormal, see troubleshooting of each PLC type manual.
6) Verify whether the LED states of communication module are normal or not.
If it is abnormal, see chapter 9, troubleshooting of this manual.
Frame definition : Define frame with frame definition and download to communication module.
Program preservation :
1) Save program to floppy or hard disk.
2) Print circuit drawing and the list with printer.
3) Write program to memory module if required.
Completion
11-5
Chapter 11 Installation and maintenance MASTER-K
11.2 Maintenance
Contents to be
Checking item Criteria of decision Action to take
checked
Cable connection state Cable loosened Shall not be loosened Tighten the cable
Module tightening Tighten module
Module connection state Shall not be loosened
screw loosened screw
System operation Flash Flash(light off is abnormal)
See Appendix A1.
LED(7:SYS-RUN) checked -of CPU and interface
Channel operation Only if channel active LED
LED lights, data is normally
(0:RS-232C RUN Light On checked sent/received See Appendix A1.
8:RS-422/485 (If light off, communication
RUN) is disconnected.)
Communication
error LED Flash is abnormal
LED (5:RS-232C ERR Light Off checked (abnormal parameter See Appendix A1.
13:RS-422/485 setting or cable failure)
ERR)
TX/RX LED
(1/2 RS-232C Light off is abnormal
Flash
TX/RX (abnormal hardware of See Appendix A1.
checked
9/10:RS-422/485 module)
TX/RX)
System error LED If flash, it means system is
Light Off checked See Appendix A1.
(15:SYS-ERROR) abnormal.
11-6
Chapter 11 Installation and maintenance MASTER-K
be there.
loosened
Closeness of
Distance shall be
compressed Visual inspection Correct
suit-able.
terminal
Connector No loosening shall Tighten connector
Visual inspection
loosening be there. locking screw.
AC 110/220V Modify power supply.
AC 85-132V
Power voltage check Measure voltage between Modify transformer
AC 170-264V
terminals tap.
11-7
Chapter 12 Troubleshooting
12 Troubleshooting ..............................................................................................12-1
12.1 Classification of abnormal operations ...............................................................12-1
12.1.1 H/W or system error ........................................................................................12-1
12.1.2 Command error (User-defined communication) .............................................12-1
12.1.3 Receiving monitoring error ..............................................................................12-1
12.1.4 Sending monitoring error.................................................................................12-1
12.1.5 NAK response during dedicated communication............................................12-2
12.1.6 No response during dedicated communication...............................................12-2
12.1.7 Modem connection error during KGL-WIN mode ...........................................12-2
12.2 Troubleshooting by each error code ..................................................................12-3
12.2.1 Error type C01 : H/W or system error .............................................................12-3
12.2.2 Error type C02 : Command error (User-defined communication) ...................12-4
12.2.3 Error type C03 : Receiving monitoring error ...................................................12-5
12.2.4 Error type C4 : Sending monitoring error ........................................................12-6
12.2.5 Error type C5, C6 : Error during dedicated communication ............................12-7
12.2.6 Error type C07 : Modem connection error during KGL-WIN mode.................12-8
Chapter 12 Troubleshooting MASTER-K
12 Troubleshooting
This chapter describes error contents that may occur during operating system, finding causes,
and how to take action. For how to troubleshoot, tables that show Cnet communication errors is
provided in 12.1, and the troubleshooting is performed according to each error code in 12.2.
12-1
Chapter 12 Troubleshooting MASTER-K
12-2
Chapter 12 Troubleshooting MASTER-K
No
No No
No No
12-3
Chapter 12 Troubleshooting MASTER-K
Command error
No
66 64 83
Is the status value
64, 66, or 83?
Frame name used Improper hex value Check the mode
No in command does is assigned in array switch and Cnet
not exist. variable. module is running
Check the Cnet Yes
module is mounted on Is the status value 16?
the designated slot at
‘sl’ of command
No
Yes
Is the status value 67?
No No
12-4
Chapter 12 Troubleshooting MASTER-K
No
Revise sequence
Yes Check the cable if program and frame
Is the cable connected there is cut-off or correctly.
correctly? improper connection
No
No
No
After closing monitoring screen
and frame editor, try again.
12-5
Chapter 12 Troubleshooting MASTER-K
Revise sequence
Yes Check the cable if program and frame
Is the cable connected there is cut-off or correctly.
correctly? improper connection
No
No
No
After closing monitoring screen
and frame editor, try again.
12-6
Chapter 12 Troubleshooting MASTER-K
Dedicated communication
error
Does the
Is there Yes used protocol accord Yes
any response from other with dedicated protocol
station? specifications?
Revise protocol according
No to the dedicated protocol
No specification
No
No
No
Contact the nearest service
center
12-7
Chapter 12 Troubleshooting MASTER-K
12.2.6 Error type C07 : Modem connection error during KGL-WIN mode
Modem connection
error
12-8
Appendices
3 ACK
/ Off after NAK transmission
On during NAK transmission
4 NAK
/ Off after ACK transmission
5 ERR On during protocol error / SIO error
6 MODEM On during modem communication mode
On during
7 SYS-RUN Blink during interfacing with CPU
normal operation
8 RUN On during RS-422 channel operation
9 TX On during transmission via RS-422
10 RX On during receive via RS-422
On during ACK transmission
11 ACK
/ Off after NAK transmission
R422
Remarks
The LED 15 will blink when system hardware error or serious software error occurred, and
the error status is indicated by upper 5 bits (LED 0 ~ 4). For details, see A.2 ‘LED display
during abnormal operation’.
A-1
Appendices MASTER-K
2) K3F-CU2A
LED # LED name Description Remarks
0 RUN On during RS-232C channel operation
1 TX On during transmission via RS-232C
2 RX On during receive via RS-232C
On during ACK transmission
RS-232C
3 ACK
/ Off after NAK transmission
On during NAK transmission
4 NAK
/ Off after ACK transmission
5 ERR On during protocol error / SIO error
6 MODEM On during modem communication mode
SYS-RUN / On during
7 Blink during serious error occurrence
ERR normal operation
3) K3F-CU4A
LED # LED name Description Remarks
0 RUN On during RS-422 channel operation
1 TX On during transmission via RS-422
2 RX On during receive via RS-422
On during ACK transmission
3 ACK
RS-422
A-2
Appendices MASTER-K
A-3
Appendices MASTER-K
Remarks
A-4
Appendices MASTER-K
LED operations during abnormal operation are divided into two cases;
When in state of SYS-ERROR LED is off, the other error LEDs blinks at intervals. It
means that installation of communication cable or parameter setting is improper or
program preparation is abnormal. At this time, it can be solved by seeing chapter 12,
‘Troubleshooting’.
When serious H/W error occur, the LED 15 blinks in 1 second period, and the error
code is indicated by LED 0 ~ 4 in binary value as following table. When the serious
H/W error occurs, contact the nearest service center.
Error code Description Remark
h01 Internal memory diagnosis error
h02 Buffer memory reading / writing error
h03 Buffer memory access error
H/W error
h04 CPU interface error
h05 Flash memory read / write error
h06 UART (NS-16550) access error
h07 Operation mode setting error
h08 Reserved
h09 Address error
h0A Invalid instruction error
h0B Zero divide error
h0C ~ h1F Reserved
A-5
Appendices MASTER-K
The Cnet module performs self-diagnosis through checking the H/W and interface with CPU.
When the diagnosis is finished without error, LED 0 ~ 5 becomes on in sequence and then start
normal operation. Please see chapter 10 for details of self-diagnosis
A-6
Appendices MASTER-K
STATUS
value Meaning Action to take
hex decimal
There is no input or over 16
H0E 14 characters at the name of frame.
Check the input of the name of frame.
Response frame not requested has Verify receive frame of self station or
H14 20 been received. transmission frame of other station again.
Response from Cnet module has not
Verify whether Cnet module is user defined
H15 21 been received.(waiting time
communication mode.
exceeded)
Operation of RS-232C/422 channel is Perform operation RUN with frame editor.
H40 64 not RUN. (Menu:[On-line-Operation switching])
Name used in frame editor and name
Reconcile frame name used in frame editor and
H41 65 used in sequence program do not fit
frame entered in sequence program.
each other.
Frame name can not be found due to 1) Download frame again.
H42 66 abnormal CPU during operation. 2) Verify whether there is abnormality in CPU.
1) Verify receive frame again.
Frame specified in command has not
H43 67 been received from other station. 2) Verify other station's transmission frame
again.
Frame has not been downloaded from
H44 68 frame editor.
Download frame.
Error occurs during conversion ASCII Verify whether received data is ASCII or HEX
H45 69 again.
HEX.
Array size specified in frame editor
Confirm data size again and fit it.
H46 70 and data size(specified in LENx) used
(Data size is Byte value.)
in program do not fit each other.
1) Verify contents of appropriate frame again
H67 103 Incorrect frame definition. with frame editor.
2) Download frame again.
Frame has not been downloaded from
H68 104 frame editor.
Download frame.
B-7
Appendices MASTER-K
Error
Error type Contents Action to take
code
PLC system
H0001 Interface with PLC impossible Power On/Off
error
Check whether another
character than upper and
Error occurred when ASCII data value
H0011 Data error lower cases(‘%’,’-’, ’.’), and
is converted into digits
digits has been used, correct,
and execute again.
Device memory
H1132 Wrong specified device memory Inspect device type
error
Execution data number exceeding 120
H1232 Data size error Correct data length
Bytes
H1332 Data type error Data type mismatch between variables Equalize data type
H1432 Data value error Data value not digits Inspect data value
Data type mismatch with actual Equalize variable and data
H2432 Data type error
variable type of PLC program
Variable 1) P, M, L, K, D, T, C, F, S area
H7132 Inspect format, correct, and
request format exceeding error
H2232 then execute again.
error 2) Request format not fit
Monitor Registration number of appropriate Execute again after registering
H0090
execution error monitor not registered. monitor.
Execute again after adjusting
Monitor
H0190 Registered number exceeding range monitor registration number to
execution error
31 or less.
Monitor Execute again after adjusting
H0290 registration Registered number exceeding range monitor registration number to
error 31 or less.
* Station number error
* BCC error
* Main command / command type
error
No * Header and tail character error Check and take actions for
resp- No response
* Cable error error contents that may occur
onse
* Operation mode error
* Communication speed and
stop/data/parity bit error
* PLC error
B-8