Connecting with Host Link Communication (KEYENCE KV Series)
Overview
Explains the protocol of the Host Link communication function available on the EtherNet/IP port of KEYENCE KV series PLCs.
When the PLC receives a Host Link command, it returns the data corresponding to the command, so no ladder program is needed on the PLC.
Host Link communication via the EtherNet/IP port can use both the TCP/IP and UDP/IP protocols.
What Is Host Link Communication?
Serial and Ethernet communication in which a PC or host device sends ASCII-based commands to read/write devices (relays and data memory), change the mode and so on, without any ladder program on the PLC side.
Checks errors and faults occurring in the CPU unit
Command
?
E
CR
3FH
45H
0DH
Normal response
Error number
CR
LF
0DH
0AH
* See the manual for error numbers
?K
Inquire model
Checks the PLC model
Command
?
K
CR
3FH
4BH
0DH
Normal response
Model number
CR
LF
0DH
0AH
Model
Model number
Model
57
KV-8000
58
KV-8000A
54
KV-7300
55
KV-7500
51
KV-3000
52
KV-5000
53
KV-5500
128
KV-NC32T
132
KV-N60??
133
KV-N40??
134
KV-N24??
?M
Check operating mode
Checks the current operating state of the CPU unit
Command
?
M
CR
3FH
4DH
0DH
Normal response
Data
CR
LF
0DH
0AH
Data: RUN mode = 1, other than RUN mode = 0
WRT
Set time
Sets the time of the CPU unit
Command
Command
2-digit year
Month
Day
Time of day
Minute
Second
Day of week
W
R
T
␣
␣
␣
␣
␣
␣
␣
CR
57H
52H
54H
20H
0DH
Normal response
O
K
CR
LF
4FH
4BH
0DH
0AH
ST/RS
Force set / force reset
Forces the contact of the specified device ON or OFF
Force set command
S
T
␣
Device type
␣
Device number
CR
53H
54H
0DH
Force reset command
R
S
␣
Device type
␣
Device number
CR
52H
53H
0DH
Device type
Relays
R
Link relays
B
Internal auxiliary relays
MR
Latch relays
LR
Control relays
CR
Timers
T
Counters
C
High-speed counter comparator
CTC
Work relay
VB
Normal response
O
K
CR
LF
4FH
4BH
0DH
0AH
STS/RSS
Consecutive force set / consecutive force reset
Forces the contacts of the specified number of devices ON or OFF
Consecutive force set command
S
T
S
␣
Device type
␣
Device number
␣
Number of devices to write
CR
53H
54H
53H
20H
0DH
Consecutive force reset command
R
S
S
␣
Device type
␣
Device number
␣
Number of devices to write
CR
52H
53H
52H
20H
0DH
Device type
Relays
R
Link relays
B
Internal auxiliary relays
MR
Latch relays
LR
Control relays
CR
Work relay
VB
Normal response
O
K
CR
LF
4FH
4BH
0DH
0AH
RD/RDS
Read data / read consecutive data
Reads the data of the specified device
Read data command
R
D
␣
Device type
␣
Device number
Data format
CR
52H
44H
20H
0DH
Read consecutive data command
R
D
␣
Device type
␣
Device number
Data format
␣
Number of devices to read
CR
52H
44H
20H
0DH
Data format
.U
Decimal 16-bit unsigned
.S
Decimal 16-bit signed
.D
Decimal 32-bit unsigned
.L
Decimal 32-bit signed
.H
Hexadecimal 16-bit
Response
Data 1
␣
Data 2
␣
...
Data n
CR
LF
20H
0DH
0AH
An example reading R100 to R103 in bit format
Command
R
D
S
␣
R
1
0
0
␣
4
CR
Response
1
␣
0
␣
1
␣
0
CR
LF
An example reading DM200 to DM202 in .S format
Command
R
D
S
␣
D
M
2
0
0
.
S
␣
3
CR
Response
+
1
5
0
2
5
␣
-
2
5
4
0
0
␣
+
0
0
0
0
0
CR
LF
RDE
Read consecutive data
The RDE command is for compatibility with the KV-LE20A Ethernet unit and is the same as RDS
WR/WRS
Write data / write consecutive data
Reads the data of the specified device
Write data command
W
R
␣
Device type
␣
Device number
Data format
␣
Data
CR
57H
52H
20H
0DH
Write consecutive data command
W
R
S
␣
Device type
␣
Device number
Data format
Number of devices to write
␣
Data 1
␣
Data 2
␣
...
Data n
CR
57H
52H
53H
20H
0DH
Data format
.U
Decimal 16-bit unsigned
.S
Decimal 16-bit signed
.D
Decimal 32-bit unsigned
.L
Decimal 32-bit signed
.H
Hexadecimal 16-bit
Normal response
O
K
CR
LF
4FH
4BH
0DH
0AH
An example writing R100 to R103 in bit format
Command
W
R
S
␣
R
1
0
0
␣
4
␣
1
␣
0
␣
1
␣
0
CR
Response
O
K
CR
LF
An example writing DM200 to DM202 in .S format
Command
W
R
S
␣
D
M
2
0
0
.
S
␣
3
␣
+
1
5
0
2
5
␣
-
0
5
4
0
0
␣
2
0
0
CR
Response
O
K
CR
LF
WRE
Write consecutive data
The WRE command is for compatibility with the KV-LE20A Ethernet unit and is the same as WRS
WS/WSS
Write set value / write consecutive set values
The WS/WSS commands are for compatibility with the KV-LE20A Ethernet unit and are the same as WR/WRS
MBS/MWS
Register monitor
Registers the specified devices in the bit device registration table (MBS) or the word device registration table (MWS). Up to 120 devices can be registered
Bit device monitor registration command
M
B
S
␣
Device type
Device number
␣
Device type
Device number
...
Device type
Device number
CR
4DH
42H
53H
20H
0DH
Word device monitor registration command
M
W
S
␣
Device type
Device number
␣
Device type
Device number
...
Device type
Device number
CR
4DH
42H
53H
20H
0DH
Normal response
O
K
CR
LF
4FH
4BH
0DH
0AH
MBR/MWR
Read monitor
Reads the values of the devices in the device registration table
Command to read the bit device registration table
M
B
R
CR
4DH
42H
52H
0DH
Command to read the word device registration table
M
W
R
CR
4DH
42H
52H
0DH
Normal response
Data
␣
Data
␣
...
Data
CR
LF
RDC
Read comment
Reads the comment of the specified device
Command to read the bit device registration table
R
D
C
␣
Device type
Device number
CR
52H
44H
43H
20H
0DH
Normal response
Data
CR
LF
BE
Switch bank
Switches the file register bank
Bank switch command
B
E
␣
Bank number
CR
42H
45H
20H
0DH
Normal response
Data
CR
LF
URD
Read expansion unit buffer memory
Reads the specified number of data consecutively from expansion unit buffer memory
Read expansion unit buffer memory command
U
R
D
␣
Unit number
␣
Address
Data format
␣
Number of data to read
CR
55H
52H
44H
20H
0DH
Normal response
Data
␣
Data
␣
...
Data
CR
LF
UWR
Write expansion unit buffer memory
Writes the specified number of data consecutively to expansion unit buffer memory