Fuji Electric PXR3 Instruction Manual

Instruction Manual
MICRO CONTROLLER X COMMUNICATION FUNCTIONS (RS-485 MODBUS)
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.

CONTENTS

1. COMMUNICATION FUNCTIONS
1.1 General
2. SPECIFICATIONS
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
2.1 Communication Specifications
3. CONNECTION
3.1 Terminal Allocation
3.2 Wiring
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
4. SETTING OF COMMUNICATION CONDITION
4.1 Set Items
4.2 Setting Operation Method
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
5. MODBUS COMMUNICATION PROTOCOL
5.1 General
5.2 Composition of Message
5.3 Response of Slave Station
5.4 Function Code
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
5.5 Calculation of Error Check Code (CRC-16)
5.6 Transmission Control Procedure
5.7 FIX Processing (Cautions at write-in of data)
6. DETAILS OF MESSAGE
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
6.1 Read-out of Bit Data Function code:01
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
H
6.2 Read-out of Read-out Only Bit Data [Function code:02
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
6.3 Read-out of Word Data [Function code:03
]
H
6.4 Read-out of Read-out Only Word Data [Function code:04
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
6.5 Write-in of Bit Data (1 bit) [Function code:05
]
H
6.6 Write-in of Word Data (1 word) [Function code:06
6.7 Write-in of Continuous Word Data [Function code:10
7. ADDRESS MAP AND DATA FORMAT
7.1 Data Format
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
7.2 Address Map of Internal Calculation Value Data
7.3 Address Map of Engineering Unit Data
7.4 Additional Explanation of Address Map
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
]
H
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
]
H
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
]
H
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
]
H
1
1
2
2
3
3
4
5
5
6
7
7
8
10
11
12
13
15
16
16
17
19
22
24
25
26
28
28
31
36
41
8. SAMPLE PROGRAM
9. TROUBLESHOOTING
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
i
44
49
1. COMMUNICATION FUNCTIONS
1.1 General
• PXR provides a communication function by RS-485 interface, by which it can transmit and receive data to and
from host computer, programmable controller, graphic display panel, etc.
• The communication system consists of master station and slave stations. Up to 31 slave stations (PXR) 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 "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 PXR, the format of the communication data is determined by the MODBUS protocol.
• Please use an RS-232CRS-485 converter in case of designating a personal computer or other devices which
have an RS-232C interface as a master station.
[RS-232CRS-485 converter] (recommended article)
Type: KS-485 (non-isolated type)/SYSTEM SACOM Corp. Type: SI-30A (isolated type)/SEKISUI ELECTRONICS Co., Ltd.
[Note] MODBUS
Programmable
controller
RS-485
®
is the registered trade mark of Gould Modicon.
Personal computer
RS-232C
RS-232C  RS-485 converter
RS-485
1
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 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 filter PXR
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-232C RS-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

Function code

No. Function Object 01H Read-out
Coil
0xxxx Read-out/write-in bit data
Coil No. and resister No.
No. Contents
(continuously)
02H Read-out
Input relay
1xxxx Read-out bit data
(continuously)
03H Read-out
Holding register
4xxxx Read-out/write-in word data
(continuously)
04H Read-out
Input register
3xxxx Read-out word data
(continuously) 05H Write-in Coil 06H Write-in Holding register 10H Write-in
Holding register
0xxxx Read-out/write-in bit data 4xxxx Read-out/write-in word data 4xxxx Read-out/write-in word data
(continuously)
Table 5-3 Function code and message length
[Unit:byte]
Function
code
Contents Number of
designatable
Command message Response message
Minimum Maximum Minimum Maximum
data
01H Read-out of bit data 1bit 02H Read-out of bit data (read-out only) 8 bits 03H Read-out of word data 60 words 04H Read-out of word data
*1
*1
15 words
*1
*1
8 8 6 6 8 8 6 6 8 8 7 125 8 8 7 35
(read-out only) 05H Write-in of bit data 1 bit 8 8 8 8 06H Write-in of word data 1 word 8 8 8 8 10H Write-in of continuous word data 60 words
*1
11 129 8 8
*1) The "Number of designatable data" given above is the limit due to the number of data which the instrument
assigns to coil number and register number (except function codes 05
, 06H).
H
11

5.5 Calculation of Error Check Code (CRC-16)

t
CRC-16 is the 2-byte (16-bits) error check code. From the top of the message (station No.) to the end of the
data field are calculated.
The slave station calculates the CRC of the received message, and does not respond if the calculated CRC is
different from the contents of the received CRC code.
Fig. 5-3 shows the flow of the CRC-16 calculation system.
Start
Set FFFFH (hexadecimal number) in CR.
Set 1 in J.
Exclusive logical sum (XOR) is executed with CR and one character (1 byte) of the I characters, and its results is set in CR.
Set 1 in J.
Bit at right end
of CR is 1?
YES
Shift CR to right by 1 bit, and A001H and exclusive logical sum (XOR) are executed and its result is set in CR.
NO
Explanation of variables
CR:CRC error check data (2 bytes)
I:Digits of calculation characters
in command message
J:Check on the number of times
of CR calculation
Shift CR to righ by 1 bit.
NO
NO
Add 1 to J.
Calculation (8 times) is finished?
J>8
YES
Add 1 to J.
Calculation of all characters is
completed?
I>All characters
YES
End
Fig. 5-3 Flow of CRC-16 calculation
(Calculation is executed in the order of command message station No., function code and data.)
CR calculation result shall be added to the last command message in the order of LOW byte and HIGH byte.
12

5.6 Transmission Control Procedure

(1) Transmission procedure of master station
The master station must proceed to a communication upon conforming to the following items.
(1-1) Before sending a command message, provide 48 bits time or more vacant status.
(1-2) For sending, the interval between bytes of a command message is below 24 bits time.
(1-3) Within 24 bits time after sending a command message, the receiving status is posted.
(1-4) Provide 48 bits time or more vacant status between the end of response message reception and
beginning of next command message sending [same as in (1-1)].
(1-5) For ensuring the safety, make a confirmation of the response message and make an arrangement so
as to provide 3 or more retries in case of no response, error occurrence, etc.
Note) The above definition is for most unfavorable value. For ensuring the safety, it’s recommended the
program of the master to work with safety factors of 2 to 3. Concretely, it is advised to arrange the
program for 9600 bps with 10 ms or more for vacant status (1-1), and within 1 ms for byte interval (1-2)
and changeover from sending to receiving (1-3).
(2) Description
1) Detection of the message frame
Since the communication system uses the 2-wire RS-485 interface, there may be 2 statuses on a line below.
(a) Vacant status (no data on line) (b) Communication status (data is existing)
Instruments connected on the line are initially at a receiving status and monitoring the line. When 24 bits
time or more vacant status has appeared on the line, the end of preceding frame is assumed and, within
following 24 bits time, a receiving status is posted. When data appears on the line, instruments receive it
while 24 bits time or more vacant status is detected again, and the end of that frame is assumed. I.e., data
which appeared on the line from the first 24 bits time or more vacant status to the next 24 bits time or more
vacant status is fetched as one frame.
Therefore, one frame (command message) must be sent upon confirming the following.
(1-1) 48 bits time or more vacant status precedes the command message sending.
(1-2) Interval between bytes of 1 command message is smaller than 24 bits time.
2) Response of this instrument (PXR)
After a frame detection (24 bits time or more vacant status), this instrument carries out processing with that
frame as a command message. If the command message is destined to the own station, a response
message is returned. Its processing time is 1 to 30 ms (depends on contents of command message).
After sending a command message, therefore, the master station must observe the following.
(1-3) Receiving status is posted within 24 bits time after sending a command message.
13
Loading...
+ 36 hidden pages