S7-1500 modbus tcp speed?

Pete.S.

Member
Join Date
Mar 2016
Location
Fl
Posts
463
Hi guys!

I was wondering if there is a way to speed up the modbus tcp server in the S7-1500?

I'm talking about the time it takes from a request is received in the S7-1500 (the modbus server) to the time it takes for it to send back the response to the modbus client.

Right now it takes just over 200ms to read 125 consecutive 16-bit words from the S7-1500. It's all in one request.

Somewhere in the back of my mind I think there was a way to allocate how much cpu cycles/time would be allocated to communication. I can't remember where and I don't know if that is applicable in this case.

Thanks,
Pete
 
Last edited:
Usually that is done on the Hardware configuration.
Click on the PLC and further down there should be a communication load option.

I was nder the impression that Modbus was done via some function blocks... perhaps you're not calling them often enough?
 
Last edited:
Usually that is done on the Hardware configuration.
Click on the PLC and further down there should be a communication load option.

I was nder the impression that Modbus was done via some function blocks... perhaps you're not calling them often enough?

S7-1500 has a block called MB_SERVER that you should put in OB1. So it's called every scan.

I'll check out the communication load option.
 
Last edited:
I don't know what the bottleneck is, but I'd be curious what you see if you do a wireshark trace. The actual sending of the data happens asynchronously to the scan in the communications time, but the processing may still have to happen in the PLC scan. It is possible that there is a bottle neck like being able to only send one Modbus TCP packet per scan of the server block.

I'm curious A) what your scan time is and B) if calling it out of a faster cyclic OB speeds things up.
 
I don't know what the bottleneck is, but I'd be curious what you see if you do a wireshark trace. The actual sending of the data happens asynchronously to the scan in the communications time, but the processing may still have to happen in the PLC scan. It is possible that there is a bottle neck like being able to only send one Modbus TCP packet per scan of the server block.

I'm curious A) what your scan time is and B) if calling it out of a faster cyclic OB speeds things up.

From someone that managed to get my hobby electronics playing well with Modbus TCP, Wireshark would definitely provide a bit of insight or at least more detail on the transactions going on here.

I don't remember an instance of a cyclic OB being faster than OB1 in any of the Siemens applications I've seen in the past. Is this common i9n your experience?
 
I don't remember an instance of a cyclic OB being faster than OB1 in any of the Siemens applications I've seen in the past. Is this common i9n your experience?

It isn't the common use case, but it's certainly possible. Typically you see cyclic interrupts used for safety code or PIDs, and it is slower but higher priority. I have seen a few projects that were ALL cyclic OB and no OB1, in the process world. Sometimes you need to balance both frequency and priority.

The best example of a fast cyclic OB I can think of is MC-Servo, used for the TOs in 1200/1500. It basically acts the same as a cyclic interrupt, usually at a rate much faster than the PLC scan. I just checked in the project I have open; you can create a cyclic interrupt in a 1515 as fast as 500us.
 
I have seen a few projects that were ALL cyclic OB and no OB1, in the process world. Sometimes you need to balance both frequency and priority.
Yes, this is typical in PCS7 and I suppose the process industry as a lot of the logic doesn't have to run at high frequencies. Though, in that case, OB1 is still there but only to run clean up functions if any.

The best example of a fast cyclic OB I can think of is MC-Servo, used for the TOs in 1200/1500. It basically acts the same as a cyclic interrupt, usually at a rate much faster than the PLC scan. I just checked in the project I have open; you can create a cyclic interrupt in a 1515 as fast as 500us.
This makes sense, I suppose. I haven't seen the response of S7-1500's, but something running at 500us, probably will make the system stutter?
 
This makes sense, I suppose. I haven't seen the response of S7-1500's, but something running at 500us, probably will make the system stutter?

Not 100% sure what you mean by stutter. It won't actually be visible as random pauses to the outputs. It shows up us a lengthening of the overall scan time, similar to communications.

Lets say you need some code running every .5ms, and it takes .1ms to execute. Lets say your overall PLC scantime would have been 10ms. Once you add in the cyclic interrupt, now your typical scantime goes to 12.5ms. If you double the amount of code in the cyclic interrupt, and it now takes .2ms, that lengthens the scantime to 16.6ms. (I think I did that math right...)

Moral of the story is that I certainly wouldn't recommend running much code that fast. I've really only seen it make sense for motion control type situations where you have really fast control loops.
 
Yes, it's possible to set it up like that. Do you think that will be an advantage?

It depends how many modbus querys you have. If you have only 125 words, then this probably won't make difference

if you have something like 500 words, then you can make 5 different modbus TCP querys to slave at same time (now 1500PLC). So you get also reply for 500 words at same time (5 times faster and only one interval)

Siemens PLC have max connections limit on PLC hardwire settings and also PLC type limits connections. (Connection resources)

https://support.industry.siemens.co...ic-s7-pn-cpu-as-modbus-server-?dti=0&lc=en-WW
 

Similar Topics

I have a project where I'm scoping out the functions but won't be doing the actual program, so I'm trying to keep everything easy for the person...
Replies
1
Views
1,716
Hi, I'm facing a problem with Modbus TCP communication using an S7 1500 as Slave (Server). I configured the MB_SERVER function block and I'm...
Replies
4
Views
5,600
So, I have a PLC which will be communicating to a lot of devices using modbus TCP. I know how to instance the block to create connections. I am...
Replies
0
Views
2,037
Hi Mr/Mrs. I has a question hope that you guys can explain to me. i have one S7 1500 PLC (192.168.7.121) and E+H modbus device (192.168.7.151) in...
Replies
0
Views
3,046
Hello all, I want to communicate a S7-1500 with a couple of genset controllers from a company called Datakom. The model is D500. My questions are...
Replies
4
Views
6,107
Back
Top Bottom