Profibus DP communication between two PLCs (315-2 DP)

Join Date
Jul 2007
Location
Poznan
Posts
14
Hey

I have a question: how to communicate two PLC(315-2 DP) using Profibus. I manage to communicate them using HWConfig I/O but I know that there is another way to do that. Them this way I can send only 4 bytes.

Is there any way to send more data, for example whole DB or large part of it? I know that a should use some FC, SFC, or SFB but I don’t know which one.

I found blocks FC1 “DP_SEND” and FC5 “AG_SEND” in SIMATIC_NET_CP but I have no CP module to use them. Can use them direct from CPU 313-2 DP port?

By FC5 “AG_SEND” I also do not understand the parameter ID ?

And LADDR : is it “Partner DP address” or “Diagnostic Address”??

Please reply. Thanks
 
Hi Pawel.

For 2 x 315-2DP there are a number of possible options.

Use MPI. This is simple. Use the blocks XPUT and XGET, or alternatively Global Data transfer.
Disadvantage is that the MPI ports are non-isolated, and thus only recommended for short connections. 50 m or less.
You can extend the reach beyond 50 m with repeaters.

Or, use DP master-slave. One 315 then has to be master and the other slave on the DP network. The data is then transferred via the i/o image.

Or, use DP master-coupler-master. Each 315 is then master on its own DP network. A DP/DP couler connects the two networks. The data is transferred via the DP/DP coupler and the i/o image.

Or, add some comms hardware to one or both racks.
There are both ethernet and profibus CPs.

We can help you further based on your decision on the above alternatives.
 
PawelStrzelecki said:
Hey

I found blocks FC1 “DP_SEND” and FC5 “AG_SEND” in SIMATIC_NET_CP but I have no CP module to use them. Can use them direct from CPU 313-2 DP port?

By FC5 “AG_SEND” I also do not understand the parameter ID ?

And LADDR : is it “Partner DP address” or “Diagnostic Address”??

Please reply. Thanks

FC5 and FC6 AG_SEND AG_RECV is used to communicate between PLC's BUT only if you have a CP card .The FDL protocol is then used and is also used to communicate to S5 via profibus ( again with CP)

For parameter ID and LADDR .This info comes from the connection you make in Netpro.
 
Last edited:
Hi JesperMP & aikona



So my status on my master's thesis for now is that I have no CP module (only one but I'm using it to communicate with PC).

I have three 315-2DP so I would like them to communicate with Profibus. So far a mange to communicate them using HWConig I/O (should be on the pictures if I add them correctly
icon7.gif
).




But it's not a good way to send more then 4 bytes. For example to exchange DBs.

I've also ET200 station which i would also like to combine with the other three.
There is generally only one master in net.


And in theory all PLCs should be connected with the master and this master should be connected to PC with Ethernet.
HWConfigx.JPG

Connectionx.JPG
 
Last edited:
You have setup the i/o between the master and S7 slaves so that you exchange 4 bytes of data.
Now now you want to exchange dynamically other data such as DBs between the S7 stations.

The simplest would be to use MPI and X_PUT/X_GET as suggested before.

For Profibus it will be harder or much harder.
With DPWR_DAT (SFC15) and DPRD_DAT (SFC14) you can achieve data consistency for up to 240 bytes against the normal 4 bytes.
However, you can only exchange as much data as is the i/o is configured in the HW configration.
If you want to exchange more data than what is configured in the HW config, you will have to mutiplex the data. You would have to create a function yourself to accomplish this (maybe someone else have already done this). If you go this route, be sure to implement some kind of error checking.
 
If you want to transfer data from different areas of slave CPU to the Master CPU you can use I_PUT and I_GET functions. You can transfer up to 76 bytes in one job of I_GET/I_PUT. Data areas can be changed after completion of a job. You can find sample solution and description in Siemens support site.
 
Ok I will try to investigate them. But I’m fresh one – just starting with PLC.

Does I_PUT and I_GET use Profibus, then in Simatic Manager Help there is nothing about using them with Profibus.

JesperMP tell me please more about using SFC15 and SFC14, then I’ve tried to use them but it didn’t work.

SFC 15 and 14 are only for DP master use? I don’t understand how to define an area to write/read on DP slave. I’ve tried also to download them to DP slave, but I had error 8090 and 8093 so I give it up.

Please explain this to me? Would it work with ET 200?

LADDR is DP address given by me or Diagnostic address, then it was hard to understood it from description.
 
DPWR_DAT and DPRD_DAT is used to read and write data in one complete block (consistent data). If you try to use L and T instructions the max you can address is a doubleword (4 bytes). So with L and T instructions you risk that data in the target changes before you can read or write everything. This is called inconsistent data.
This is just one part of the formula to exchange data with an intelligent slave. It wont solve the problem of transferring more data than what is defined in the HW Config.

You wouldnt need to read or write data consistently with a DP slave in most normal cases. Cases where it could be required could be a VFD on DP, or other intelligent slaves (i.e. PLCs).
So for a normal ET200 slave on a 315-2DP master you dont need this.

The I_PUT and I_GET SFCs seems to do the job. That said, I havent actually tried it myself (didnt know of this variant until yesterday).
It looks not so trivial to figure out. I suggest you look at this FAQ with sample code:
http://support.automation.siemens.com/WW/view/en/20987910
 
Thanks very much for the link, it will be nice lecture for this week and I'll try to get use of it.
For now I've question to SFC 14 and 15:
For my configuration as it is shown on the screen views, can I read from the slave this way:

****** on DP master ******
CALL "DPRD_DAT"
LADDR :=W#16#3 //or Diagnostic address 2046 ??
RET_VAL := MW10
RECORD :=P#DB1.DBX 0.0 BYTE 10

****** on DP slave ******
CALL "DPWP_DAT"
LADDR :=W#16#2 //or Diagnostic address 2047 ??
RECORD :=P#DB2.DBX 0.0 BYTE 10
RET_VAL :=MW10

Should I also change something in HWConfig in both PLC?
 
Hello Pawel;

Please take a few seconds to look at the following illustration:

SFC14_15.jpg


This is an extract from the System and Standard function manual.

You must not use the Profibus address of the slaves (which is what I believe you are doing with the entries w#16#2 and w#16#3 in your code above), or the diagnostics address of the slaves. You must use the confighured address for the module you wish to read/write to.

Please note that SFC14 and SFC 15 can only be used to read/write on a slave module, not on the full slave exchanges. In the screenshot you are showing earlier, you have configured slave modules of one byte input and one byte output, with Consistency by "UNIT". SFC14 and SFC15 here have no use. You can read/write over Profibus up to 4 bytes (DWORD or REAL value) directly without any SFC. If you were to use SFC14/ with those inputs, since they are addresses as I40 and Q40, your LADDR parameter would be set to w#16#28 (dec 40).
You will need SFC14 and SFC15 when you need to read/write more than 4 bytes at a time, as a single element (Consistency by "Total") over Profibus, and that does not happen very often. the classic example is parameter access to a Siemens (Micro/Master) drive, where 4 words of data must be written to the drive as one single element; written one by one, the drive will not acknowledge the data. So in this case you must use SFC15 to write the prepared data telegram to the drive at one moment in your program.
Hope this helps,
Daniel Chartier
 
It looks like you should use the start address (*).
This FAQ has both explanation and sample code:
http://support.automation.siemens.com/WW/view/en/19054790
Ignore that one partner has a CP and uses DP_SEND and DP_RECV.

*: If the adresses are mixed up so that there isnt a continous range, then I think the solution is to use the diagnostics adress. Thinking again, I dont think you can use the diagnostics adress. The diagnostics adress can be used with DP_SEND and DP_RECV, but that is not relevant in this case.

I notice that in the HW config you have defined only 1 byte, but in the suggested code you want to transmit 10 bytes. That wont work.
If you want to transmit more data than what is setup in the HW Config, then use the previous example with I_PUT and I_GET.
 
Last edited:
You must not use the Profibus address of the slaves (which is what I believe you are doing with the entries w#16#2 and w#16#3 in your code above), or the diagnostics address of the slaves.

I've not used SFC14/SFC15, so I'm not speaking from experience, however, with other Profibus SFCs (SFC12 amongst others) I have successfully used the diagnostic address as LADDR.

Just to confuse the issue, in the picture Daniel has posted, the examples given explicitly state you should use the first I or Q address. However, in the "Note" immediately following this, they use diagnostic address 100 (unusually low value for a diagnostic address, in my experience) to illustrate that the address must be entered in hex format!
 
Last edited:
Thanks, Ron;

I hadn't realized that the example I was showing contradicted my point so efficiently....
In any case, I know from experience that SFC14/15 work perfectly with the parameter LADDR set to the I/O address attributed to the module you need to read to/write from.
I have (evidently) never tried it qith the diagnostic address of the slave. I would like to know how this would affect a slave with multiple modules configured.

Regards,
Daniel Chartier
 
SFC14/15 work with LADDR set to I/O address, they don't work with LADDR set to diagnostic address. LADDR should be supplied in hex format like in the example. There is an error in documentation note (like in many other places, they first write docs in German then translate to English).
 

Similar Topics

Could anybody please shed some light as to what are the steps in making a communication between Compactlogix 1768-L30ER CPU and Siemens S7 CPU...
Replies
3
Views
2,695
Hi! I am following this document of Siemens DP/DP coupler...
Replies
0
Views
1,171
Hello, I'm writing my first program for S7-1200 and have some problems with communication between CM 1243-5 and FC302 via profibus dp Is there a...
Replies
2
Views
3,807
Hello all. I have a problem about communication between cpu s7300 and cpu et200. Thanks
Replies
1
Views
2,913
HELLO ALL. I HAVE A PROBLEM about communication between cpu s7300 DP and S7300 CP. THANKS
Replies
4
Views
4,327
Back
Top Bottom