Important Information __________________________________________________________________________________________ 4
Before you begin______________________________________________________________________________________________ 5
Documentation structure________________________________________________________________________________________ 6
Presentation _________________________________________________________________________________________________ 7
Connection to RS485 bus_______________________________________________________________________________________ 8
Configuration of the Modbus serial port ____________________________________________________________________________ 9
IO Scanner configuration parameters_____________________________________________________________________________ 10
Modbus Functions ___________________________________________________________________________________________ 12
ATV12 state machine _________________________________________________________________________________________ 17
Application example __________________________________________________________________________________________ 21
Connection to RS485 bus______________________________________________________________________________________ 24
BBV28590 06/20123
Page 4
Important Information
The addition of this symbol to a Danger or Warning safety label indicates that an electrical hazard exists, which will result in
personal injury if the instructions are not followed.
This is the safety alert symbol. It is used to alert you to potential personal injury hazards. Obey all safety messages that follow
this symbol to avoid possible injury or death.
NOTICE
Read these instructions carefully, and look at the equipment to become familiar with the device before trying to install, operate, or maintain
it. The following special messages may appear throughout this documentation or on the equipment to warn of potential hazards or to call
attention to information that clarifies or simplifies a procedure.
DANGER
DANGER indicates an imminently hazardous situation, which, if not avoided, will result in death or serious injury.
WARNING
WARNING indicates a potentially hazardous situation, which, if not avoided, can result in death or serious injury.
CAUTION
CAUTION indicates a potentially hazardous situation, which, if not avoided, can result in minor or moderate injury.
CAUTION
CAUTION, used without the safety alert symbol, indicates a potentially hazardous situation which, if not avoided, can
result in property damage.
PLEASE NOTE
The word "drive" as used in this manual refers to the controller portion of the adjustable speed drive as defined by NEC.
Electrical equipment should be installed, operated, serviced, and maintained only by qualified personnel. No responsibility is assumed by
Schneider Electric for any consequences arising out of the use of this material.
Read and understand these instructions before performing any procedure with this drive.
DANGER
HAZARD OF ELECTRIC SHOCK, EXPLOSION, OR ARC FLASH
• Read and understand this manual before installing or operating the Altivar 12 drive. Installation, adjustment, repair, and maintenance
must be performed by qualified personnel.
• The user is responsible for compliance with all international and national electrical code requirements with respect to grounding of all
equipment.
• Many parts of this drive, including the printed circuit boards, operate at the line voltage. DO NOT TOUCH. Use only electrically
insulated tools.
• DO NOT touch unshielded components or terminal strip screw connections with voltage present.
• DO NOT short across terminals PA/+ and PC/– or across the DC bus capacitors.
• Before servicing the drive:
- Disconnect all power, including external control power that may be present.
- Place a “DO NOT TURN ON” label on all power disconnects.
- Lock all power disconnects in the open position.
- WAIT 15 MINUTES to allow the DC bus capacitors to discharge. Then follow the “Bus Voltage Measurement Procedure” (see
User manual) to verify that the DC voltage is less than 42 V. The drive LEDs are not indicators of the absence of DC bus
voltage.
• Install and close all covers before applying power or starting and stopping the drive.
Failure to follow these instructions will result in death or serious injury.
DANGER
UNINTENDED EQUIPMENT OPERATION
• Read and understand this manual before installing or operating the Altivar 12 drive.
• Any changes made to the parameter settings must be performed by qualified personnel.
Failure to follow these instructions will result in death or serious injury.
WARNING
DAMAGED DRIVE EQUIPMENT
Do not operate or install any drive or drive accessory that appears damaged.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
WARNING
LOSS OF CONTROL
• The designer of any control scheme must consider the potential failure modes of control paths and, for certain critical control functions,
provide a means to achieve a safe state during and after a path failure.
Examples of critical control functions are emergency stop and overtravel stop.
• Separate or redundant control paths must be provided for critical control functions.
• System control paths may include communication links. Consideration must be given to the implications of unanticipated transmission
delays or failures of the link.
a
Failure to follow these instructions can result in death, serious injury, or equipment damage.
a. For additional information, refer to NEMA ICS 1.1 (latest edition), “Safety Guidelines for the Application, Installation, and Maintenance
of Solid State Control” and to NEMA ICS 7.1 (latest edition), “Safety Standards for Construction and Guide for Selection, Installation and
Operation of Adjustable-Speed Drive Systems.”
BBV28590 06/20125
Page 6
Documentation structure
The following Altivar 12 technical documents are available on the Schneider Electric website (www.schneider-electric.com) as well as on
DVD-ROM (reference VW3A8200).
ATV12 Quick Start Guide (S1A56146)
The Quick Start describes how to wire and configure the drive to start motor quickly and simply for simple applications.
This document is delivered with the drive with an Annex (S1A58684) for Short Circuit Current Ratings (SCCR) and branch circuit protection.
ATV12 User manual (BBV28581)
This manual describes how to install, program and operate the drive.
ATV12 Modbus Communication manual (BBV28590)
This manual describes the assembly, connection to the bus or network, signaling, diagnostics, and configuration of the communicationspecific parameters via the 7 segment LED display.
It also describes the communication services of the Modbus protocol.
This manual includes all Modbus addresses. It explains the operating mode specific to communication (state chart).
ATV12P Installation manual (BBV28587)
This manual describes how to install the drive ATV12 baseplate following the conditions of acceptability.
ATV12 Parameters description file
All the parameters are grouped together in an Excel file available on the Schneider Electric website (www.schneider-electric.com), with the
following data:
• Code
•Name
• Modbus Addresses
• Category
• Read/write access
• Type: signed numerical, unsigned numerical, etc.
•Unit
• Factory setting
• Minimum value
• Maximum value
• Display on the 7-segment integrated display terminal
• Relevant menu
This file offers the option of sorting and arranging the data according to any criterion chosen by the user.
DANGER
UNINTENDED EQUIPMENT OPERATION
• Read and understand this manual before installing or operating the Altivar 12 drive.
• Any changes made to the parameter settings must be performed by qualified personnel.
• The excel file does not describe the behaviour of the parameters. Before any modification, refer to the ATV12 User Manual.
Failure to follow these instructions will result in death or serious injury.
6BBV28590 06/2012
Page 7
Presentation
The Modbus socket on the Altivar 12 can be used for the following functions:
• Configuration
• Settings
• Control
• Monitoring
The ATV12 drive supports:
• The 2-wire RS485 physical layer
• The RTU transmission mode
BBV28590 06/20127
Page 8
Connection to RS485 bus
8........................1
Connection to ATV12
Connection accessories should be ordered separately (please consult our catalogues).
Connect the RJ45 cable connector to the ATV12 connector.
Pin out of the ATV12 RJ45 Connector
View from underneath
PinSignal
1-
2-
3-
4D1 (1)
5D0 (1)
6-
7VP (2)
8Common (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 separated from the power cables (30 cm (11.8 in.) minimum).
• Make any crossovers of the Modbus cable and the power cables at right-angles, if necessary.
For more information, please refer to the TSX DG KBL E manual: "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 Standard schematic section. The new Schneider Electric devices conform to this specification.
8BBV28590 06/2012
Page 9
Configuration of the Modbus serial port
Communication Menu Structure
The communication parameters are part of the COM- submenu.
This menu is accessible as follows:
Communication configuration - Parameters decription
Parameter descriptionRange or listed valuesdefaultPossible ValueModbus address
MODBUS address of the drive
Add
MODBUS baud rate
tbr
MODBUS format
tFD
MODBUS Time out
ttO
ICS-
DCS-
ISA-
DSA-
The behaviour of the ATV12 when a time-out occurs is defined by the SLL parameter, this parameter can be found in the menu FLt-
(see User Manual).
1 to 247
0 : OFF (broadcast only)
4,8 kbps
9,6 kbps
19,2 kbps
38.4 kbps
8O1: 8 bits, odd parity, 1 stop bit.
8E1: 8 bits, even parity, 1 stop bit.
8N1, 8 bits, no parity, 1 stop bit
8N2: 8 bits, no parity, 2 stop bits.
Adjustable from 0.1 to 30s10,0 s0.1....3016#1775 = 06005
Communication scanner submenus :Detailed in the next chapter
OFF
19,2 kbps
8E1
OFF
1 ... 247
4.8
9.6
19.2
38.4
8o1
8E1
8n1
8n2
16#1771 = 06001
16#1773 = 06003
16#1774 = 06004
WARNING
LOSS OF CONTROL
If Modbus fault management(SLL) = fault ignore(n0), communication control will be inhibited. For safety reasons, inhibition of
communication fault should only be used for adjustment or special applications purpose.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
BBV28590 06/20129
Page 10
IO Scanner configuration parameters
Integrated communication scanner
The communication scanner is useful when used in combination by the Modbus client device with the function "Read/Write Multiple
registers" : 23 (0x17), which provides in a single telegram a read multiple registers and a write multiple registers. The detail of the function
23 is described in the supported Modbus functions
Local configuration of the communication scanner
The communication scanner is accessible via the following menus : COM- and ICS-OCS- submenus.
The 4 output variables and the 4 input variables are assigned by means of parameters nCA1 to nCA4 and nMA1 to nMA4. An
nCA or nMA parameter with a value of zero indicates that the parameter is not active. These 8 parameters are described in the table.
NCA or NMA defines the addresses. All these parameters are Modbus eligible addresses.
SubmenuOn the local HMI, it is parameter descriptionFactory setting parameterModbus address
ICS-NMA1 (nNA1)
Source drive address of the 1st input word
NMA2 (nNA2)
Source drive address of the 2nd input word
NMA3 (nNA3)
Source drive address of the 3rd input word
NMA4 (nNA4)
Source drive address of the 4th input word
OCS-NCA1 (nCA1)
Destination drive address of the 1st output word
NCA2 (nCA2)
Destination drive address of the 2nd output word
NCA3 (nCA3)
Destination drive address of the 3rd output word
NCA4 (nCA4)
Destination drive address of the 4th output word
Address of ETA=3201
16#0C81
Address of RFRD=8604
16#219C
0
0
Address of CMD=8501
16#2135
Address of LFRD=8602
16#219A
0
0
NMA1 address
16#319D = 12701
NMA2 address
16#319E = 12702
NMA3 address
16#319F = 12703
NMA4 address
16#31A0 = 12704
NCA1 address
16#31B1 = 12721
NCA2 address
16#31B2 = 12722
NCA3 address
16#31B3 = 12723
NCA3 address
16#31B4 = 12724
Monitoring the communication scanner
It is also possible to monitor the parameters value that have been configured in the communication scanner. This monitored values are
accessible via the following menus : COM- andISA-DSA- submenu.
The 4 output variable values and the 4 input variable values are located into parameters nC1 to nC4 and nM1 to nM4.
SubmenuOn the local HMI, it is parameter descriptionFactory setting parameterModbus address
ISA-NM1 (nM1)
Source drive value of the 1st input word
NM2 (nM2)
Source drive value of the 2nd input word
NM3 (nM3)
Source drive value of the 3rd input word
NM4 (nM4)
Source drive value of the 4th input word
OSA-NC1 (nC1)
Destination drive value of the 1st input word
NC2 (nC2)
Destination drive value of the 2nd input word
NC3 (nC3)
Destination drive value of the 3rd input word
NC4 (nC4)
Destination drive value of the 4th input word
ETA value
RFRD value
0
0
CMD value
LFRD value
0
0
NM1 address
16#31C5 = 12741
NM2 address
16#31C6 = 12742
NM3 address
16#31C7 = 12743
NM4 address
16#31C8 = 12744
NC1 address
16#31D9 = 12761
NC2 address
16#31DA = 12762
NC3 address
16#31DB = 12763
NC4 address
16#31DC = 12764
10BBV28590 06/2012
Page 11
IO Scanner configuration parameters
1
2
1
2
Configuration example
In this example the communication scanner is configured as follow, nCA1, nCA2, nMA1, nMA2 are used with their default values.
nCA3 is configured with the address of CMI (Modbus 8504 16#2138). nMA3 is is configured with the address of EtI (Modbus 3206
16#0C86).
How to read the diagram below
Example for nCA3:
nCA3 contain the logical address (2138) of CMI
Communication scanner
• menu COM-
• submenu COM-, OCS-
The required telegram to perform the exchange is the Modbus function 23, Obviously a sequence of requests based on Modbus functions
03 and 16 is also possible.
(See also the chapters Modbus Functions and Altivar 12 and M340).
BBV28590 06/201211
Page 12
Modbus Functions
Modbus Protocol
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 codeDataCRC16
Principle
The Modbus protocol is a master-slave protocol.
MasterOnly 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.
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.
Slave i Slave jSlave k
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. ATV12 drives take account of the request, but do not
respond to it.
Supported Modbus functions
The Altivar 12 supports the following Modbus functions.
Function nameCodeDescriptionRemarks
Read holding registers03
16#03
Write one output word06
16#06
Write multiple registers16
16#10
Read/write Multiple registers23
16#17
(Sub-function)
Read device Identification
43/14
16#2B
16#OE
Read N output wordsMax PDU length : 63 words
Write one output word
Write N output wordMax PDU length : 61 words
Read/write multiple registersMax PDU length : 4 words (W), 4 words (R)
Encapsulated interface transport
/ Read device identification
12BBV28590 06/2012
Page 13
Modbus Functions
The following paragraphs describes each supported function.
Read Holding registers
Request
Function code1 Byte0x03
Starting Address2 Bytes0x0000 to 0xFFFF
Quantity of Registers2 Bytes1 to 63 (0x 3F)
Response
Function code1 Byte0x03
Byte count1 Byte2 x N*
Register valueN* x 2 Bytes
*N: Quantity of Registers
Error
Error code1 Byte0x83
Exception code1 Byte01 or 02 or 03 or 04 (see details on
page 16
)
Example
Note:
Hi = high order byte, Lo = low order byte.
This function can be used to read all ATV12 words, both input words and output words.
Request
Slave
no.
1 byte1 byte2 bytes2 bytes2 bytes
Response
Slave
no.
1 byte1 byte1 byte2 bytes2 bytes2 bytes
Example: read 4 words W3102 to W3105 (16#0C1E to 16#0C21) in slave 2, using function 3, where:
• Object no. 3:Device version, in “MMmm” format where “MM” represents the determinant and “mm” the subdeterminant (4-bytes
ASCII string; for example: “0201” for version 2.1).
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 12
rather than the response described above.
BBV28590 06/201215
Length of object no. 3
04
Value of object no. 3
“0201”
-------
Page 16
Modbus Functions
Error management
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 byte1 byte1 byte2 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
LoHi
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:
CRCXOR<byte> —> CRC
Enter8 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.
16BBV28590 06/2012
Page 17
ATV12 state machine
Fault
Power section line supply present or absent
Power section line supply present
Transition condition
with example of command
Value of
status word
Status display on
graphic display terminal
State
Key:
Examples:
ETA=16#0637: Stop or forward, speed reached
ETA=16#8637: Stop or reverse, speed reached
ETA=16#0237: Forward, accelerating or decelerating
ETA=16#8237: Reverse, accelerating or decelerating
Enable
operation
CMD=16#xxxF
Switched on
Ready to switch on
Switched on
Operation enabled
Enable
operation
CMD=16#xxxF
Disable
operation
CMD=16#0007
or
fast stop
Quick stop
CMD=16#0002
Quick stop active
Switch on
CMD=16#xxxF
Shutdown
CMD=16#0006
Switch on
CMD=16#0007
Shutdown
CMD=16#0006
Disable
voltage
CMD=16#0000
or
Quick stop
CMD=16#0002
or
STOP key
or
freewheel stop
at the terminals
or
modification
of a configuration
parameter
Disable
voltage
CMD=16#0000
or
Quick stop
CMD=16#0002
or
STOP key
Shutdown
CMD=16#0006
Disable voltage
CMD=16#0000
or
STOP key
or
freewheel stop at
the terminals
Switch on disabled
Fault disappeared
and faults reset
CMD=16#0080
Not ready to switch on
Entry into
state chart
Fault reaction active
From all states
Fault
Fault
After quick stop order,
the drive stops
according to the fast
stop ramp and then
changes to state "2 Switch on disabled".
Status chart based on IEC 61800-7*
The state machine below describes the interaction between the drive's state machine, monitored by the status word (ETA) parameter, and
the Command Word (CMD). CiA® and CANopen® are registered Community Trademarks of CAN in Automation e.V.
*:Since 2007, CiA402 profile is part of the IEC standard 61800-7. Therefore DriveCom or CiA402 terminology is no more used.
BBV28590 06/201217
Page 18
ATV12 state machine
State machine description
The Altivar control process using the communication bus follows IEC 61800-7 profile status chart compatible with the DRIVECOM standard.
Each state represents an aspect of the internal behaviour of the drive.
This chart evolves according to whether the control word is sent (CMD W8501) or an event occurs (example: lock following malfunction).
The drive status can be identified by the value of the status word (ETA W3201).
Not ready to switch on (Initialization):
Communication is being initialized.
Transient state invisible to the communication bus.
Switch on disabled (Configuration):
Initialization of the drive is complete.
The configuration and adjustment parameters can be modified. The drive is locked.
Ready to switch on and Switched on (Drive initialized):
The drive is locked.
The power stage of the drive is ready to operate, but voltage has not yet been applied to the output.
The configuration and adjustment parameters can be modified, but modifying a configuration parameter returns the drive to the "Switch on
disabled" state.
Operation enabled (Operational):
The drive is unlocked and voltage can be applied to the motor terminals.
Auto-tuning (tUn) requires an injection of current. The drive must therefore be in this state to perform this command.
The adjustment parameters can be modified even if a run command or a DC injection current is present. However, a configuration parameter
can only be modified if the motor is stopped, and this returns the drive to the "Switch on disabled" state.
Quick stop active (Emergency stop active):
Fast stop
Restarting is only possible after the drive has changed to the "Switch on disabled" state.
Malfunction reaction active (Reaction on fault):
Transient state during which the drive performs an action appropriate to the type of fault detection.
Malfunction (Fault):
The drive is locked.
Summary
StatePower supplied to motorModification of configuration parameters
1 - Not ready to switch onNoYes
2 - Switch on disabledNoYes
3 - Ready to switch onNoYes
4 - Switched onNoYes, return to "2 - Switch on disabled" state
5 - Operation enabledYes, except at zero reference or "halt"No
6 - Quick stop activeYes, during fast stopNo
7 - Fault reaction activeDepends on fault managment configuration-
8 - FaultNoYes
18BBV28590 06/2012
Page 19
ATV12 state machine
Command word description CMD - 8501
bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0
0 to 1
transition :
Fault reset
bit 15bit 14bit 13bit 12bit 11bit 10bit 9bit 8
ReservedNot assignableReservedReservedDirection of
Reserved (=0)Reserved (=0)0:Free wheel
staying in
"Operation
Enabled"
Enable
operation
Drivecom
state
activation
rotation asked
0: Forward
1: Reverse
Quick stop
Drivecom
state
activation
(bit active at 0)
Reserved (=0)Reserved (=0)0: RUN asked
Switch on
disabled.
Drivecom state
activation
(bit active at 0)
Switch on
1: STOP
asked
CommandTransition
address
Shutdown2, 6, 83 - Ready to
Switch on34 - Switched onxx11116#0007
Enable
operation
Disable
operation
Disable
voltage
Quick stop116 - Quick stop
Fault reset152 - Switch on
x: Value is of no significance for this command.
0 ○ 1: Command on rising edge.
45 - Operation
54 - Switched onx011116#0007
7, 9, 10, 122 - Switch on
7, 102 - Switch on
Final statebit 7bit 3bit 2bit 1bit 0Example
Fault
reset
xx11016#0006
switch on
x111116#000F
enabled
xxx0x16#0000
disabled
xx01x16#0002
active
disabled
0 ○ 1xxxx16#0080
disabled
Enable
operation
Quick
stop
Switch on
disabled
Switch on
value
BBV28590 06/201219
Page 20
ATV12 state machine
Status word description ETA - 3201
bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0
Reserved
(always 0)
bit 15bit 14bit 13bit 12bit 11bit 10bit 9bit 8
0: Motor
rotation in
forward
direction (or
stopped)
Statusbit 6bit 5bit 4bit 3bit 2bit 1bit 0ETA
1 -Not ready to
switch on
2 - Switch on
disabled
3 - Ready to
switch on
4 - Switched on011001116#0033
5 - Operation
enabled
6 - Quick stop
active
7 - Fault reaction
active
8 - Fault0xx100016#0018 (2)
Switch on
disabled
Stop via STOP
key
Switch on
disabled
0xx0000 -
1xx000016#0050
01x000116#0031
011011116#0037
001011116#0017
0xx1111 -
Quick stop
(bit active at 0)
Reserved (=0) Reserved (=0)Reference
Quick stopVoltage
Voltage
enabled
(bit always on)
enabled
Fault
detection
Fault
detection
exceeded
(< LSP or >
HSP)
Operation
enabled
Operation
enabled
Reference
reached
(steady state)
Switched onReady to
(bit active at 0)
Switched onReady to
switch on
Local mode
switch on
Reserved (=0)
masked by
16#006F (1)
or 16#0038
x: In this state, the value of the bit can be 0 or 1.
(1)This mask can be used by the PLC program to test the chart state.
(2)Fault following state "6 - Quick stop active".
20BBV28590 06/2012
Page 21
Application example
Connecting an ATV12 to a M340 PLC
Here is an example of an application that shows how to control an ATV12 from a M340 PLC equipped with a Modbus master serial port.
The program provides a control of the drive from an operator screen designed under Unity.
The example illustrates also the previous chapter
Configuration of the Modbus Master
The default settings of the serial port used as a Modbus master are compliant with the default settings of the ATV12.
BBV28590 06/201221
Page 22
Application example
Initialization
The communication is based on the READ_VAR , WRITE_VAR functions. During the first execution of the MAST task you can initialize the
data structures used by these two functions. Devicepath describes the path to the device including its slave address. ReadVarMgt and
WriteVarMgt are arrays used respectively by READ_VAR and WRITE_VAR. Only the 3rd element of these arrays is modifiable by the user:
To define the time out duration of the requests
(* data initialization *)
(* Communication path to Modbus slave device at @ 3 *)
(* The device path can be modified later by the app. *)
(* MSB of DevicePath[3] contains the device address *)
DevicePath := ADDM ('0.0.0.3');
(* Time out duration *)
ReadVarMGT[2]:=50;
WriteVarMGT[2]:=50;
Data structure declaration :
22BBV28590 06/2012
Page 23
Application example
Cyclical exchanges
In the example below the application manages 2 requests:
• "A read request of 4 words starting at Modbus address 12741 (NM1) - Modbus function #3
• "A write request of 4 words starting at Modbus address 12761 (NC1) - Modbus function #16
Requests are executed only each N x FAST task to avoid too much activity on the serial line.
The device can be modified (polling several devices) by writing in DevicePath[3].
Cyclical communication
(* Modbus Requests are sent only each:
( ModbusRequestPeriod X FAST period X n) *)
if ModbusRequestPeriod >25 then
(* Read request to ATV12 : Modbus function 3 *)
IF not ReadVarBusy then
READ_VAR(DevicePath, '%MW' , 12741, 4, ReadVarMGT, %MW124:4);
(*Devicepath is initialized during Init_Sequence *)
END_IF;
(* Write request to ATV12 : Modbus function 16 *)
IF not WriteVarBusy then
WRITE_VAR(DevicePath, '%MW' , 12761, 4, %MW120:4, WriteVarMGT);
END_IF;
ModbusRequestPeriod:=0;
END_IF;
The key data are highlighted: address and lengh in the device source and destination of the data in the PLC.
The time out can be managed by the application in a separate way by testing the activity of the 2 bits: ReadVarBusy and WriteVarBusy
Overview of the communication tables:
BBV28590 06/201223
Page 24
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
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 ATV12 drive follows this specification.
Schematic diagram:
Master
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 1 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
This polarisation is recommended for the master.
One 120 Ω 0.25 W resistor in series with a 1nF 10 V capacitor
Ω pulldown resistor at the Common (650 Ω recommended)
Yes (Common), connected to the protective ground at one or more points on the bus
24BBV28590 06/2012
Page 25
Page 26
BBV28590
ATV12_Modbus_EN_V2
06/2012
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.