Schneider Electric Altivar31 User Manual

Page 1
Altivar 31
####
####
####
Modbus
User’s manual
11/2009
1624597
www.schneider-electric.com
Page 2

Contents

While every precaution has been taken in the preparation of this document, Schneider Electric SA assumes no liability for any omissions or errors it may contain, nor for any damages resulting from the application or use of the information herein.
The products described in this document may be changed or modified at any time, either in appearance or in their operation. Their description can in no way be considered contractual.
Presentation ________________________________________________________________________________________________ 3 Connection to RS485 bus ______________________________________________________________________________________ 4 Modbus protocol _____________________________________________________________________________________________ 8 Appendix: Non-standard RS485 schematics_______________________________________________________________________ 13
Page 3

Presentation

The Modbus socket on the Altivar 31 can be used for the following functions:
• Configuration
• Settings
• Control
• Monitoring
The ATV31 drive supports:
• The 2-wire RS485 physical layer
• The RTU transmission mode
This guide contains information on installation and describes the Modbus services available. The "communication variables" guide describes the operating modes, as well as the Altivar 31 variables and parameters which can be accessed via the communication bus.
1624597 11/2009 3
Page 4

Connection to RS485 bus

8........................1

Connection to ATV31

Connection accessories should be ordered separately (please consult our catalogues).
Connect the RJ45 cable connector to the ATV31 connector.
Pin out of the ATV31 RJ45 Connector
View from underneath
Pin Signal
1CAN_H
2CAN_L
3CAN_GND
4D1 (1)
5D0 (1)
6 Not connected
7VP (2)
8 Common (1)
(1) Modbus signals (2) Supply for RS232 / RS485 converter or a remote terminal

Protection against interference

• Use the Schneider-Electric cable with 2 pairs of shielded twisted conductors (reference: TSXCSA100, TSXCSA200, TSXCSA500).
• Keep the Modbus cable from the power cables (30 cm minimum).
• Make any crossovers of the Modbus cable and the power cables at right-angles, if necessary.
• Connect the cable shielding to the ground of each device.
For more information, please refer to the TSX DG KBL E guide: "Electromagnetic compatibility of industrial networks and fieldbuses".

RS485 bus schematic

The RS485 standard allows variants of different characteristics:
• polarisation
• line terminator
• distribution of a reference potential
• number of slaves
• length of bus
The new Modbus specification published on the Modbus.org site in 2002 contains precise details of all these characteristics. They are also summarised in the next paragraph (Standard schematic). The new Schneider-Electric devices conform to this specification.
Some devices comply with earlier specifications. The two most widespread are described in the appendices:
• "Uni-Telway schematic" page 13
• "Jbus schematic" page 14
Requirements enabling different types of protocol to coexist are given in the appendix:
• "Mixed schematic" page 15
4 1624597 11/2009
Page 5
Connection to RS485 bus
1n F
650 Ω
650 Ω
120 Ω
1n F
120 Ω
5 V
0 V
T
R
T
R
T
R
D1
Common
D0
Master
Standard schematic
The standard schematic corresponds to the Modbus specification published on the Modbus.org site in 2002 (Modbus_over_serial_line_V1.pdf, Nov 2002) and in particular to the schematic of the 2-wire multidrop serial bus.
The ATV31 drive conforms to this specification.
Schematic diagram:
Slave 1
Type of trunk cable
Maximum length of bus
Maximum number of stations (without repeater)
Maximum length of tap links
Bus polarisation
Line terminator
Common polarity
Slave n
Shielded cable with 1 twisted pair and at least a 3rd conductor 1000 m at 19200 bps with the Schneider-Electric TSX CSAppp cable
32 stations, ie. 31 slaves
• 20 m for one tap link
• 40 m divided by the number of tap links on a multiple junction box
• One 450 to 650 Ω pulldown resistor at 5 V (650 Ω recommended)
• One 450 to 650
Ω pulldown resistor at the Common (650 Ω recommended)
This polarisation is recommended for the master.
One 120 Ω 0.25 W resistor in series with a 1nF 10 V capacitor
Yes (Common), connected to the protective ground at one or more points on the bus
1624597 11/2009 5
Page 6
Connection to RS485 bus
5
44
7
4
1
2
43 46 6 5
A TV 31
######## #### ########
Connection via RJ45 wiring system
1 Master (PLC, PC or communication module)
2 Modbus cable depending on the type of master (see table)
3 Modbus splitter block LU9 GC3
4 Modbus drop cables VW3 A8 306 Rpp
5 Line terminators VW3 A8 306 RC
6 Modbus T-junction boxes VW3A8306TFpp (with cable)
7 Modbus cable (to another splitter block) TSX CSAp00
Connection accessories
Description Reference
Modbus splitter block 10 RJ45 connectors and 1 screw terminal LU9 GC3
Modbus T-junction boxes With integrated cable (0.3 m) VW3 A8 306 TF03
With integrated cable (1 m) VW3 A8 306 TF10
Line terminators
For RJ45 connector R = 120 Ω, C = 1 nF VW3 A8 306 RC
R = 150 Ω (specific to "Jbus schematic" page 14) VW3 A8 306 R
Connecting cables
Description Length
Cables for Modbus bus
RS 485 double shielded twisted pair cables
Type of master Master interface Modbus connection accessories for RJ45 wiring system
Twido PLC
TSX Micro PLC Mini-DIN RS485 connector
TSX Premium PLC TSX SCY 11601 or
Ethernet bridge (174 CEV 300 10)
Profibus DP gateway (LA9P307)
Fipio (LUFP1) or Profibus DP (LUFP7) or DeviceNet (LUFP9) gateway
Serial port PC Male SUB-D 9 RS232 serial
6 1624597 11/2009
m
3 1 RJ45 connector and 1 stripped end VW3 A8 306 D30
0.3 2 RJ45 connectors VW3 A8 306 R03
1 2 RJ45 connectors VW3 A8 306 R10
3 2 RJ45 connectors VW3 A8 306 R30
100 Supplied without connector TSX CSA 100
200 Supplied without connector TSX CSA 200
500 Supplied without connector TSX CSA 500
Adaptor or mini-DIN RS485 interface module
Adaptor or screw terminal RS485 interface module
port
PCMCIA card (TSX SCP114)
TSX SCY 21601 module (SUB-D 25 socket)
PCMCIA card (TSX SCP114)
Screw terminal RS485 3 m cable fitted with an RJ45 connector and stripped at the
RJ45 RS485 1 m cable fitted with 2 RJ45 connectors VW3 P07 306 R10
RJ45 RS485 0.3 m cable fitted with 2 RJ45 connectors or
port PC
Connectors Reference
Description Reference
3 m cable fitted with a mini-DIN connector and an RJ45 connector
3 m cable fitted with an RJ45 connector and stripped at the other end
3 m cable fitted with a mini-DIN connector and an RJ45 connector
Stripped cable TSX SCP CM 4030
Cable fitted with a SUB-D 25 connector and stripped at the other end (for connection to the screw terminals of the LU9GC3 splitter block)
Stripped cable TSX SCP CM 4030
other end
1 m cable fitted with 2 RJ45 connectors or 3 m cable fitted with 2 RJ45 connectors
RS232/RS485 converter and 3 m cable fitted with an RJ45 connector and stripped at the other end (for connection to the screw terminals of the LU9GC3 splitter block)
TWD XCA RJ030
VW3 A8 306 D30
TWD XCA RJ030
TSX SCY CM 6030
VW3 A8 306 D30
VW3 A8 306 R03 or VW3 A8 306 R10 or VW3 A8 306 R30
TSX SCA 72 and VW3 A8 306 D30
Page 7
Connection to RS485 bus
32
6
1
7
45
A TV 31
######## ####
Connection via junction boxes
1 Master (PLC, PC or communication module)
2 Modbus cable depending on the type of master
3 Modbus cable TSX CSAp00
4 Junction box TSX SCA 50
5 Subscriber sockets TSX SCA 62
6 Modbus drop cables VW3A8306
7 Modbus drop cable VW3 A8 306 D30
Connection accessories
Description Reference
Junction box
3 screw terminals and an RC line terminator, to be connected using cable VW3 A8 306 D30
Subscriber socket
2 female 15-way SUB-D connectors, 2 screw terminals, and RC line terminator, to be connected using cable VW3 A8 306 or VW3 A8 306 D30
TSX SCA 50
TSX SCA 62
Connecting cables
Description LengthmConnectors Reference
Cables for Modbus bus 3 1 RJ45 connector and one stripped end VW3 A8 306 D30
5 1 RJ45 connector and 1 male 15-way SUB-D connector for TSX SCA 62 VW3 A8 306
RS 485 double shielded twisted pair cables
Type of master Master interface Modbus connection accessories for junction boxes using screw
Twido PLC Adaptor or screw terminal RS485
TSX Micro PLC Mini-DIN RS485 connector port Junction box TSX P ACC 01
TSX Premium PLC TSX SCY 11601 or
Ethernet bridge (174 CEV 300 10)
Profibus DP gateway (LA9P307)
Fipio (LUFP1) or Profibus DP (LUFP7) or DeviceNet (LUFP9) gateway
Serial port PC Male 9-way SUB-D RS232 serial
100 Supplied without connector TSX CSA 100
200 Supplied without connector TSX CSA 200
500 Supplied without connector TSX CSA 500
terminals
Description Reference
interface module
PCMCIA card (TSX SCP114) Cable fitted with a special connector and stripped
TSX SCY 21601 module (SUB-D 25 socket)
PCMCIA card (TSX SCP114) Cable fitted with a special connector and stripped
Screw terminal RS485 Modbus cable TSX CSA100 or
RJ45 RS485 3 m cable fitted with an RJ45 connector and
RJ45 RS485 3 m cable fitted with an RJ45 connector and
port PC
Modbus cable TSX CSA100 or
at the other end
Cable fitted with a SUB-D 25 connector and stripped at the other end
at the other end
stripped at the other end
stripped at the other end
RS232/RS485 converter and Modbus cable
TSX CSA200 or TSX CSA500
TSX SCP CU 4030
TSX SCY CM 6030
TSX SCP CU 4030
TSX CSA200 or TSX CSA500
VW3 A8 306 D30
VW3 A8 306 D30
TSX SCA 72 and TSX CSA100 or TSX CSA200 or TSX CSA500
1624597 11/2009 7
Page 8

Modbus protocol

COM-
Add
tbr
tFO
Only one device can transmit on the line at any time. The master manages the exchanges and only it can take the initiative. It interrogates each of the slaves in succession. No slave can send a message unless it is invited to do so. The master repeats the question when there is an incorrect exchange, and declares the interrogated slave absent if no response is received within a given time period. If a slave does not understand a message, it sends an exception response to the master. The master may or may not repeat the request.
Master
Slave i
Slave k
Slave j

Configuration of the serial link

Configuration of the serial link parameters can be accessed from the Communication menu
Parameters Possible values Terminal display Default value
Address 1 to 247 001 to 247 1
Speed 4800 bps
9600 bps 19200 bps (1)
Format 8 data bits, odd parity, 1 stop bit
8 data bits, even parity, 1 stop bit (1) 8 data bits, no parity, 1 stop bit 8 data bits, no parity, 2 stop bits
(1) The display terminal will only work with these values.
4.8
9.6
19.2
8O1 8E1 8n1 8n2

RTU mode

The transmission mode used is RTU mode. The frame contains no message header byte, nor end of message bytes. It is defined as follows:
Slave
address
The data is transmitted in binary code. CRC16: cyclical redundancy check. The end of the frame is detected on a silence greater than or equal to 3 characters.
Request code Data CRC16

Principle

The Modbus protocol is a master-slave protocol.
19200 bps
8E1
Direct slave-to-slave communications are not possible.
For slave-to-slave communication, the application software must therefore be designed to interrogate a slave and send back data received to the other slave.
Two types of dialogue are possible between master and slaves:
• the master sends a request to a slave and waits for its response
• the master sends a request to all slaves without waiting for a response (broadcasting principle)

Addresses

• The drive Modbus address can be configured from 1 to 247.
• Address 0 coded in a request sent by the master is reserved for broadcasting. ATV 31 drives take account of the request, but do not respond to it.
8 1624597 11/2009
Page 9
Modbus protocol
Modbus functions
The following table indicates which Modbus functions are managed by the Altivar 31, and specifies their limits. The “read” and “write” functions are defined from the point of view of the master.
Code
(decimal)
3 Read N output words NO 29 words max. Read Holding Registers
6 Write one output word YES Preset Single Register
16 Write N output words YES 27 words max. Preset Multiple Regs
43 Identification NO Read Device Identification
Function name Broadcasting Max. value of N Modbus standard name
Read N output words: function 3
Note:
Hi = high order byte, Lo = low order byte.
This function can be used to read all ATV 31 words, both input words and output words.
Request
Slave
no.
1 byte 1 byte 2 bytes 2 bytes 2 bytes
Response
Slave
no.
1 byte 1 byte 1 byte 2 bytes 2 bytes 2 bytes
Example: read 4 words W3102 to W3105 (16#0C1E to 16#0C21) in slave 2, using function 3, where:
• SFr = Switching frequency = 4 kHz (W3102 = 16#0028)
• tFr = Maximum output frequency = 60 Hz (W3103 = 16#0258)
• HSP = High speed = 50 Hz (W3104 = 16#01F4)
• LSP = Low speed = 0 Hz (W3105 = 16#0000)
03 No. of first word Number of words CRC16
Hi Lo Hi Lo Lo Hi
03
Number of bytes read
First word value ------- Last word value CRC16
Hi Lo Hi Lo Lo Hi
Request 02 03 0C1E 0004 276C
Response 02 03 08 0028 0258 01F4 0000 52B0
Value of: W3102 W3103 W3104 W3105
Parameters: SFr tFr HSP LSP
Write one output word: function 6
Request and response (the frame format is identical)
Slave
no.
1 byte 1 byte 2 bytes 2 bytes 2 bytes
Example: write value 16#000D in word W9001 (16#2329) in slave 2 (ACC = 13 s).
Request and response 02 06 2329 000D 9270
06 Word number Value of word CRC16
Hi Lo Hi Lo Lo Hi
1624597 11/2009 9
Page 10
Modbus protocol
Identification: Function 43 (16#2B)
Request
Slave
no.
1 byte 1 byte 1 byte 1 byte 1 byte 2 bytes
Response
Slave
no.
1 byte 1 byte 1 byte 1 byte 1 byte
------- Number of additional frames
------- Id of object no. 1
------- Id of object no. 2
------- Id of object no. 3
2B Type of MEI
0E
2B Type of MEI
0E
00
1byte 1byte 1byte
Length of object no. 1
00
1 byte 1 byte 13 bytes
Length of object no. 2
01
1 byte 1 byte 15 bytes
Length of object no. 3
02
1byte 1byte 04bytes
ReadDeviceId
ReadDeviceId
0D
0F
04
01
01
Object Id
00
Degree of conformity
02
Next object Id
00
Value of object no. 1
“Schneider-Electric”
Value of object no. 2
“ATV31HU09M3S232”
Value of object no. 3
“0201”
Lo Hi
Number of objects03-------
CRC16
-------
-------
-------
-------
------- CRC16
Lo Hi
1byte 1byte
The total response size equals 48 bytes
The three objects contained in the response correspond to the following objects:
• Object no. 1: Manufacturer name (always “Schneider-Electric”, ie. 13 bytes).
• Object no. 2: Device reference (ASCII string; for example: “ATV31HU09M3S232”, ie. 15 bytes).
• Object no. 3: Device version, in “MMmm” format where “MM” represents the determinant and “mm” the subdeterminant (4-byte ASCII
Note: The response to function 43 may be negative; in this case, the response located at the top of the next page is sent by the Altivar 31 rather than the response described above.
string; for example: “0201” for version 2.1).
10 1624597 11/2009
Page 11
Modbus protocol
Negative response
Slave
no.
1 byte 1 byte 1 byte 1 byte 1 byte 1 byte
Error code: • 16#00 = No error
Example: Following the request from the Modbus master, slave 2 identifies itself as follows:
• Manufacturer name = “Schneider-Electric” (13 bytes)
• Device name = “ATV31HU09M3S232” (15 bytes)
• Device version = “0201” (4 bytes)
Request 02 2B 0E 01 00 3477
Response 02 2B 0E 01 02 00 00 03 -------
------- 00 0D 54 45 4C 45 4D 45 43 41 4E 49 51 55 45 -------
------- 01 0F 41 54 56 33 31 48 55 30 39 4D 33 53 32 33 32 -------
2B + 80
AB
• 16#01 = The “Request code” (16#2B), the “Type of MEI” (16#0E) or the “ReadDeviceId” (16#01) contained in the
• 16#02 = The “Object Id” (16#00) contained in the request is incorrect
Type of MEI
0E
request is incorrect
Error code
00 to 02
CRC16
Lo Hi
------- 02 04 30 32 30 31 A80F
Write N output words: function 16 (16#10)
Request
No.
slave
1 byte 1 byte 2 bytes 2 bytes 1 byte 2 bytes 2 bytes
Response
Slave
no.
1 byte 1 byte 2 bytes 2 bytes 2 bytes
Example: write values 20 and 30 in words W4043 and W4044 in slave 2 (ACC = 20 s and DEC = 30 s)
Request 02 10 0FCB 0002 04 0014 001E 30F4
Response 02 10 0FCB 0002 3311
10 No. of first word Number of
Hi Lo Hi Lo Lo Hi
10 No. of first word Number of words CRC16
Hi Lo Hi Lo Lo Hi
words
Number of
bytes
Value of first word ------- CRC16
1624597 11/2009 11
Page 12
Modbus protocol
Exception responses
An exception response is returned by a slave when it is unable to perform the request which is addressed to it.
Format of an exception response:
Slave
no.
1 byte 1 byte 1 byte 2 bytes
Response code: request function code + 16#80.
Error code:
1 = The function requested is not recognized by the slave 2 = The bit or word addresses indicated in the request do not exist in the slave 3 = The bit or word values indicated in the request are not permissible in the slave 4 = The slave has started to execute the request but cannot continue to process it completely
Response
code
Error code
CRC16
Lo Hi
CRC16 calculation
The CRC16 is calculated on all the message bytes by applying the following method:
Initialize the CRC (16-bit register) to 16#FFFF.
Enter the first to the last byte of the message:
CRC XOR <byte> —> CRC
Enter 8 times
Move the CRC one bit to the right
If the output bit = 1, enter CRC XOR 16#A001—> CRC
End enter
End enter
The CRC obtained will be transmitted with the low order bytes sent first, followed by the high order ones (unlike the other data contained in Modbus frames).
XOR = exclusive OR.
12 1624597 11/2009
Page 13

Appendix: Non-standard RS485 schematics

1 nF
4.7 kΩ
4.7 kΩ
4.7 kΩ
4.7 kΩ
120 Ω
1 nF
120 Ω
5 V
0 V 0 V
4.7 kΩ
R
T
R
T
4.7 kΩ
5 V
5 V
0 V
R
T
D(B)
0VL
D(A)
Slave 1
Slave n
Master

Uni-Telway schematic

The Uni-Telway bus schematic has been used by Schneider-Electric for its drives and soft starters (ATV58, ATV28, etc).
Schematic diagram:
Type of trunk cable Cable with 2 twisted pairs shielded in pairs
Maximum length of bus 1000 m at 19200 bps
Maximum number of stations (without repeater)
29 stations, ie. 28 slaves
Maximum length of tap links • 20 m
• 40 m divided by the number of tap links on a multiple junction box
Bus polarisation For the master and each slave:
• One 4.7 kΩ pulldown resistor at 5 V
• One 4.7 kΩ pulldown resistor at 0 VL
Line terminator One 120 Ω 0.25 W resistor in series with a 1 nF 10 V capacitor
Common polarity Yes (0 VL) and high impedance placed between 0 VL and the ground in each station
1624597 11/2009 13
Page 14
Appendix: Non-standard RS485 schematics
470 Ω
470 Ω
150 Ω 150 Ω
5 V
0 V
T
R
T
R
T
R
L- (B/B')
L+ (A/A')
Slave 1 Slave n
Master
Jbus schematic
Schematic diagram:
Type of trunk cable Cable with 1 shielded twisted pair
Maximum length of bus 1300 m at 19200 bps
Maximum number of stations (without
32 stations, ie. 31 slaves
repeater)
Maximum length of tap links 3 m
Bus polarisation One 470 Ω pulldown resistor at 5 V
One 470 Ω pulldown resistor at 0 V This polarisation is often provided in the master.
Line terminator One 150 Ω resistor
Common polarity No
14 1624597 11/2009
Page 15
Appendix: Non-standard RS485 schematics
1 nF
4.7 kΩ
Rp
Rp
120 Ω
5 V
0 V
5 V
0 V
D1
Common
D0
R
T
T
R
T
R
4.7 kΩ
1 nF
120 Ω
Slave 1
Slave n
Master
Mixed schematic
Slaves with 4.7 kΩ polarisation can be integrated into a standard schematic. Suitable polarisation (Rp) must be calculated.
Schematic diagram:
Type of trunk cable Shielded cable with 1 twisted pair and at least a 3rd conductor
Maximum length of bus 1000 m at 19200 bps
Maximum number of stations
At most 32 stations ie. 31 slaves (depending on Rp and the number of 4.7 kΩ resistors)
(without repeater)
Maximum length of tap links • 20 m for a single tap link
• 40 m divided by the number of tap links on a multiple junction box
Bus polarisation • One pulldown resistor at 5 V (Rp)
• One pulldown resistor at the Common (Rp) This polarisation can be provided in the master. The value of Rp should be validated (or determined) by calculating the equivalent polarisation (Re) according to the polarisation of the master and slave stations. The value of Re must be between 162 Ω and 650 Ω (recommended value: 650 Ω).
Line terminator One 120 Ω 0.25 W resistor in series with a 1 nF 10 V capacitor
Common polarity Yes (Common)
• To calculate the polarisation (Rp), all station polarisations must be deemed to be connected in parallel.
Example:
If the bus Rp polarisation is 470 Ω (installed in the master) and 2 slaves have 4700 Ω polarisation, the equivalent polarisation is: 1/Re = 1/470 + 1/4700 + 1/4700 ie. Re = 1/ (1/470 + 1/4700 + 1/4700) and therefore Re = 390 Ω. 390 Ω is greater than 162 Ω, and the schematic is correct.
For an ideal equivalent polarisation (650 Ω), Rp bus polarisation can be installed so that: 1/650 = 1/Rp + 1/4700 + 1/4700 ie. Rp = 1/(1/650 - 1/4700 - 1/4700) and therefore Rp = 587 Ω.
• If the master is fitted with a 470 Ω polarisation, it is possible to connect a maximum of 18 slaves with 4.7 kΩ polarisation.
1624597 11/2009 15
Page 16
Appendix: Non-standard RS485 schematics
Recommendations for setting up a Modbus network using non-standard devices
1. Identify polarities D0 and D1. They are labeled in a variety of ways according to the specification used:
Modbus D0 D1 Common
EIA/TIA-485 A / A’ B / B’ C / C’
UNI-TELWAY D(A) D(B) 0VL
Jbus
However, certain RS485 electronic components are labeled in the opposite way to the EIA/TIA-485 standard. It may be necessary to perform a test by connecting a master to a slave, then reversing the connection in the event of failure.
2. Check polarizations. Study the documentation supplied with the devices to determine the polarization resistance. If there is one, check that the value is correct (see Mixed schematic page 15
Polarization is not always possible. For example, in the event of the 5 V not being available in the master.
RD + / TD +
L +
RD - / TD -
L -
)
3. Select a line terminator. In the case of polarization, select an RC line terminator (R = 120 Ω, C = 1 nF). If polarization is not possible, select an R line terminator (R = 150 Ω).
16 1624597 11/2009
Page 17
ATV31_modbus_manual_EN_1624597_03
1624597 11/2009
Loading...