Note: MODBUS® is the registered trade mark of AEG Schneider Automaion International.
Note: GW-BASIC, Windows 98 and MS-DOS are registered trademarks of Microsoft Corporation.
NOTICE
1. Exemption items from responsibility
The contents of this document may be changed in the future without prior notice.
We paid the utmost care for the accuracy of the contents. However, we are not liable for direct and
indirect damages resulting from incorrect descriptions, omission of information, and use of
information in this document.
CONTENTS
1. COMMUNICATION FUNCTIONS .....................................................................................................1
1.1 General ...............................................................................................................................................1
1.2 Overview of MODBUS slave communication function (RS-485 interface)......................................1
1.3 Overview of Ethernet communication functions................................................................................2
4.1 Set Items.............................................................................................................................................6
5. MODBUS COMMUNICATION PROTOCOL ....................................................................................8
5.1 General ...............................................................................................................................................8
5.2 Composition of Message ....................................................................................................................9
5.3 Response of Slave Station ................................................................................................................11
5.4 Function Code ..................................................................................................................................12
5.5 Calculation of Error Check Code (CRC-16) ....................................................................................13
5.6 Transmission Control Procedure ......................................................................................................14
5.7 FIX Processing (Cautions in data write)...........................................................................................16
6. DETAILS OF MESSAGE...................................................................................................................17
6.1 Read-out of Word Data [Function code: 03
Read-out of Read-out Only Word Data [Function code: 04H]
6.2
6.3 Write-in of Continuous Word Data [Function code: 10
7. ADDRESS MAP AND DATA FORMAT ...........................................................................................23
7.1 Data Format......................................................................................................................................23
• This equipment provides a communication function (optional) using an RS-485 interface and also a
communication function (optional) using an Ethernet interface.
1.2 Overview of MODBUS slave communication function
(RS-485 interface)
See Chapter 2 through Chapter 8 for the method for use of MODBUS slave communication function in detail.
• The MODBUS slave communication function permits exchange of data with host computer, programmable
controller, graphic display panel, etc.
• The communication system consists of master station and slave stations. Up to 31 slave stations (PHL) can
be connected per master station.
Note that, because the master station can communicate with only one slave station at a time, a party to
communicate with must be specified by the “MODBUS Station No.” set at each slave station.
• In order that the master station and slave station can communicate, the format of the transmit/receive data must
coincide. For the PHL, the format of the communication data is determined by the MODBUS protocol.
• Please use an RS-232C ⇔ RS-485 converter in case of designating a personal computer or other devices which
have an RS-232C interface as a master station.
[RS-232C ⇔ RS-485 converter] (recommended article)
Type: K3SC-10 (isolated type)/ OMRON Corporation.
Programmable
controller
RS-485
RS-232C
RS-485
Caution:
When using the RS-232C ⇔ RS-485 converter, pay attention to cable connection between the converter and
master station. If the cable is not connected correctly, the master station and slave station cannot communicate.
In addition, be careful about communication settings such as baud rate and parity set for the converter.
Personal
computer
RS-232CRS-485 converter
- 1 -
1.3 Overview of Ethernet communication functions
See Chapter 10 and Chapter 11 for the method for use of Ethernet communication functions in detail.
• The following functions are available as Ethernet communication functions.
(1) FTP server function
Permits take-out of files from the compact flash of the paperless recorder, using personal computer's
browser (Internet Explorer) or DOS prompt.
(2) Web server function
Permits check of measured values and event information recorded in the paperless recorder, using personal
computer's browser (Internet Explorer).
(3) E-mail send function
Permits E-mail transmission in a fixed period and also on occurrence of an alarm.
(4) MODBUS TCP/IP function
Permits exchange of data with host computer, programmable controller, graphic display panel, etc. by
MODBUS TCP/IP communication.
- 2 -
2. SPECIFICATIONS
2.1 Communication Specifications
Item Specification
Electrical specification Based on EIA RS-485
Transmission system 2-wire, semi-duplicate
Synchronizing system Start-stop synchronous system
Connection format 1: N
Number connectable units Up to 31 units
Transmission distance 500 m max. (total extension distance)
Transmission speed 9600, 19200 bps
Data format Data length 8 bits
Stop bit 1 bit
Parity none, even, odd (selectable)
Transmission code HEX value (MODBUS RTU mode)
Error detection CRC-16
Isolation
Functional isolation between transmission circuit
and ground (withstand voltage: 500V AC)
- 3 -
3. CONNECTION
WARNING
For avoiding electric shock and malfunctions, do not turn on the power supply untill all wiring
have been completed.
3.1 Communication Terminal Allocation
Signal name
TRX2 –
TRX1 +
Communication
Terminal
Communication Terminal
Shield
-
TRX2
TRX1 +
- 4 -
3.2 Wiring
Use twisted pair cables with shield.
Recommended eable: UL2464, UL2448, etc.
• The total extension length of the cable is up to 500 m. A master station and up to 31 units of the PHL can be
connected per line.
• Both ends of the cable should be terminate with terminating resistors 100Ω (1/2W).
• The shield wire of the cable should be grounded at one place on the master station unit side.
• If the PHL is to be installed where the level of noise applied to the PHL may exceed 1000 V, it is recommended
to install a noise filter in the master station side as below.
Recommended noise filter: ZRAC2203-11/TDK
Master station
(PC, etc.)
RS-232C⇔RS-485
Master station side
Noise filter PHL
Transmission
cable
Slave station (PHL)
FG
RS-485 interface
or
RS-485 side of the RS-232C
(Recomended converter:
K3SC-10/OMRON Corporation)
Twisted pair cable with shield
Terminating resistor
100
(1/2W)
RS-485 converter
TRX1
TRX2
Slave station (PHL)
TRX1
TRX2
Slave station (PHL)
TRX1
TRX2
Terminating resistor
100 (1/2W)
- 5 -
4.
In order that the master station and instrument (PHL) can correctly communicate, following settings are required.
• All communication condition settings of the master station are the same as those of instruments (PHL).
• All instruments (PHL) connected on a line are set to “ MODBUS Station No.” which are different from each
SETTING OF COMMUNICATION CONDITION
other. (Any “ MODBUS Station No.” is not shared by more than one instrument.)
4.1 Set Items
The parameters to be set are shown in the following table. Set them by operating the front panel keys.
Item
Station No. 1
Transmission
speed
Parity setting Odd
Data length
Stop bit
Value at
delivery
0 to 255
(0: communication function stop)
19200 bps 9600bps, 19200bps
None: None parity
Odd: Odd parity
Even: Even parity
8 bit
1 bit
Fixed (can not be changed)
Fixed (can not be changed)
Setting range Remarks
Set a different value to
each station.
Set the same communication condition to the
master station and all
stave stations.
- 6 -
4.2 Setting Operation Method
The following example shows how to set the communication conditions.
Example: Selecting an even parity and “STno=10 and 9600bps” on a station.
Keys used Display Meanings
Trend display Operation state (Trend display)
SEL Menu
Press the [SEL] key to display the Menu screen.
ENT Parameter setting Press the [ENT] key to the Parameter setting screen.
ENT Basic setting
∨
ENT
∨
MODBUS Station NO
Numeric value entering
screen
<010>
ENT MODBUS Station NO
∨
ENT
∧
MODBUS baud rate
Baud rate selection
screen
9600
ENT MODBUS baud rate
∨
ENT
∨
MODBUS parity
Parity bit selection
screen
Even
Press the [ENT] key to the Basic setting screen.
Press the [
key pressed more than six times, use the [
Press the [ENT] key to display the Numeric value entering screen.
Use [<], [>] ,[∧], or [∨] key to change the numeric value to 10.
Press the [ENT] key to confirm the MODBUS Station NO.
Press the [∨] key to select the MODBUS baud rate.
∨] key six times to select MODBUS Station NO. (When the
∧] key to back)
Press the [ENT] key to display the Baud rate selection screen.
Press the [
Press the [ENT] key to confirm the baud rate.
Press the [∨] key to select the MODBUS parity.
Press the [ENT] key to display the Parity bit selection screen.
Press the [∨] key to select “Even”.
∧] key to select “9600”.
ENT MODBUS parity
DISP
ENT
Selection screen for
saving the settings
Confirmation screen for
saving the settings
ENT Trend display
Power OFF -
Power ON Trend display
Press [ENT] key to confirm the parity bit.
Press the [DISP] key to display a screen asking you want to save the
setting.
Press the [ENT] key to save the setting. (The confirmation screen
appears.)
The Trend screen appears.
Turn off the power.
Turn on the power once again to complete the setting.
- 7 -
5. MODBUS COMMUNICATION PROTOCOL
5.1 General
The communication system by the MODBUS protocol is that the communication is always started from the master
station and a slave station responds to the received message.
Transmission procedures is as shown below.
1) The master station sends a command message to a slave station.
2) The slave station checks that the station No. in the received message matches with the own station No. or
not.
3) If matched, the slave station executes the command and sends back the response message.
4) If mismatched, the slave station leaves the command message and wait for the next command message.
a) In case when the station No. in the received command message matches with the own slave station No.
Master to slave
Slave to master
b) In case when the station No. in the received command message mismatches with the own slave station
No.
Master to slave
Slave to master
5) To assure safety, provide a structure where the response message is checked and retry is made three (3)
times or more if no response is made or an error occurs.
The master station can individually communicate with any one of slave stations connected on the same line upon
setting the station No. in the command message.
Command message
Command message
Response message
(Not respond)
Data on
the line
Data on
the line
- 8 -
5.2 Composition of Message
Command message and response message consist of 4 fields ; Station No., Function code, Data and Error check
code. And these are send in this order.
Station No. (1 byte)
Function code (1 byte)
Data (2 to 133 bytes)
Error check code (CRC-16) (2 bytes)
Fig. 5-1 Composition of message
In the following, each field is explained.
(1) Station No
Station No. is the number specifiing a slave station. The command message is received and operated only by
the slave station whose station No. matches with the No. set in the parameter “ MODBUS Station No.”
For details of setting the parameter “ MODBUS Station No.”, refer to chapter 4.
(2) Function code
This is a code to designate the function executed at a slave station.
For details, refer to section 5.4.
(3) Data
Data are the data required for executing function codes. The composition of data varies with function codes.
For details, refer to chapter 6.
A register number is assigned to each data in the recorder. For reading/writing
the data by communication, designate the register number.
Note that the register number transmitted on message is expressed as its relative address.
The relative address is calculated by the following expression.
The lower 4 digits of the
Relative address
For example, when the resister number designated by a function code is 40003,
Relative address = (lower 4 digits of 40003)
= 0002
is used on the message.
=
register number
-
1
- 1
- 9 -
(1) Error check code
This is the code to detect message errors (change in bit) in the signal transmission.
On the MODUBUS protocol (RTU mode), CRC-16 (Cycric Redundancy Check) is applied.
For CRC calculation method, refer to section 5.5.
- 10 -
5.3 Response of Slave Station
(1) Response for normal command
To a relevant message, the slave station creates and sends back a response message which corresponds to the
command message. The composition of message in this case is the same as in section 5.2.
Contents of the data field depend on the function code. For details, refer to Chapter 6.
(2) Response for abnormal command
If contents of a command message have an abnormality (for example, non-actual function code is designated)
other than transmission error, the slave station does not execute that command but creates and sends back a
response message at error detection.
The composition of response message at error detection is as shown in Fig. 5-2 The value used for function
code field is function code of command message plus 80
Table 5-1 gives error codes.
Station No.
Function code + 80H
Error code
Error check (CRC-16)
.
H
Error code Contents Description
01H Illegal function code Non-actual function code is designated.
02H Illegal data address A relative address of a resister number to which the
03H Illegal data number Because the designation of number is too much,
(3) No response
Under any of the following items, the slave station takes no action of the command message and sends back no
response.
• A station number transmitted in the command message differs from the station number specified to the
slave station.
• A error check code is not matched, or a transmission error (parity error, etc.) is detected.
• The time interval between the composition data of the message becomes longer than the time
corresponding to 24 bits. (Refer to section 5.6 Transmission Control Procedure)
• Station No. of a slave station is set to 0.
Fig. 5-2 Response message at error detection
Table 5-1 Error Code
Check for the function code.
designated function code can not be used.
the area where resister numbers do not exist is
designated.
- 11 -
5.4 Function Code
According to MODBUS protocol, register numbers are assigned by function codes.
Each function code acts on specific register number.
This correspondence is shown in Table5-2, and the message length by function is shown in Table5-3.
Table5-2 Correspondence between function codes and objective address
Function code
No. Function Object
03H
04H
10H
Function
code
03H Read-out of word data 64 words 887 133
04H
10H Write-in of continuous word data 64 words 111378 8