Technical Forum

Communication / Networks

MODBUS TCI/IP RK512

Thread Starter: alibi   Started: 5/30/2012 4:26 PM   Replies: 13

« Previous thread Next thread »
«12 Page 2 of 2 (14 items)
  5/31/2012, 9:08 AM
Joined 5/17/2012
Last visit: 5/31/2012
Posts: 7
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello  Daniel Chartier,
Thanks for joining to this post. 
Answers on your questions: 
1. I use a communication cable between master (CP 341) and slaves
2. The name of the device is PM810 made by Schneider Electric. 
3. It (PM 810) supports RS 485 layer so here is no problem.
Best,
Alibi
Top
  5/31/2012, 1:18 PM
Joined 9/27/2006
Last visit: 5/23/2013
Posts: 3944
Rating:
Rated: Excellent [4.15 out of 5 / rated 619 time(s)]. (619) 
Rated: Outstanding [4 out of 5 / rated 1 time(s)]. (1) 
Hello alibi;
Here is one manual for the Powerlogic PM801 that includes a chapter on Modbus Registers for the unit (see Appendix A):
http://www.powerlogic.com/literature/63230-500-201A3.pdf

The PM801 is flexible enough that it can be programmed for a range of parameters, so you can choose parameters that will match the CP 341: 9600, E,8,1,1 is a standard plan for these RS-485 comms.

All registers of the PM801 are treated as Holding Registers, so I suggest you use a Modbus function 03 with a 40,000 offset for every register value you wish to request. Study the Register list and determine what values you want to read in, with their offset, and see how the Modbus jobs can be planned in the master.

If any of these comments appear strange to you, then you need to read up on Modbus exchanges. As a start, I would recommend a thread from our friend Smiffy discussing the basic requirements for Modbus programming:
Modbus General Description 

And the first chapter of the CP 341 Modbus master manual discuss various topics on Modbus that you need to understand well in order to program Modbus jobs:
SIMATIC S7-300/S7-400 Loadable Driver for Point-to-Point CPs: MODBUS protocol, RTU format, S7 is master

Hope this helps,
Daniel Chartier



=== Edited by dchartier @ 5/31/2012 1:19 PM [GMT ] ===


Top
  5/31/2012, 1:53 PM
Joined 5/17/2012
Last visit: 5/31/2012
Posts: 7
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Thank you very much,
Article about Modbus by Smiffy helped me a lot. 

I think I managed everything, but there is still one question open.
alibi wrote:
Now I am facing the problem of sending and recieving data. Do I need to create new data block for the registers or what?

Best, 
Alibi
Top
Thank you for this post from:
  5/31/2012, 3:25 PM
Joined 9/27/2006
Last visit: 5/23/2013
Posts: 3944
Rating:
Rated: Excellent [4.15 out of 5 / rated 619 time(s)]. (619) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello alibi;
The information you are looking for is found int he Modbus master manual suggested earlier.

Say you want to read from slave #1 the registers with offset 1100 to 1125 (Holding register, base Modbus address 40000).
In your PLC program you will need to call P_SEND_RK (in which you give references to the Send_source DB) and create a Send_Source DB with the following information:

SEND Source DB
Structure of SEND Source Area:
Address           Name                     Type                  Initial value                Comment
+0.0                  address                BYTE                   B#16#1                      Slave address
+1.0                  function               BYTE                   B#16#3                      Function code
+2.0                  reg_startadr         WORD                 W#16#044C              Regs. startaddr.
+4.0                  reg_anzahl            INT                       26                             No. of Regs. 

You will also have to call a P_RCV_RK function with a reference to the RCV-Destination DB, as explained in chapters 7 and 6.3

This is true for every call of a Modbus request job you will have. If you change slave number you need a new call for send and recieve blocks. If you change the start address of the registers requested you will need a new call for send and recieve blocks also.
So start by planning which registers you wish to collect from each slave, and start planning youtr Modbus exchjanges before you start programming.
Hoep this helps,
Daniel Chartier



=== Edited by dchartier @ 5/31/2012 5:37 PM [GMT ] ===


=== Edited by dchartier @ 5/31/2012 3:27 PM [GMT ] ===


Top
Thank you for this post from:
«12 Page 2 of 2 (14 items)
Actions