Technical Forum

Communication / Networks

S7-1200 MODBUS RTU - how to use it?

Thread Starter: Flomaster   Started: 10/19/2009 12:26 PM   Replies: 1

« Previous thread Next thread »
Page 1 of 1 (2 items)
  10/19/2009, 12:26 PM
Joined 9/25/2009
Last visit: 10/4/2014
Posts: 65
Rated: Above avarage [3 out of 5 / rated 2 time(s)]. (2) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I have a S7-1200 1214C with RS458 Communication Module (CM1241) as Modbus Master. I also have a Frequancy Inverter as Modbus slave.
To make my first step, I found an example of work with MODBUS library here:
It's was very useful for me, but I still have a problems with Modbus.

My Frequancy Inverter has some memory addresses which I need to write(for example 100h, 101h and 110h) and some memory addresses which I need to write(for example 120, 121h and 124h) data.
If I only read one data word (from address 124h)  or read two data word
(120 and 121h) then everything is good and where are no timeouts.
If I try to read one word (124h) in program network and then try to read two data word (120 and 121h) in next program network, I get Modbus timeout error in PLC and Frequancy Inverter.

If I try read and write data in two sequential program networks, I get such result too.

Please explain me how can I read from and write data to Modbus slave device using one MB_Master block?

P.S. I'm sorry my English laugh. I'm from Russian Federation.
Thank you for this post from:
  10/19/2009, 3:47 PM
Joined 5/28/2008
Last visit: 1/9/2015
Posts: 1013
Rated: Excellent [4.03 out of 5 / rated 66 time(s)]. (66) 
Rated: Very Good [2 out of 5 / rated 1 time(s)]. (1) 

here at first a link with basic information about time managment on modbus:

But I think you have another problem. If I understand you right, you read address X in one network and in the next network you read address Y and get timout. Without seeing your project, I think your different requests on slave are to fast. If MB_MASTER is busy by one request, you can't send another one. So you have to make sure, that only one MB_MASTER instruction is activ. Only if MB_MASTER is done, you can send the next request.

Make also sure, that MB_COMM_LOAD is only called on first cycle (startup).

please try it out and give me a feedback. If it don't work anymore, you can attach your project here and I will have a look on it.


Thank you for this post from:
Page 1 of 1 (2 items)