MICRO CONTROLLER X
COMMUNICATION
FUNCTIONS
(RS-485 MODBUS)
TYPE: PXR
INP-TN512642a-E
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.
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 500m max. (total extension distance)
Transmission speed 9600bps
Data format
Transmission code HEX value (MODBUS RTU mode)
Error detection CRC-16
Isolation Functional isolation between transmission circuit
Data length 8 bits
Stop bit 1 bit
Parity none, even, odd (selectable)
and others (withstand voltage : 500V AC)
-2-
3. CONNECTION
WARNING
For avoiding electric shock and malfunctions, do not turn on the power supply untill all wiring
have been completed.
3.1 Terminal Allocation
Terminal number Signal name
7 +
8 -
-3-
3.2 Wiring
• Use twisted pair cables with shield.
Recommended cable: 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 PXR 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 PXR is to be installed where the level of noise applied to the PXR 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 filterPXR
Transmission
cable
Slave station (PXR)
Twisted pair cable with shield
−
FG
Terminating resistor
100Ω(1/2W)
RS-485 interface
or
RS-485 side of the RS-232CRS-485 converter
78+
−
Slave station (PXR)
78+
−
Slave station (PXR)
78+
−
Terminating resistor
100Ω(1/2W)
-4-
4.
In order that the master station and instrument (PXR) can correctly communicate, following settings are required.
SETTING OF COMMUNICATION CONDITION
• All communication condition settings of the master station are the same as those of instruments (PXR).
• All instruments (PXR) connected on a line are set to "Station Nos. (STno)" which are different from each other.
(Any "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.
Parameter
symbol
―――
―――
―――
CoM Parity setting 0
STno Station No. 1
Transmission speed 9600bps Fixed (can not be changed)
Data length 8 bits Fixed (can not be changed)
Stop bit 1 bit Fixed (can not be changed)
Item
Value at
delivery
Setting range Remarks
0: odd parity
1: even parity
2: none parity
0 to 255
(0:communication function stop)
Set the same
communication
condition to the master
station and all slave
stations.
Set a different value to
each station.
-5-
4.2 Setting Operation Method
The following example shows how to set the communication conditions.
Example: Selecting an even parity and “STno=18” on a station.
Key
operation
SEL
(6 seconds)
∨
SEL
∧∨
SEL
∨
SEL
∧∨
SEL
SEL
(3 seconds)
Indication Description
200
200
P-n1
0
STno
0
STno
0
STno
18
STno
18
CoM
0
CoM
0
CoM
1
CoM
1
200
200
Running state (PV/SV indication)
Press the SEL key for approximately 6 seconds. P-n1 appears and
No. 3 block parameter is selected.
Operate the ∨ key repeatedly until STno parameter appears. (If
past over, operate the ∧ key to return.)
Press the SEL key. The numeric value on the lower indicator
blinks and the setting mode is selected.
Operate the ∧ or ∨ key to change the numeric value to 18.
Press the SEL key again. The numeric value stops blinking and
the setting is registered.
Press the ∨ key to display the CoM parameter.
Press the SEL key. The numeric value on the lower indicator
blinks and the setting mode is selected.
Operate the ∧ or ∨ key until the numeric value changes to 1 (even
parity).
Press the SEL key again. The numeric value stops blinking and
the setting is registered.
Press the SEL key for 3 seconds to resume the running indication
(PV/SV indication).
-6-
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
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
-7-
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 125 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 "STno".
For details of setting the parameter "STno", 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 coil number or a register number is assigned to each data in the temperature controller. For reading/writing
the data by communication, designate the coil number or register number.
Note that the coil number or 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) – 1
= 0002
is used on the message.
=
Coil number or register number
– 1
-8-
(4) 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.
-9-
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)
Fig. 5-2 Response message at error detection
.
H
Table 5-1 Error code
Error code Contents Description
01H Illegal function Non-actual function code is designated.
Check for the function code.
02H Illegal data address A relative address of a coil number or resister
number to which the designated function code can
not be used.
03H Illegal data value Because the designation of number is too much,
the area where coil numbers or resister numbers do
not exist is designated.
(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)
・While the data is being written in non-volatile memory after write via communication, the next write is
attempted.
-10-
5.4 Function Code
According to MODBUS protocol, coil numbers and register numbers are assigned by function codes.
Each function code acts on specific coil number and register number.
This correspondence is shown in Table 5-2, and the message length by function is shown in Table 5-3.
Table 5-2 Correspondence between function codes and objective address