This section provides an overview of Modbus/TCP communications and describes the
communications format, communications commands, and communications procedure.
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 - 1
7 Modbus/TCP Communications
Additional Information
Host device
(client)
Reader/Writer
(server)
Ethernet Cable
TCP port number: 502
Command
Response
Power Supply Cable
7-1Outline
7-1-1Modbus/TCP Communications
• A V780 Reader/Writer can perform Modbus/TCP-compliant message communications with the host
device (PLC).
• Communications between the host device (PLC) and the V780 Reader/Writer are performed on a client-server basis using the TCP/IP protocol. The computer, PLC, or other host device is the client and
the Reader/Writer is the server.
• The message that the host device (PLC) sends to the Reader/Writer is called a command. The message that the Reader/Writer returns is called the response.
Modbus/TCP Protocol
The Modbus/TCP protocol is a communications protocol developed for PLCs by Modicon
Inc.(AEG Schneider Automation International S.A.S.). It is an open standard and has been
used for a variety of industrial devices.
A query in Modbus/TCP communications is called a command in this manual.
7-1-2Modbus/TCP Function Codes Supported by the V780
The Modbus/TCP function codes that are supported by the V780 Reader/Writer are given in the following table.
Function codeDescription
These function codes comply with Modbus/TCP Class 0.
FC03 and FC16
(normal commands)
FC100
(expanded command)
The basic Modbus/TCP function codes are classified in Class 0.
Class 0 contains the following two functions: Read Multiple Resisters (FC03) and Write
Multiple Registers (FC16).
These are called normal commands in this manual.
This function code has a unique format that was defined by OMRON.
This function code is used to reduce command/response exchanges between the host
device and Reader/Writer and give priority to the performance of communications with
the host device.
This is called an expanded command in this manual.
7 - 2
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7-1-3Communications System
Host device
(client)
Reader/Writer
(server)
Ethernet Cable
FC03 or FC16
TCP port number: 502
Command
Response
Power Supply Cable
Modbus/TCP communications instructions
Modbus/TCP Unit or other applicable Unit
There are two communications systems used by the V780 depending on the function codes that are
used.
Modbus/TCP Communications System (FC03 and FC16)
The communications system that uses normal commands that are compliant with Modbus/TCP Class 0
is shown below.
Refer to 7-2 Message Formats on page 7-5 for details on the normal commands.
7 Modbus/TCP Communications
TCP/IP Socket Communications System (FC03, FC16, and FC100)
The expanded command that has a unique format defined by OMRON (FC100) cannot be sent with a
Modbus/TCP Class 0-compliant protocol. The TCP/IP socket communications of the host device (PLC)
are used instead.
Refer to 7-2 Message Formats on page 7-5 for details on the expanded communications commands.
Refer to 7-4 Communications Procedure on page 7-11 for information on creating a program for TCP/IP
communications.
Socket communications instructions
Ethernet Unit or other applicable Unit
Host device
(client)
FC03, FC16, or FC100
Ethernet Cable
Command
Reader/Writer
(server)
Power Supply Cable
TCP port number: 502
7-1 Outline
7
7-1-3 Communications System
Response
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 - 3
7 Modbus/TCP Communications
Precautions for Correct Use
Communications Units and communications commands that support the Modbus/TCP protocol
support only function codes that comply with Modbus/TCP Class 0. Therefore, the function
code FC100 for expanded commands cannot be used.
IP Address Settings of the Reader/Writer
You can set any IP address for the V780 Reader/Writer.
For details, refer to 7-6-5 Reader/Writer Setting Commands: Network Settings on page 7-54 or Setting the IP Address of the Reader/Writer from a Web Browser on page 5-4.
Port Numbers Used for Modbus/TCP Communications
Normally, port number 502 (01F6 hex) is used for Modbus/TCP communications.
With the V780 Reader/Writer, you can change the port number to between 1,024 and 65,535 (0400 hex
and FFFF hex).
For details, refer to ?8-2-3 ???????? (P.8-5)?.
7 - 4
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
This function code is used for commands
with a unique manufacturer definition that
gives priority to the performance of communications with the host device.
7 - 5
7 Modbus/TCP Communications
Range included in the field length.
Data
Specify the data that is relevant to the function code.
The format of the data depends on the function code.
The value that was specified in the command is set.
Protocol Identifier
Exception
code
XX hex
This field is always 0000 hex.
7-2 Message Formats
Field Length
This field is always 0003 hex.
Unit Identifier
This field is always FF hex.
7
7-2-3 Response Format for Error Completion
Function Code
The value of the function code that was specified in the command plus 80 hex is set.
Exception Code
A code that provides information on the error is set.
You can use the error code to identify the error that was detected by the Reader/Writer. The exception
code and error code are related as given below. Refer to the most recent command error information or
command error log to check details on the error using the error code.
Exception
code
01 hexIllegal function
02 hexIllegal data address1004 hexCommand format error
03 hexIllegal data value1005 hexCommand parameter error
Function codeRegister addressWord countByte countWrite holding register data
10 hexXXXX hex
0001 to 0078 hex
(1 to 120)
Word count x 2XX...XX hex
Normal Response Format
Byte-7Byte-8Byte-9Byte-10 Byte-11
Function codeRegister addressWord count
10 hexXXXX hex
0001 to 0078 hex
(1 to 120)
7-2-6Expanded Command/Response (FC100)
Command Format
7 - 8
Byte-7Byte-8Byte-9Byte-10…Byte-n
Function codeSubfunction codeExpanded command parameters
64 hexXXXX hexXX...XX hex
Normal Response Format
Byte-7Byte-8Byte-9Byte-10…Byte-n
Function codeSubfunction codeExpanded response data
64 hexXXXX hexXX...XX hex
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 Modbus/TCP Communications
7-3RF Communications Command
Options
This section describes the options that you can use together with RF communications commands (multiaccess or Modbus expansion). You can specify options to get the EPC of the RF Tag, the reception
level, or other communications information together with the normal data for the command.
For commands with the multiaccess specification, the communications information specified with the
option is returned in the response for the command that gets the execution results, i.e., the two commands are used together.
For commands with the Modbus expansion, the communications information specified with the option is
returned as an attachment to the response.
Options
7-3 RF Communications Command Options
Options
ItemRelevant bitDescriptionInformation size
EPCBit 0The StoredPC and EPC code are attached.32 words
Reception
level
Reserved 1Bits 2 to 3• These bits are reserved.--Diagnostic
result
Reserved 2Bits 5 to 15• These bits are reserved.---
Option Specification Examples:
Specify 0001 hex to have the EPC attached.
Specify 0003 hex to have the EPC and reception level attached.
Specify 0011 hex to have the EPC and diagnostic results attached.
Bit 1The reception level (signed hexadecimal) is attached.
FFFF to FF9D hex (-1 to -99 [dBm])
• A value of 0 will be set if processing ended in an error.
Bit 4The diagnostic results (4-digit hexadecimal) are attached.
If communications diagnostics are disabled, 0000 hex is
attached.
For details, refer to Response Formats on page 7-125 under GET COMMUNICATIONS DIAGNOSTIC INFORMATION on
page 7-125.
1 word
1 word
Options Supported by RF Communications Commands
7
OK: Option can be specified, No: Option cannot be specified. (A parameter error will occur if it is.)
---: Reserved (Always specify 0 for these unused bits.)
ClassificationCommand
Communications
command, multiaccess
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
SET MULTIACCESS ID READ---No---OKNo
SET MULTIACCESS DATA READ---No---OKOK
Reserved
Bits 5 to
15
Diag-
nostic
results
Bit 4
Options
ReservedRSSIEPC
Bits 2
and 3
Bit 1Bit 0
7 - 9
7 Modbus/TCP Communications
ClassificationCommand
Communications
command, Modbus expansion
EXTENDED DATA READ---OK---OKOK
EXTENDED DATA WRITE---OK---OKOK
EXTENDED MULTIACCESS ID
READ
EXTENDED MULTIACCESS DATA
READ
Options
Diag-
Reserved
Bits 5 to
15
---No---OKNo
---No---OKOK
nostic
results
Bit 4
ReservedRSSIEPC
Bits 2
and 3
Bit 1Bit 0
7 - 10
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 Modbus/TCP Communications
Host device
(client)
Reader/Writer
(server)
Connection requested.
Connection request acknowledged.
Disconnection requested.
Disconnection request acknowledged.
Command sent.
Response returned.
Command
execution
7-4Communications Procedure
In the computer, PLC, or other host devices, write the program to communicate with the Reader/Writer
using TCP sockets.
If you use an Modbus/TCP master device, follow the communications procedure for the device you are
using.
7-4-1Command Communications Procedure
A connection is required between the host device and Reader/Writer to communicate with the
Reader/Writer. After you establish a connection, send commands and receive the responses.
1Connection Processing: Opening a Socket
Send a request for a connection from the host device to the Reader/Writer and establish a TCP
connection. Monitor for connection timeouts as required.
2Command Send Processing: Sending Socket Data
Send the command from the host device to the Reader/Writer in a message.
Monitor for send timeouts as required.
7-4 Communications Procedure
3Response Reception Processing: Receiving Socket Data
At the host device, wait to receive the message from the host device and receive the response.
Monitor for reception timeouts as required.
4Disconnection Processing: Closing the Socket
Send a request for a disconnection from the host device to the Reader/Writer and disconnect
the TCP connection. Monitor for disconnection timeouts as required.
7
7-4-1 Command Communications Procedure
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 - 11
7 Modbus/TCP Communications
Precautions for Correct Use
Error
occurs.
Error
detected.
Host device
(client)
Reader/Writer
(server)
Command
execution
GET MOST RECENT ERROR
INFORMATION command sent.
(Or, GET COMMAND ERROR LOG command sent.)
Error information returned.
Command sent.
Response returned.
Function code + 80 hex
Access to a Reader/Writer is possible from only one host device at a time.
If a host device B connects to a Reader/Writer while another host device A is already connected to it, the connection between host device A and the Reader/Writer will be automatically
disconnected and a connection with host device B will be established.
7-4-2Error Response Reception Procedure
If an error response is received, you can check the most recent command error information or command error log in the Reader/Writer to get details on the nature of the error. An error has occurred if the
function code in the response that was returned from the Reader/Writer is 80 hex higher than the function code in the query.
You can do this by sending a GET MOST RECENT ERROR INFORMATION command or GET COMMAND ERROR LOG command from the host device or by using the Web browser interface through the
Web server.
7 - 12
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 Modbus/TCP Communications
Host device
(client)
Reader/Writer
(server)
RF Tag A
RF Tag A
Command
execution
Command
execution
READ DATA communications
command sent.
Communications field
RF Tag memory
read/written.
RF Tag memory
read/written.
WRITE DATA communications
command sent.
Read data (120 words max.)
Data to write (120 words max.)
Response returned.
Response returned.
Host device
(client)
Reader/Writer
(server)
Command
execution
READ DATA communications
command sent.
Communications field
GET MOST RECENT ERROR INFORMATION
command sent.
Exception code: Failure in slave device
Error code: RF Tag missing error
Response returned.
Timeout (TMO)
Error information returned.
7-4-3RF Tag Communications Command Procedure for Single-access
Communications
When you send an RF Tag communications command with single-access communications, the
Reader/Writer communicates with only one RF Tag in the communications field.
Using a Normal Command (FC03 or FC16)
With a normal command, the maximum size of data that you can read from an RF Tag is 120 words. To
read more data than that, you must use more than one READ DATA or WRITE DATA command, or use
an expanded command.
7-4 Communications Procedure
If communications with an RF Tag are not possible, a “failure in slave device” exception code (04 hex)
is returned in an error response. Following the error response reception procedure.
7
7-4-3 RF Tag Communications Command Procedure for Single-access Communica-
tions
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 - 13
7 Modbus/TCP Communications
Host device
(client)
Reader/Writer
(server)
RF Tag A
Command
execution
READ DATA communications
command sent.
Communications field
RF Tag memory
read/written.
GET RF TAG ADDITIONAL
INFORMATION command sent.
Reception level
Response returned.
Response returned.
Host device
(client)
Reader/Writer
(server)
RF Tag A
Command
execution
EXPANDED DATA READ
communications command sent.
Communications field
RF Tag memory
read/written.
Error code
+ EPC code
+ Reception level
Read data (2,048 words max.)
Response returned
(2,048 words max.)
If you want to check the EPC code or reception level when communications with the RF Tag are successful, send a GET RF TAG ADDITIONAL INFORMATION command after the response to the communications command has been received. The reception level from the RF Tag that was just
communicated with will be returned.
Using an Expanded Command (FC100)
With an expanded command, the maximum size of data that you can read from an RF Tag is 2,048
words.
If an error occurs in the RF Tag communications, the error code is returned with the response. No additional command is required to check the error code.
You can also specify a command option to have the EPC code or reception level returned with the other
data.
7-4-4RF Tag Communications Command Procedure for Multiaccess
Communications
When you send an RF Tag communications command with multiaccess communications, the
Reader/Writer communicates with more than one RF Tag in the communications field.
The Reader/Writer will communicate with all of the RF Tags in the communications field within the communications timeout time (64 max.) and then return a response.
7 - 14
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 Modbus/TCP Communications
Host device
(client)
Reader/Writer
(server)
RF Tag A
RF Tag B
RF Tag C
SET MULTIACCESS DATA READ
communications command sent.
GET MULTIACCESS DATA READ RESULTS communications command sent.
GET MULTIACCESS DATA READ RESULTS communications command sent.
Communications field
RF Tag memory
read/written.
Error codeRead data
Number of RF Tags: 3
EPC code
+ Reception level
Error codeRead data
Number of RF Tags: 2
EPC code
+ Reception level
Response returned.
Response returned.
Response returned.
GET MULTIACCESS DATA READ RESULTS communications command sent.
Error codeRead data
Number of RF Tags: 1
EPC code
+ Reception level
Response returned.
Command execution
Timeout (TMO)
RF Tag A
communications
results
RF Tag B
communications
results
RF Tag C
communications
results
Using a Normal Command (FC03 or FC16)
With a normal multiaccess RF Tag command, two commands are used to exchange the data, one to set
communications and another to get the results.
1Sending the Command to Set Communications
First, send the command to set communications.
If the Reader/Writer detects even one RF Tag, the results of execution are returned as a normal
response.
If no RF Tags were detected, an RF Tag missing error is returned.
2Sending the Command to Get the Results
Send the command to get the results.
When you execute the command to get the results, the results of communications with the first
RF Tag that was detected will be returned. The communications results will contain the number
of RF Tags detected, the error code, and, for READ DATA, the EPC code.
If the option is specified, the reception level information is also attached.
7-4 Communications Procedure
3Repeatedly Getting the Results
Execute the command to get the results once for every RF Tag that was detected.
The number of RF Tags that was detected by the Reader/Writer is included in the response to
the command to get the results. Repeatedly send the command until the number of RF Tags in
the response is 1.
7
7-4-4 RF Tag Communications Command Procedure for Multiaccess Communica-
tions
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 - 15
7 Modbus/TCP Communications
Precautions for Correct Use
Precautions for Correct Use
Host device
(client)
Reader/Writer
(server)
RF Tag A
RF Tag B
RF Tag C
SET MULTIACCESS DATA READ
communications command sent.
Communications field
RF Tag memory
read/written.
Error codeRead data
Number of RF Tags: 3
EPC code
+ RSSI level
Error codeRead dataEPC code
+ RSSI level
Response returned.
Response returned.
Error codeRead dataEPC code
+ RSSI level
Command execution
Timeout
(TMO)
RF Tag A
communications results
RF Tag B
communications results
RF Tag C
communications results
If you execute another communications command (e.g., a single-access read, write, or fill command or a multiaccess read command) before you execute the commands to get the results,
the multiaccess communications results held in the Reader/Writer will be cleared.
Using an Expanded Command (FC100)
With an expanded command, you can execute one multiaccess RF Tag command to get the communications results from more than one RF Tag with only one command.
7 - 16
The normal MULTIACCESS DATA READ and MULTIACCESS ID READ communications commands are designed for applications that read two to five RF Tags at one time. If your application requires reading more RF Tags than that, we recommend that you use an expanded
command.
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7-5Commands
The commands that you can send to a Reader/Writer are listed below.
The command codes are used to identify the commands and they are recorded in the most recent command error information and command error log with an error response is returned. (This information is
not included in the Modbus/TCP message format.)
EXTENDED DATA READFC1000001 hex0201 hex
EXTENDED DATA WRITEFC1000002 hex0202 hex
EXTENDED MULTIACCESS ID READFC1000003 hex0203 hex
EXTENDED MULTIACCESS DATA
READ
FC1000004 hex0204 hex
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
SET DEVICE NAMEFC16B100 hex2003 hex
GET DEVICE NAMEFC03B100 hex2004 hex
SET MODBUS/TCP COMMUNICATIONS CONDITIONS
GET MODBUS/TCP COMMUNICATIONS CONDITIONS
SET WEB COMMUNICATIONS
CONDITIONS
GET WEB COMMUNICATIONS
CONDITIONS
SET WEB PASSWORDFC16B400 hex2009 hex
GET WEB PASSWORDFC03B400 hex200A hex
SET TRANSMISSION POWERFC16C100 hex3003 hex
GET TRANSMISSION POWERFC03C100 hex3004 hex
SET CHANNELFC16C200 hex3005 hex
GET CHANNELFC03C200 hex3006 hex
SET GEN2 SESSIONFC16C300 hex3007 hex
FC16C000 hex3001 hex
FC03C000 hex3002 hex
7 - 18
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
GET MODEL INFORMATIONFC03D000 hex4001 hex
GET FIRMWARE VERSIONFC03D100 hex4002 hex
GET MAC ADDRESSFC03D200 hex4003 hex
GET OPERATING STATUSFC03D300 hex4004 hex
GET TIME INFORMATIONFC03D400 hex4005 hex
SET TIME INFORMATIONFC16D400 hex4006 hex
Register addressThe register address (4000 hex) that specifies reading the ID
Word countThe number of words in the read StoredPC and EPC code (always 0020 hex).
Field lengthSetting range: 0015 to 0047 hex
Register addressThe register address (4000 hex) that specifies reading or writing the ID
Word countSetting range: 0001 to 0020 hex
Byte countSetting range: 02 to 40 hex
EPC lengthGives the word size of the EPC code in 4-digit hexadecimal.
0000 to 001F hex (0 to 32)
EPC codeGives the Tag-specific information according to Gen2 standards.
Field lengthSetting range: 0009 to 00F7 hex (9 to 247)
Register addressSpecify in 4-digit hexadecimal the start address for writing data in the RF Tag.
Setting ranges (word address specifications)
0000 to 07FF hex: Reserved area
1000 to 17FF hex: EPC area
2000 to 27FF hex: TID area
3000 to 37FF hex: User area
Word countSpecify in 4-digit hexadecimal the number of words of data to write.
Setting range: 0001 to 0078 hex (120 words max.)
Byte countSpecify in 4-digit hexadecimal the number of bytes of data to write.
Setting range: 02 to F0 hex (240 bytes max.)
Data to writeSpecify the data to write to RF Tag.
Between 1 and 120 words of data can be written with one command.
• If you specify locking the EPC, TID, or user area, you will no longer be able to write data to
that area.
• If you specify locking the access password, you will no longer be able to read the access
password area.
• When you unlock an area, specify all of the areas that have been locked.
Area to
lock/unlock
Specify one or more of the EPC, TID, and user areas.
EPC area: 0001 hex
TID area: 0002 hex
User area: 0004 hex
Access password: 0008 hex
• If all zeros is specified, a command parameter error will occur.
PasswordSpecify the access password to set in the Tag in 8-digit hexadecimal (32 bits) (00000000 hex).
Locking: The access password to set in the RF Tag to lock.
Unlocking: The access password in the RF Tag to unlock.
Note 1. When an area is locked, the specified password is written to the access password area in the RF Tag.
2. If an address error, lock error, or RF Tag system error occurs when locking an area, the access password area in the RF Tag will be cleared to all zeros.
3. When an RF Tag is unlocked, the access password area in the RF Tag will be cleared to all zeros.
Exception codeFor details, refer to Exception Code on page 7-7 under Response Format for Error
Protocol identifierField lengthUnit
identifier
Completion on page 7-7.
Function
code
Excep-
tion code
Execution Examples
Example 1: Locking the User Area of the RF Tag with a Password of 12345678 Hex
TX: 00000000000FFF1080000004080001000412345678
RX: 000000000006FF1080000004
7-6 V780 Command Details
Example 2: Unlocking the User Area
TX: 00000000000FFF1080000004080000000412345678
RX: 000000000006FF1080000004
7
7-6-1 Single-access Communications Commands
UHF RFID System V780-series Reader/Writer User’s Manual (Z389)
7 - 29
7 Modbus/TCP Communications
DATA FILL
Function
This command writes the specified data to the specified number of words beginning from the specified write start address. The specifications are made in the command.
Register addressThe register address (8100 hex) that specifies filling data
Word countNumber of words of fill information (0003 hex)
Byte countNumber of bytes of fill information (06 hex)
Fill informationFill addressSpecify in 4-digit hexadecimal the start address for writing data in the RF
Ta g.
0000 to 07FF hex: Reserved area
1000 to 17FF hex: EPC area
2000 to 27FF hex: TID area
3000 to 37FF hex: User area
Number of fill
words
Specify in 4-digit hexadecimal the number of words of data to fill.
Setting range: 0000 hex or 0001 to 0800 hex
• If 0000 hex is specified for the number of fill words, the entire memory
area will be filled.
• You cannot write data to more than one area with the same command.
Fill dataSpecify in 4-digit hexadecimal the data to write to the RF Tag.