Teledyne 7600 User Manual

TELEDYNE ANALYTICAL INSTRUMENTS
Instruction Manual
INFRARED GAS
ANALYZER
COMMUNICATION
FUNCTIONS (MODBUS)
Teledyne Analytical Instruments
2
CONTENTS
1. COMMUNICATION FUNCTIONS ...............................................…...........................3
1.1 General..............................................................................................................3
2. SPECIFICATIONS..........................................................................................................4
2.1 Communication specifications...........................................................................4
3. CONNECTION................................................................................................................5
3.1 Terminal allocation ..............................................................….........................5
3.2 Connection ...................................................................….................................5
4. SETTING OF COMMUNICATION CONDITION........................................................6
4.1 Set items.........................…................................................................................6
4.2 Setting operation................................................................................................6
5. MODBUS COMMUNICATION PROTOCOL..............................................................7
5.1 General...............................................................................................................7
5.2 Composition of message....................................................................................8
5.3 Response of slave station.................................................................................10
5.4 Function code...................................................................................................11
5.5 Calculation of error check code (CRC-16) ...................…..............................12
5.6 Transmission control procedure.......................................................................14
6. DETAILS OF MESSAGE ............................................................................................16
6.1 Read-out of word data [Function code:03H] ..................................................16
6.2 Read-out of read only word data [Function code:04H]...................................18
6.3 Write-in of word data (1 word) [Function code:06H].................…................20
6.4 Write-in of continuous word data [Function code:10H] ...........…..................21
7. ADDRESS MAP AND DATA FORMAT....................................................................23
7.1 Data format .......................................…..........................................................23
7.2 Address map ................................................…................................................25
7.3 Supplement to address map ............................................................................34
8. SAMPLE PROGRAM ................................................…..............................................36
9. TROUBLESHOOTING.................................................................................................42
Teledyne Analytical Instruments
3
1. COMMUNICATION FUNCTIONS
1.1 General
• This instrument provides a communication function through RS-232 interface, which allows data transmit to or receive from the host computer and other devices.
• The communication system is comprised of a master station and slave stations. One slave station (this instrument) can be connected to one master station. It is also possible to adapt the instrument to the environment of RS-485 interface using RS-232 RS-485 converter. In this case, up to 31 of slave station (present instrument) can be connected per master station.
• Because the master station can communicate with only one slave station at a time, the destination can be identified by the "Station No" set for each slave station.
• In order that the master station and the slave station can communicate, the format of the transmit/receive data must coincide. In this instrument, the format of the communication data is determined by the MODBUS protocol.
[RS-232 RS-485 converter] (recommended article) Type: KS-485 (non-isolated type) / SYSTEM SACOM Corp. Type: SI-30A (isolated type) / SEKISUI ELECTRONICS Co., Ltd.
Teledyne Analytical Instruments
4
2. SPECIFICATIONS
2.1 Communication Specifications
Item
Specifications Electrical specification
Based on EIA RS-232 Transmission system
2-wire, semi-duplicate Synchronizing system
Start-stop synchronous system Connection format
1 : 1 Number connectable units
1 unit (or 31 if RS-485 interface is used Transmission speed
9600bps Data format
Data length
8 bits Stop hit
1 bit Parity
None X flow control
None Transmission code
HEX value (MODBUS RTU mode) Error detection
CRC-16 Isolation
No isolation between transmission circuit and others
Teledyne Analytical Instruments
5
3. CONNECTION
WARNING: For avoiding electric shock and malfunctions, do not turn on power supply until all wiring has been completed.
3.1 Terminal allocation (Input / Output terminal CN2)
Terminal number
Signal name
Pin connection
2
Receive data
3
Transmit data
5
Signal GND
Others
NC
9-pin D-Sub (male)
3.2 Connection
As connecting cable, use a commercially available RS-232 reverse cable.
Connect the cable to CN2 on the input/output terminal block (on rear for 7500, separate for
7600).
Teledyne Analytical Instruments
6
4. SETTING OF COMMUNICATION CONDITION
In order that the master station and instrument can correctly communicate, following settings are required.
• All communication condition settings of the master station are the same as those of instruments.
• All instruments 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.
Item
Value at delivery
Setting range
Remarks
Transmission speed
9600bps
Fixed (cannot be changed)
Data length
8 bits
Fixed (cannot be changed)
Stop bit
1 bit
Fixed (cannot be changed)
Parity setting
None
Fixed (cannot be changed)
Set the same communication condition to the
master station and
all slave stations
Station No.
1
Fixed (cannot be changed)
Set a different value
to each station.
4.2 Setting operation
Set the station No. on the analyzer maintenance mode display (see the instruction manual).
Teledyne Analytical Instruments
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.
b) In a case when the station No. in the received command message mismatches with the own slave station No.
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.
Teledyne Analytical Instruments
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 sent 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 specifying a slave station. Only a slave station that corresponds to a value to which "Station No." is set on the analyzer maintenance mode display executes a command.
(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 analyzer. 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.
* * Relative address * * (The lower 4 digits of the Register number) - 1
For example, when the resister number designated by a function code is 40003,
* * Relative address = (The lower 4 digits of 40003) - 1 = 0002 is used on the message
Teledyne Analytical Instruments
9
(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.
Teledyne Analytical Instruments
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 80H.
Table 5-1 gives error codes.
Station No.
Function code +80n
Error code
Error check (CRC-16)
Fig. 5-2 Response message at error detection
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 function
A relative address of a resister number to which the designated function code can not be used.
03H
Illegal function
Because the designation of number is too much, the area where 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. An 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 buts. (Refer to section 5.6: Transmission control procedure.)
Teledyne Analytical Instruments
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 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
Resister No.
No.
Function
Object
No.
Contents
03H
Read out
(continuously)
Holding
register
4xxxx
Read out / Write in
word data
04H
Read out
(continuously)
Input register
3xxxx
Read out word
data
06H
Write-in
Holding
register
4xxxx
Read out / Write in
word data
10H
Write-in
(continuously)
Holding
register
4xxxx
Read out / Write in
word data
Table 5-3: Function code and message length [Unit: byte]
Command message
Response message
Function
code
Contents
Number of
designatable
data
Minimum
Maximum
Minimum
Maximum
03H
Read-out of
word data
60 words
8 8 7
133
04H
Read-out of
word data
(read-out
only)
15 words
8 8 7
133
06H
Write-in of
word data
1 word
8 8 8
8
10H
Write-in of continuous
word data
60 words
11
137 8 8
Teledyne Analytical Instruments
12
5.5 Calculation of error check code (CRC-16)
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.
The following shows the calculation procedure for CRC-16.
(a) Store FFFFH into 16 bit register (CRC register).
(b) Subject the 1st byte (8 bits) of transmit message and CRC register contents to an exclusive logical summation (XOR), and store the result into the CRC register.
(c) Shift the CRC register contents 1 bit to the right. Store 0 at MSB.
(d) If LSB before shifting is 0, do nothing. If LSB before shifting is 1, subject it and A001H to XOR, and store the result into the CRC register.
(e) Repeat the steps (c) and (d) 8 times (shift by 8 bits).
(f) Execute steps (b) to (e) for the next byte of the transmit message. Likewise, successively repeat the steps to each byte of the transmit message.
(g) The CRC code that is retained is the value of CRC register that stands when the processing has ended for latest byte (latest data except error code) of the transmit message.
(h) As error check code of the transmit message, store this CRC value in the order of lower 8 bits and upper 8 bits.
Transmit message (ex.)
01 06H 00
H
05H 03
H
E8H 99
H
75H
Successively calculate data included here to obtain CRC. In this case, CRC = 75 99H.
Attach the error check code to message upon interchanging the upper and lower orders.
Fig. 5-3 shows the flow of the CRC-16 calculation system.
Teledyne Analytical Instruments
13
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
Fig. 5-3: Flow of the CRC-16 calculation system.
Loading...
+ 29 hidden pages