S7-1500 & Modbus TCP/IP

grnick50

Lifetime Supporting Member
Join Date
Nov 2010
Location
Ptolemaida
Posts
332
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 two:

1. The register list from the controller manual states that for multiple register read, I should use modbus function 03. From past experience I know that when using the 03 function, I should add the 40001 offset. The registers as given in the manual are in the range off 10240 to 10644. To read register 10240 for instance do I have to add 10240+40001=50241 and use this as the address for "MB_DATA_ADDR" in my "MB_Client" Function block??

2. If you see in the attached, the register list has some address "gaps". For instance, the next register after 10278 is 10292. If I want to read 10278 & 10292 Can I read the whole block from 10278 to 10292 and ignore the registers in between? Or do I need to make two calls of the "MB_Client" block and read with the first call 10278 and with the second call 10292? I am asking because I remember in the past that the first approach did not work. However I am concerned as the second approach produces very long code as there are many address segments to read in one slave. Is there a better way to do it?

Regards
Have a nice weekend

D500.jpg
 
1. The register list from the controller manual states that for multiple register read, I should use modbus function 03. From past experience I know that when using the 03 function, I should add the 40001 offset. The registers as given in the manual are in the range off 10240 to 10644. To read register 10240 for instance do I have to add 10240+40001=50241 and use this as the address for "MB_DATA_ADDR" in my "MB_Client" Function block??
Since MB_client block hasn't parameter for function(FC) you want to use, i think it determines FC from first digit of address (0x, 1x, 3x or 4x). So I think your address should be 410240.

2. If you see in the attached, the register list has some address "gaps". For instance, the next register after 10278 is 10292. If I want to read 10278 & 10292 Can I read the whole block from 10278 to 10292 and ignore the registers in between? Or do I need to make two calls of the "MB_Client" block and read with the first call 10278 and with the second call 10292? I am asking because I remember in the past that the first approach did not work. However I am concerned as the second approach produces very long code as there are many address segments to read in one slave. Is there a better way to do it?

Regards
Have a nice weekend
To read different address blocks you need different MB_client calls, if you try reading all addresses at once you most likely get illegal address exception.
You can use same connection id when reading different address groups from same slave you just need to coordinate between those calls.
 
modbus address can 5 or 6 digit so it can be 40001 or 400001.
those gaps you reffer to - yes you can read the whole in between 78 and 91 or you can make 2 calls, depending on the maximum number of registers you can read in one call and/or your programming preferences.
 
Isnt there a chance that if I read the whole block (gap included) that I will get an illegal address exeption?
 
don't know about that, i have dse genset controller for my genset and this works for me. i think that manufacturers use these gaps as reserved for future use
 

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,723
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...
Replies
10
Views
4,479
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,613
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,040
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,052
Back
Top Bottom