S7-1200 as Modbus TCP client

wantutri

Member
Join Date
Apr 2015
Location
Singapore
Posts
6
Hi All,
As said in subject, I tried this setup. S7-1200 as client and a power meter a server





The first attachment ("S7-122.png") is my first test. I tried reading register 51078 using S7-1200 and get a status error of "8189" which is an invalid data used in MB_DATA_ADDR. Upon reading the manual, I see that only these ranges are allowed:
  • holding register = 40001 to 49999
  • extended holding register = 400001 to 465535
I guess the problem is that the power meter is using an address of 5xxxx for its registers. Is there any workaround to read these registers? Btw, in my screenshot, I got no error reading register 51078 using Modbus poll



Another test (2nd attachment, "5142015 (network2) - 40001.jpg") to see if there is any packet sent/received to/from the power meter.
I tried reading data from register 40001 (using S7-1200) but I can't see any query from wireshark. I also tried reading data from register 40001 (using modbuspoll) and I can see both the query/response to/from the power meter.
My question is why can't wireshark sniff any Modbus/TCP packet from the PLC even though I'm getting 'DONE' in the status of the ModbusClient block. Are there still problems in my parameters? I've added a counter for the number of reading job done (11403) and the number of errors (0).





Setup for testing #2:
  • S7-1200 CPU1212C fw4.0: 192.168.1.50
  • Power Meter: 192.168.1.10
  • PC: 192.168.1.100
  • TIA 13 (without any SP)
Regards,
wantutri

S7-1200.jpg 5142015 (network2) - 40001.jpg
 
First of all client is master so you should use modbus slave to simulate meter not modbus poll wich is modbus master not slave.

You didn't say what meter you want use.
I think 51078 address is physical memory address.
Modbus address would be 451079, because for physical addres 0 you would need to use 400001 modbus address in
 
First of all client is master so you should use modbus slave to simulate meter not modbus poll wich is modbus master not slave.

You didn't say what meter you want use.
I think 51078 address is physical memory address.
Modbus address would be 451079, because for physical addres 0 you would need to use 400001 modbus address in

I'm also connected to the power meter, the IP addresses used are as shown above (setup). I just first used Modbus poll (as client) to know if I can read some holding registers from the power meter (as server). After confirming it is working, I then tried using the S7-1200 (as client) to read the same registers. My screenshots show the results of my testing

The meter was EEM-MA600 from phoenix contact.
I already tried adding "4" at the beginning so it was like I was reading "451078" and a get an "invalid MB_DATA_ADDR". I will try to read "451079" and will post the result later

Regards,
wantutri
 
Hi marcius,

Thanks! I didn't realize that I used a wrong offset, I just simply put 4o_O
I can read the registers now though I still can't see any packets from wireshark. Anyway, as long as it's working, I'm good.

Regards,
wantutri
 
You will not see packets of plc and power meter if you connecting pc to switch.
You need an old hub(hard to come by) wich forwards all received packets to all ports or switch with port mirroring capability.
Than you mirror all ports to one and when connected with pc to that mirrored port you will be able to monitor traffic.
 
Facing problem in extended modbus address

Hi wantutri,

I am facing the same problem. So please can you tell me what will be the offset in this case

Regards,
Ankur
 
Hi wantutri

Thanx for the reply. I want to read value from 55296 modbus address. So what will be the value of offset and mb_data_addr.
 
Actully the current situation is this that a SCADA is getting some values from PLC over modbus TCP and i also want to read the same values from that PLC to my PLC(s7-1200). I got a list of modbus addresses(55296-55330) from client.
 
Actully the current situation is this that a SCADA is getting some values from PLC over modbus TCP and i also want to read the same values from that PLC to my PLC(s7-1200). I got a list of modbus addresses(55296-55330) from client.

If there is an offset its generally always +1
 

Similar Topics

can i send and recieve data using my yokogawa UT35A controller with my siemens s7 1200 plc using profinet communication without using gsd file
Replies
1
Views
382
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,613
Hi All, I have a closed loop stepper motor (Nanotec make), https://en.nanotec.com/products/2512-pd4-e601l42-e-65-4. This uses MODBUS TCP for...
Replies
4
Views
3,860
Hello; i'm having some troubles with a com test i'm handling. i have another end for it, but for now i would like to have : M241 in io_scanning...
Replies
4
Views
3,484
Hi, I currently have a s7-1200 enabled as modbus tcp slave for customers master to connect to freely. Now my customer want to add a new modbus...
Replies
8
Views
4,664
Back
Top Bottom