S7-1200, Profinet, Modbus TCP

I agree. But it also comes down to economics. If you re-read his first post, he knows nothing about modbus. I think his time is worth something.
He didn't take the easiest path but he will learn about modbus on someone's dime

And I think its great your helping him !
 
Last edited:
I can't really argue with either of you. With the time I've spent to date working it out, if things go relatively smoothly from here it will work out to be slightly (very slightly) cheaper than the Profibus module. If not, well, probably a bit more, but then as grnick says, now I know enough about Modbus TCP to implement it without too much pain :)

And yes, Mettler told me that the Profinet module was coming, and painfully close - but it's still a little way away for the particular unit I'm using. And then everything takes a bit longer to make it here to Australia ;)

Thanks again for the advice to both of you! It's always good to have multiple options from well versed people :)
 
Great, thanks for that! I'll take a look. If I understand what this is, I can set this up so that my laptop will simulate the Mettler and I can get the PLC to interrogate my laptop for the information the same way as I would the Mettler, am I right?
 
ProfiNET is a real-time deterministic protocol and those don't tend to play nice with regular TCP/IP traffic like ModbusTCP. If you have trouble, you may have to switch the HMI over to Modbus as well.
 
Hi all,

I've been given a system to design containing a whole lot of things I haven't worked with much (or at all) before. My PLC is a Siemens S7-1200, my HMI is a Siemens KTP600 Basic Panel with Profinet interface, and I have to communicate with a Mettler-Toledo weight controller, which speaks Profibus or Modbus TCP, but not Profinet. So far my plan of attack looks like this:

Plan A is to have the S7-1200 talk Modbus TCP to the Mettler and Profinet to the HMI from the same port at the same time. Is this possible? If not...

Plan B is to talk Modbus TCP to both the Mettler and the HMI. Is this possible/straightforward/a pain in the backside?

Plan C is to get a profibus card for the S7-1200 to talk to the Mettler. Does the S7-1200 have such a card, and is it painful to set up?

In any case, I have no experience with Modbus TCP, and the only two things I know about profibus is that the cables are purple and that if you don't do the grounding properly You Are Going To Have A Bad Time. I have a little experience with Modbus Plus, from a few years back, but that's about it. So any advice or tips and tricks on getting it working are much appreciated!
Dear JRW,
You are so VERY correct about the shielding with the profibus cables. Remember that the cables are solid wire and if they are not stripped carefully the wire can crack or break right at the edge if the insulation and this has caused me to reterminate all the profibus connectors as I did not see this break. over 2 days of work.
I believe that you can add a profinet card to the S7 and talk through both of them at the same time or at least in the same scan. Then a global variable that can read/write to everything can be used. Sometimes this tends to be a little slow depending on your logic. This is about as far as I can go as it has been a few years since I used an S7. Hope this helps.
JM
 
OK. So I've gotten as far as testing the modbus comms using the modbus slave simulator software suggested by grnick. I've got it working to the point where if I disconnect the Modbus Slave, I get status 16#7002 (server disconnected), and when I reconnect the server I get status 0000 (OK).

Then I trigger the REQ input. Status stays at 0000, BUSY flag turns on, and...nothing. I can see traffic in the Modbus Slave software that starts and stops with the REQ input turning on and off, although I don't understand it enough to interpret it. But the DB referenced in my MB_DATA_PTR doesn't change, I never get a DONE or ERROR flag, it just sits there being busy with no error code and appears to do nothing.

Can anyone suggest anything I might have missed, or any way to troubleshoot this further?
 
I've attached all the screenshots I think might be of relevance. I'm going to call it a day, but if you have any suggestions as to what I could try I'll be all over it Monday morning 🍺

MB_CLIENT.png DB100.png Slave Definition.png Conn Setup.png MB Slave.png
 
And here's the traffic that it's seeing. Roughly every 2 seconds, two more entries get added to the list. If I activate the DISCONNECT input on the MB_CLIENT block, or de-activate the REQ input, they stop coming. They start again straight away if I turn the REQ back on (with the DISCONNECT off, obviously)

Thanks!

Traffic.png
 
Nick, you're a champion! That worked a treat :)

Now I've just got to work out how to extract the data, but I think I'll start a new thread for that one, as it's a completely different issue. Thanks again for your help!
 
The way I do it is to write a UDT for the scale and then in a function write some code to link and condition the raw ddata to a variable of the UDT type.
 

Similar Topics

Hello All I have a modbus tcp device(Julabo magio) with an DB9 pin assignment. Pin3=B and Pin8=A. I would like to connect it on the secondary...
Replies
4
Views
1,595
Hi I'm wanting to basically get data from a Siemens S7-1200 PLC and write it in to my D registers on my Q series PLC. If I went for profinet...
Replies
6
Views
2,234
Hi Guys, I am trying to establish communication over profinet between Siemens S7-1200 PLC as IO device and codesys plc as IO controller. But I am...
Replies
43
Views
2,567
Hello all, I'm working with an s7-1200 and a stepper motor in Tia portal v17. This stepper motor is an SMD23E2 and I am attempting to connect...
Replies
19
Views
2,842
Hey. I have an S7-1200 system, which i intend to communicate with a eurotherm Epack 1ph controller via profinet. I have installed the GSD and...
Replies
6
Views
2,273
Back
Top Bottom