How to control an Altivar312 (ATV312) drive with a Twido PLC via Modbus RTU?
Below is a step by step procedure describing a small application using a Twido Compact PLC controlling an ATV312 drive connected via Modbus RTU. A program example can be found at the end of this procedure.
Hardware and software used:
- TWDLCAE40DRF Twido PLC
- TWDNAC485T (RS485 serial interface adaptor with 3 pin screw terminal type connector)
- TwidoSuite 2.30.007 (free to download from www.schneider-electric.com)
- ATV312H075M2 variable speed drive
WIRING CONSIDERATIONS FOR THE MODBUS NETWORK
ATV312 RJ45 connector pin 4 - A terminal of the Twido TWDNAC485T
ATV312 RJ45 connector pin 5 - B terminal of the Twido TWDNAC485T
ATV312 RJ45 connector pin 8 SG terminal of the Twido TWDNAC485T
The Altivar 312 control process using the communication bus is based on the CANopen CiA 402 profile status chart compatible with the IEC61800-7 standard. Each state represents an aspect of the internal behavior of the drive.
In practical terms, before you can start the motor you will have to write to the CMD command word, Modbus address 8501, a value of 16#0006 (drive goes to a Ready to switch on state that can be checked with ETA status word, Modbus address 3201), then a 16#0007 (drive goes to a Switched on state) and finally a 16#000F (drive goes into an Operation enabled state, drive running).
Please refer to the chart and description of the states at the end of this document.
- 1. Drive Modbus Address (ADD) - 4 in our example (default: 1)
2. Modbus baud rate (TBR) - 19200 in our example (default)
3. Modbus com format (TFO) - 8-E-1 in our example (default)
4. Level of access control (LAC) - change to Level3 (default: Level1)
Note: When the drive is controlled via a communication bus, it is advisable to configure the access level "LAC" = "L3":
5. Configuration reference 1 (FR1) - change to Modbus (default: AI1).
6. Control channel 1 config (CD1) - change to Modbus (default: Terminal)
Note: Change CHCF Channel mode config to Separate to be able to change this parameter. You can change it back to Not separate after that.
Note: the program example is attached to this resolution.
1. Your Twido controller must be configured as a Master:
2. You have to add a Generic Modbus element with a Modbus address, 4 in our example
3. Configuration of the Comm Macro
Set the Modbus address of the drive in the Network address field.
Comm Macro zero is used in this example to read N words and write N words.
We will read one word, ETA status word, Modbus address 3201. C_RDNW will use 8 registers (1+7), from %MW0 to %MW7.
C_RDNW _ADDR1_0 sets the address of the register to be read from the drive (%MW3:=3201).
C_WRNW 0 1 sends the Modbus message to the drive. (0-comm macro instance, 1 number of words to be read)
The result will be read in C_RDNW _VAL1_0 or %MW7 in our example.
We will write two words, CMD control word, Modbus address 8501 and LFr frequency reference, Modbus address 8502. C_WRNW will use 11 register (2+9) from %MW20 to %MW30.
C_WRNW_ADDR1_0 sets the address of the starting register to be written in the drive (MW23:=8501).
C_WRNW_VAL1_0 sets the value of the first register be to written (%MW26, the CMD control word value)
The second value to be written is set with %MW27 and this will be the LFr speed reference.
C_WRNW 0 2 sends the Modbus message to the drive.(0-comm macro instance, 2 number of words to be written)
IEC 61800-7 status chart
Description of the status chart states
CMD control word (W8501)
ETA status word (W3201)
ATV312 Communication Menu Structure
This completes the step by step procedure on how to control an Altivar312 (ATV312) drive with a Twido PLC via Modbus RTU.
(Removed File URL: 207065_2002/Twido_ATV312_Comm_Macro.zip)(Removed Image URL: /PubResEXPORT.nsf/2b87ee90be777fc085257c28006ee4ef/17453b735252b685c125797d005801cc/fl_block_5/0.EA?OpenElement&FieldElemFormat=gif)
Legacy KB System (APS) Data: RESL207065 V1.0, Originally authored by TVe on 01/06/2012, Last Edited by TVe on 01/06/2012
Related ranges: Twido, Altivar 312