RICHARD_C2K

Modbus RTU using Siemens S7-1200 and Optidrive VFD

8 posts in this topic

Hi All I am new to Siemens plc (S7-1200) and modbus and I am having a bit of trouble setting a siemens plc to communicate with a VFD (OptiDrive). Are there any walk throughs on how to set this type of communication up and test it. A lot of the examples I have seen have been regarding setting the plc up as a slave but as Ill have just the one PLC and 3 drive units I believe I need to set it up as a Master and teh VFDs will be the slaves. Thanks Richard

Share this post


Link to post
Share on other sites
Hi Richard, I did few months ago a project for S7 1200 and other devices communicating on Modbus RTU. If you need some hints for Modbus RTU: 1. Configure the CPU and communication module - this is like Siemens help show. 2. Configure communication port - this is like Siemens help show. On S7 1200 Modbus RTU are only two actions read: "mode =0" and write: "mode =1". Siemens dont look to read bit or read word, just read. Dont look for write coil or write word, just write. 3. Read data that you need from VFD using function "mode 0" from adresses that you need - that was a bit unclear for me on help documents 4. When you need to send commands or values to VFD use function "mode 1" at adress you want to send - that was a bit unclear for me on help documents 5. Make sure that your command will not hang if the VFD will not respoond to command. If you need more info, ask for on forum. I teach myself and I want to share what I learn. If you need to simulate the data exchange, I suggest to use Modbus Poll and Modbus Slave from http://www.modbustools.com Success! dekor.

Share this post


Link to post
Share on other sites
Hi Dekor Thanks for the reply. Ive been going through my program and trying different settings and I am getting the TX light to flash on then go off as the RX light briefly flashes on then off but I am not getting a Done signal form MB_MASTER_Done and just keep getting the Busy signal staying on. I assume the transmission then times out and the TX and RX lights are then flashing again in the same sequence. I am not getting any errors from the status. I am also a little confused where the information then get written back to. To try and keep my program simple I am trying to write 1 to register 1 (40001) (I believe this should turn the drive on) and 16#0200 (200Hz) to register 2 (40002). On my MB_Master I have the following Mode = 1 Data Addr = 40001 Data_Len = 2 Data_PTR = MD500 Inside MD500 I have 16#0200_0001 when monitoring the value. any tips or ideas would be appreciated. Thanks Richard

Share this post


Link to post
Share on other sites
Hi Richard Please, can you add a print screen for master that you describe, or attach your program. dekor. You don't use DB to read or write data? Related to error code returned, you need to capture them and store . I will check my program and I will try to comment for you.

Share this post


Link to post
Share on other sites
Hi Here is the MB master when I am monitoring so you can see the values that are being sent to the function. Thanks Richard

Share this post


Link to post
Share on other sites
I've changed the DATA_PTR FOR P#M500.0 WORD 100 instead of MD500 as I have been altering the data length to see if I have any response. I have been entering 16#0001 into MW500 and 16#0150 into MW502 Thanks Richard

Share this post


Link to post
Share on other sites
When I tried using DB I seemed to get an error on the status and no TX or RX light would flash hence I am using M Thanks Richard

Share this post


Link to post
Share on other sites
Hi Richard, what I learnt from Siemens forum, is that it is usefull to use positive edge for request instead of continous signal. That is also written on help of TIA (look to example from help, they also use positive edge) Related to error code, you need to catch them and send them on a memory where you will be able to read. What I suggest you for begining, is a program that will read a status from a coil at inverter. When the communication will be in good condition, then start with sending values and commands. Try to folow example from help. It was usefull for me. On attachment you will find a program that I wrote for PAC3100 and 1200 communicating on Modbus RTU. Also below are some links that I use to learn. If you consider, that I can respond to your questions, please ask me. https://support.industry.siemens.com/cs/document/47756141/how-do-you-establish-a-modbus-rtu-communication-with-step-7-%28tia-portal%29-for-the-simatic-s7-1200?dti=0&lc=en-WW http://www.modbus.pl/node/29 dekor. Sentron_v12_05_9_Good english.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now