10/12/2013 3:53 PM | |
Posts: 150 Rating:
|
Dear all I have a project where I need to control 4 Schneider electric Altivar312 drives using an S7-1200 using Modbus. I thought that I will find somethig ready in the forum as both products are popular but that was not the case. I realised that there aren't any examples in the forum using SE drives and also I did not find any examples using more than one slave. For that reason I made a fully tested working example using an S7-1200 with a CM1241, a S.E. Twido PLC and a S.E. ATV31 Drive. In the TIA portal project there is also an HMI configured which I utilised using the simulator. Before I explain my example I will highlight a couple of things: 1. Modbus was developed by Modicon and thus Modbus addressing fits Modicon contollers. Modicon controllers dont use Data Blocks, they have all their memory allocated in %M (bits) and %MW. Most of the times the Job can be done using words or in modbus terms 4000x registers. The equivalency between MW and Modbus registers is offseted by one i.e.: %MW0 -> 40001 %MW1-> 40002 and so on. In our example this applies for the Twido PLC. If I wanted to read or write %MW100 from the PLC I then need to read register 40101 using Modbus. Most of the times though we need to communicate not with PLCs but with other devices as Drives, Power monitors, Instruments etc. For these items in their manuals the addressing is not given in %MW format ro 4000x format but it might be given as number i.e.: from the ATV31 communication variable manual I read that the addres for the Last Fault is 7121. This is actualy the offset of the modbus addressing and If I want to read this from a modbus master I then need to use address 40001+7121 = 47122 register. This is common practice for S.E. products. 2. Siemens uses a totally diffirent memory structrure from Modicon as it uses Datablocks. Therefore the controller addressing with the Modbus addressing are inconsistent. For that reason we have the MB_MASTER block if we want our controller to be Master and MB_SLAVE if we want our controller to be slave. In MB_MASTER we just enter the addresses (modbus format 4000x) we want and the controller Fetches them from the Slave. The MB_SLAVE in my opinion actually emulates the Modbus addressing scheme. It takes an array of data from a data block and it makes the available to the master as Modbus addresses 4000x - 4000n. In a modicon controller where the controller addressing and modbus addressing match, no code needs to be writen in the SLAVE. 3. In Modbus the Master polls the Slaves and reads and writes data to them. A lot of slaves mean longer poll times. Therefore care needs to be taken when selecting the Timeout setting of the devices. In the example the S7-1200 reads the Status word, the actual output frequency and the last fault data from the Altivar 31. It also Initializes the drive, issues start, stop, reverse, fault reset commands and it also sets the reference. ATTENTION: As safety is always No1 concern care needs to be taken to set the required state of the equipment in case the network fails. I did not include such a function in the example. In the examle the second slave is a Twido PLC and I just read to words (%MW0 &%MW1) and I write one word (%MW100) which is used to set some outputs. In the zip file you will find: TIA Portal V12 archive for the S7-1200 & HMI Twidosuite archive for the Twido PLC PowerSuite archive for the ATV31 You easily adapt the example so that it can communicate with other altivar drives like ATV312, ATV61, ATV71. Discalimer: this example is for demonstration purpuses only and I claim no responsibility for its use. Just my two cents AttachmentS71200_ATV_TWD_ example.zip (2356 Downloads) |
Last edited by: O_Moderator at: 10/15/2013 11:26 AMnew subject after splitting from /tf/WW/en/Posts/34101#top |
|
This contribution was helpful to
9 thankful Users |
11/4/2013 8:24 AM | |
Joined: 10/29/2012 Last visit: 3/5/2025 Posts: 102 Rating:
|
Do you have sample code for V11 ? |
4/3/2020 11:01 PM | |
Joined: 5/30/2016 Last visit: 2/25/2025 Posts: 5 Rating:
|
Dear Nikzitronik Could you make update the mentioned project to V13 sp1, at least and then share to me. It is very interesting your solution but cant to check because it could't be opened by TIA v15. Thanks beforehand. |
4/8/2020 1:26 PM | |
Joined: 2/22/2016 Last visit: 3/19/2025 Posts: 142 Rating:
|
Hi Avek. In the attachment you find a project with 4 Schneider Altivar 21, it may work if address layout is the same. TIA-portal v15. Please ask if you have any questions. Kind regards AttachmentAltivar.zip (1008 Downloads) |
Last edited by: ola84 at: 04/08/2020 13:29:13 |
|
4/30/2020 7:25 PM | |
Joined: 12/18/2014 Last visit: 3/28/2025 Posts: 34971 Rating:
|
Here's a update to V13 SP1. S7_1200_Modbus_ATV_TWD_V13_SP1 AttachmentS7_1200_Modbus_ATV_TWD_V13_SP1.zip (1017 Downloads) |
Last edited by: Jen_Moderator at: 05/04/2020 07:12:30Removed link and added file as an attachment. |
|
9/30/2021 11:55 AM | |
Posts: 1 Rating:
|
Could you make update the mentioned project to V13? |
Follow us on