Sign in to follow this  
Followers 0
DieterG

Read rs485 data

12 posts in this topic

Hello, 

I am new here. 

Not a professional programmer, but i like to play wit it. 

I have a s7-315dp running my house, together with a Proface hmi. 

I recently installed a kwh meter to monitor the solar pannels. 

This kwh meter is equipped with rs485 port, i think to connect with app's like home assistent. 

I wonder if it could be possible to read the kwh meter with the plc and display it on the HMI. 

 

Thank's for the help. 

Dieter. 

Share this post


Link to post
Share on other sites

Extra info :
The RS485 uses Modbus RTU in  "n,8,1" data format.

Current setup is :

S7-315DP plc
-> 2x DI16
-> 2x DO16
-> 1x 4xAI/2xAO

2x ET200L 16DI/16DO conected with profibus

1x Proface HMI on the MPI port

 

I guess i need some extra hardware ?

Share this post


Link to post
Share on other sites
3 hours ago, DieterG said:

The RS485 uses Modbus RTU in  "n,8,1" data format.

No, it must not.  The Modbus RTU default is E,8,1.  The spec states that if no parity, then two stop bits are required.  So you have three choices:

E,8,1

O,8,1

N,8,2

Share this post


Link to post
Share on other sites

Hello,

Modbus and Siemens (at least with Step7) it's the wedding of the rabbit and the carp as we say in France ;-)
So if your Proface has another RS485 port, it wil be easier to use the HMI to communicate with the meter.

JC

Share this post


Link to post
Share on other sites
54 minutes ago, acpi said:

Hello,

Modbus and Siemens (at least with Step7) it's the wedding of the rabbit and the carp as we say in France ;-)
So if your Proface has another RS485 port, it wil be easier to use the HMI to communicate with the meter.

JC

Hehe, wedding of the rabbit and the carp. I'm going to have to remember that one!

I'm pretty sure that there are Modbus examples available for the S7, but I've never used them. I looked into them a little when I was testing Advanced HMI. As I recall, though, those examples were Modbus over Ethernet, not RS485. It's been a few years, though, so my memory may be faulty.

Does the manufacturer of the power meter have any documentation or support for connecting to an S7?

Share this post


Link to post
Share on other sites
3 hours ago, pturmel said:

No, it must not.  The Modbus RTU default is E,8,1.  The spec states that if no parity, then two stop bits are required.  So you have three choices:

E,8,1

O,8,1

N,8,2

N.8.1 is what the specs tell me.
Maybe a typing error?

Share this post


Link to post
Share on other sites
3 hours ago, acpi said:

Hello,

Modbus and Siemens (at least with Step7) it's the wedding of the rabbit and the carp as we say in France ;-)
So if your Proface has another RS485 port, it wil be easier to use the HMI to communicate with the meter.

JC

Sadly no extra port on the HMI

Share this post


Link to post
Share on other sites
2 hours ago, Joe E. said:

Hehe, wedding of the rabbit and the carp. I'm going to have to remember that one!

I'm pretty sure that there are Modbus examples available for the S7, but I've never used them. I looked into them a little when I was testing Advanced HMI. As I recall, though, those examples were Modbus over Ethernet, not RS485. It's been a few years, though, so my memory may be faulty.

Does the manufacturer of the power meter have any documentation or support for connecting to an S7?

i have sent them an email to ask.
There products are usualy used on raspberry pi systems that use the modbus protocol.
i'm not sure they have experiance with industrial systems, wil have to wait there answer.

If modbus is really that hard, i might better look for another energy meter, with profibus connection.

 

Share this post


Link to post
Share on other sites

Either you change your meter for one that can communicate as a Profibus slave or you use a Profibus/Modbus RTU gateway. You can have a look on Anybus or Hillscher products.

In any way forget Modbus with Step 7, it's expensive as you need a CP and it's really complicated to program, you can trust me :)

JC

Share this post


Link to post
Share on other sites

I have got an answer from the energy meter supplyer.
As i thought, they don't hava any experience with PLC's

As a possible option, with new firmware there is also the Modbus TCP option.
So maybe, if i add ethernet connection to my 315 i can connect them this way.

I also found a Modbus RTU/profibus converter for around €140, maybe that's the cheapest and easyest option.
Question about this -> when i want to add new hardware, i simply drag the specific siemens part and asign it with the profibus network.
But this converter wil not be in the parts catalog, how do i add such a part ?

 

Thank's, Dieter.

Share this post


Link to post
Share on other sites

Morning,

You have to download the GSD file of your device (it's a small text file) and install it in the HW Config.

JC

Share this post


Link to post
Share on other sites

Thank's for the help.
I wil order it today, they deliver a suited GSD file with the converter.

Dieter.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0