profibus between two siemens 300

apetkov5

Member
Join Date
Aug 2007
Location
x
Posts
101
Greetings to all!

I am newbie in profibus but i want to learn and i am free to ask on this forum for several things.

I have two Siemens PLCs. One with 312 cpu and other with 314 cpu. On both plcs there is CP 342-5 phisically connected. Between locations of plc's there is optical fibers.

In "hardware" (station configuration) in both programs i have inserted cp-s with their I and Q adress ranges (265...271).

Now, i am interested, how to establish communication betwen that two plc-s. It must work on principles that specified data from one data block (at first plc) is copyed? (syncronised?) to specified data block, at specified adress, on second plc. (then second plc works with that data)....

- Do I nead to insert FB2,3,4,... in OB1 of cpu-s ?
- From where (libraries - "simatic_net_cp" or ?) can i take FB-s?
- Can I use FB-s from "CP 300" section for CP 342-5?
- What parameters to assign at inserted FB-s? Please can you explain that to me?

- Where can i found or can someone send to me :) some examples of that?...

Maybe this questions sound stupid but i am really newbie an i will be very happy when you help me.

Many thanxes!

btw. I am sorry because of my bad English

Greetings, Ante!
 
Last edited:
Hi Ante.

1. Both S7 PLCs should be integrated into one STEP7 project.
2. Open NetPro, and create an S7 connection from one CPU to the other. Notice that a connection "ID" is assigned to the connection. You will need that later.
3. Open the SIMATIC_NET_CP library under CP 300 and locate the PUT and GET FBs. Copy these to both of your S7 PLCs blocks folders.
4. Program PUT and GET as needed in the programs, specify the ID number from NetPro.
Start the data transfer with the REQ bit.
Evaluate the DONE bit to know that the transfer was succesful.
Evaluate the ERROR bit and STATUS word in case something goes wrong.
The specification of source and target data areas should be in the format "P# DBxx.DBXyy.0 Byte zz" where xx is the DB number, yy is the starting byte number within the DB, and zz is the number of bytes to transfer.
5. Download to BOTH CPUs. This is necessary because of the specified S7 connection.

Another tip is that of you are sending from one CPU to the other (with PUT) then to let the other CPU know that there is new data to work with, let one of the datawords that are transferred be a counter that is incremented for each telegram. The other CPU shall then look for changes in the counter.
 
More or less following the instructions from Jesper you could also use FC5 (AGSEND) and FC6 (AGRECV).This is called the FDL protocol and is can also be used on S5.The same blocks can also be used if you use ethernet.When we switched form Profibus to ethernet we only had to delete the profibus connection and create a new ethernet connection , and use the same adress than the old profibus card .

example
CALL "AG_SEND"
ACT :=M82.0 // send bit (in conjunction with dx3.0
ID :=2 // check FDL connection number
LADDR :=W#16#FF8 // check CP module adress
SEND :=P#DB80.DBX20.0 BYTE 10 // DB,DW en length
LEN :=10 // length
DONE :=M82.1 // if 1 then send ok
ERROR :=M82.2 // if 1 then Error
STATUS:=DB82.DBW2 // Error code

CALL "AG_RECV"
ID :=2 // FDL connection number
LADDR :=W#16#FF8 // CP module adress
RECV :=P#DB82.DBX10.0 BYTE 92 // DB,DW en lengte
NDR :=M82.3 // New Data Recieved
ERROR :=M82.4 //Error flag
STATUS:=DB82.DBW4 // Status code
LEN :=DB82.DBW6 // recieved lenght

Max data transfer in one go : 240 bytes.

Greetings
Eric
 
Many thanxes!

It might be silly but may I use just "put" (or agsend) FB at "transmitting" side (first plc send information to another) or i must use "get" too?

Do I nead to sincronise it somehaw?

And one question more :)

For now i have two separate programs (projects) (very big). Is there any way to easily integrate it in one S7 project (with hardware configuration)?

Many, many thanx.
 
Hi


No need to use get and put if you only want to send from one PLC and receive at the other PLC but its just has easy to program both even if one is not used.

Yes you can put the two projects into one project but ( again ) you must be carefull to copy and paste all the components that you use .Once copied you must recheck your hardware , netwerk etc ,and only then can you make a connection using netpro


Many_to_one.jpg
 
Hi

Forgot something , when you combine projects ,in netpro , you have to 'relink' your common netwerks ie ethernet .Delete the ethernet from the 'old project and connect your cp to the existing projects ethernet.And then do the connections.

Eric
 
apetkov5 said:
It might be silly but may I use just "put" (or agsend) FB at "transmitting" side (first plc send information to another) or i must use "get" too?

Do I nead to sincronise it somehaw?
PUT/GET works from one side. There is no need to do anything on the other side.
The other HUGE advantage is that the transfer is validated. When you get the DONE bit, then you can realy on that the data arrived 100% sucesfully.

AG_SEND/AG_RECV works in pairs. The datatransfer is also validated.

apetkov5 said:
For now i have two separate programs (projects) (very big). Is there any way to easily integrate it in one S7 project (with hardware configuration)?
Simple. In one project, simply highlight the folder containing the "station" at the "root" of the project tree, and then copy with CTRL-C. You then paste it into the other project with CTRL-V.
 
Thanx!

If I nead to transfer (send) just memory bite instead od DB, can I just put "P#M1.1" instead of "P#DBxx.DBXyy.0 BYTE zz"?
Or sintax is different?
 
Helps a lot!

But if I wana to transfer M1.1 and M1.3 (without M1.0 and M1.2), and wana that informations be written on M10.1 and M10.3 at second (target) plc?

I am hope that i am not "killing" with questions :)
 
apetkov5;
Transfer the byte to a byte address in your recieving PLC, do the bit manipulation there.
Hope this helps,
Daniel Chartier
 
FOR JASPER (quoting)


2. Open NetPro, and create an S7 connection from one CPU to the other. Notice that a connection "ID" is assigned to the connection. You will need that later.

Did you maybe mean from one CP to another?

I did next:
- In NetPro insert PROFIBUS(1) (pink line in Simatic) from Subnets, and then connect line (interface) from both CP-s (342-5).

Is that correct?

btw. I read the ID "S7-Subnet ID: 00B1-0013"

Thanx in advace
 
Last edited:
Hi Ante.

What you did was to connect the two CPs to the same network (Profibus). Now you have to assign a connection between the two CPUs.
Select one CPU (not CP), there should appear a list of connections (now empty). Double click the empty list to add an S7 connection and take note of the IDs that gets assigned.
Save and compile !
for_ante.GIF
 
....

I sometimes write manuals for own use in our company, have u used a software tool for the arrows ?

aikona said:
Hi


No need to use get and put if you only want to send from one PLC and receive at the other PLC but its just has easy to program both even if one is not used.

Yes you can put the two projects into one project but ( again ) you must be carefull to copy and paste all the components that you use .Once copied you must recheck your hardware , netwerk etc ,and only then can you make a connection using netpro


Many_to_one.jpg
 
Arrows in pic

Hi


No , I use photoshop . I do a print screen and then paste it to a new picture in photoshop .

For 'paper' manuals we use an old copy of quark express . We hope to buy a copy of ADOBE INDESIGN.

We also have a extensive intranet system where most manuals,FAQ's,Internal courses etc are on a webserver that is maintained using Dreamweaver.

Eric
 

Similar Topics

Greetings Can the Profibus network ، Schneider Premium PLC with TSXPBY100 Module was selected as Slave? I'm going SIEMENS PLC (S7-400) as master...
Replies
3
Views
2,357
I am interfacing KS800-DP modules (temperature controller made by PMA) with SIEMENS S7-317 2DP CPU, using PROFIBUS DP Communication. The GSD file...
Replies
6
Views
3,151
Hi everybody, An IPC connected to a Siemens PLC as a slave module. When I restart the PLC while IPC running then PLC can't find the IPC node on...
Replies
0
Views
9,152
Hello, I have a question. Is it possible to set up communication between a Allen Bradley PLC and a Siemens PLC through profibus. It's because...
Replies
3
Views
10,749
does any one have the experience with profibus dp communications between S5(use IM308C , as DP master) and S7-315-2dp(as slaves)? I would like to...
Replies
3
Views
10,112
Back
Top Bottom