Siemens S7-1200 / S7-1500 and Modbus TCP MB_SERVER

yell

Member
Join Date
Aug 2016
Location
Milan
Posts
21
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 using QModMaster as Master (Client) to test the system.

The communication is working and I tested the following configurations:
a. with an array DB of Words (or Bools, or Reals) I'm able to read them with FC3 on (4)0000+ addresses. See 1st MB_SERVER on pic1.
b. if I use a pointer, e.g. P#M100.0 BYTE 18, I'm able to read the inputs from %I0.0 onwards and I can read Discrete Inputs (FC2) and Inputs Registers (FC3). See 2nd MB_SERVER on pic1 and pic2.



My questions:
1. Why the pointer reads the inputs from %I0.0
2. How to configure the server to read from a mixed DB. I tried to use pointers to read the data inside a DB but with no luck. I would like to read data as pic2 but without allocating inputs images (or at least not starting from 0).

Advices?
Thanks
 
Not sure I understand your question, but I would move all your data to one single DB. You can do multiple calls with smaller area's, but this is so much easier.

I am doing a similar thing this week. The client is reading and writing directly to all of the registers.

Capture.PNG IO.PNG
 
Thanks boneless,
I already tried that configuration, that is the simplest and most obvious.
But that configuration has a downside: booleans can't be read with Modbus FC02 because are put in the holding registers and translated in words by the FB. You can read the booleans with FC03 and the bits are swapped (see the screenshot here attached).
It works, but I don't like it.

Maybe is a problem of Modbus Master software?
I don't think so because I can read the bits correctly with the configuration in the 1st post.
Let me know if you have or not my same problem.
Maybe I am totally crazy :ROFLMAO:

 
Last edited:
The master (not my scope) reads all the data with the same function code (I think). He then extracts the BOOLEANS from the registers.

We did have to do some swapping (he uses Schneider), but works without problems now.
 
Ok, thanks. Seems the simple way.

Btw, I think that I understood how this block works.
It maps the Siemens discrete IO with FC01 and FC02, without additional configuration.
Cool. Finally I found out how it works.
 

Similar Topics

Been fighting all morning with a stubborn HMI. It just won´t connect with the plc. attaching from settings. Have i missed anything? Both plc and...
Replies
5
Views
316
I need to convert some Siemens PLC logic using Siemens TIA V16 to Modicon M580 logic. Is there a tool out there that will get me started? How...
Replies
3
Views
2,705
On Siemens S7-1200 and S7-1500 what is the main Difference? Which is best to learn? Which is best for a project and why? What is the main...
Replies
2
Views
9,595
Hi all! Short question, when using Simatic Manager and S7 300 CPU's, one had to add OB's to keep the CPU from stopping in case of hardware or IO...
Replies
10
Views
2,286
Does anyone know of a Siemens example project for passing data between a 1200 and a 1500? I thought I found one before but can't find it now. I...
Replies
5
Views
1,708
Back
Top Bottom