Master Slave

al_d

Member
Join Date
Nov 2004
Posts
36
Hi,

Recently I posted a query on how to set up a master/slave configuration using two CPU 314 C- 2 DP PLCs and I received a fantastic link:

http://www.automation.siemens.com/fea/html_76/down_module.htm

and used “PROFIBUS DP with Master CPU 315-2 DP / Slave CPU 315-2DP” module D6. I followed the manual and I am still struggling to get the master and slave to communicate.

At the moment my aim is very basic in that I would like to switch on an input contact with a switch directly connected to an input on the Master PLC (or by using Wincc) to switch on an output contact in the slave PLC and vice versa. Similar to a program I constructed in block OB1 in the master program.

I can switch on an input contact in Wincc for example, M120.0 to switch on an output contact Q120.0 in the slave but I can not get any output contacts to switch on in the master PLC using a similar Wincc input.

The master configuration was downloaded to the MPI port in the master and the slave to configuration to the slave PLC using MPI then the profibus network was connected to both PLCs and both PLCs could be read on the network in the diagnostics of the CP 5613 PCI.

From the above manual, the code


L IB 0
T QB 40
L IB 40
T QB 4

was placed at the start of the program in both OB1 of the master and slave (I don’t know if this is needed).

I’m not sure if the contacts need different operators to be used for the slave for example, instead of using I124.0.

I have set the I/O contacts in the slave as I120..I122 and Q120..Q121 and have left the master I/O addresses as I124..I126 and Q124..Q125.

Sorry about persisting with this topic,

Thanks.
 
A dp/dp coupler is a fairly low cost device to enable two PLC's to connect to each other via the profibus network.

They both see the coupler as standard I/O and must be addressed equal and opposite, i.e. if PLC 1 has been addressed as 10 input words and 5 output words, then PLC 2 must have 5 input words and 10 output words.

Very easy, quite cheap and no fuss.

If you look in your Siemens catalogue, you will find them there.

edit:

It also depends po the amount of data your passing, as these are limited, but if speed is not an issue, you could clock info back and forth to exceed limitations.
 
Last edited:
At the moment unfortunantely we are stuck with what we have.
From my first post am i far off in getting the system to work? Thanks for the suggestion.
 
Have you downloaded the archived project and looked at that. On page 27 of the doc file, it looks like dear old Siemens have made a mistake and mis-addressed the remote PLC addresses.


In the archived project it looks OK.

I 40 should be cross addressed to Q 40, not 2 as shown on page 27.

Similarily, Q 40 should be cross addressed with I 40.
 
Archived project? Ok il try changing both addresses to 40. Must the code on page 29 be insrted in both master slave? And each M/S station downloaded to each PLC with MPI port?

Thanks.
 
In the siemens link you have above, there are 3 files for download for the examples, a word file, a pdf and an arj.


The arj is a compressed file, very much like a zip file. Download this.

In Simatic Manager, select file. In the drop down you will see archive and retrieve, select retrieve and if the file format it is looking for is zip, change it to arj and go to the directory you saved the arj in.

select the file and it will extract the project, with all the code set up as per the word example.


edit:

In their project, OB1 is identical in each.
 
Last edited:
Looking at it is very similar to what i did besides the mistake of address 40. Do you have any suggestions of a simple program that can switch an input contact on the slave to switch on a output contact on the slave? Does the program have to be downloaded into the master or slave?

Thanks.
 
"program that can switch an input contact on the slave to switch on a output contact on the slave"
Do you really want to switch output on the slave? Or on the master? If you want switch on the slave you must write and download to slave something like this:
A I0.0
= Q0.0
If you want to switch on the master, you must write and download to slave
A I0.0
= Q40.0
And in the master:
A I40.0
= Q0.0
It will be work if you cross-addressed DP I/O area for both PLC's to 40.
 
Thanks for the reply. I tried this and could get the slave to switch on an output coil from the master, but i can not get the master to switch on an output coil on the slave.??

At the moment i have made two seperate projects in step 7 one master one slave. I have configured the slave project with send and recieve two bytes in the configuration tab of DP. The master project has the CPU 314 C-2DP (gsd file) connected to the profibus node in the rack and 2 bytes send recevie in the rack. I have programmed the master and nothing in the slave in OB1. I dont understnd how the master and slave can distinguish the I/O if both PLCs have I124.0.. and Q124.0.
 
The test program need to be in both. Try looking at it like this.

SLAVE :

Input I 0.0 is turned on.

In OB1 it transfers in byte IB0 format into into QB40, therefore Q 40.0 turns on.

MASTER:

Reads I 40.0 (which is IB40 read across the DP from slave address QB40).

In OB1 it transfers IB40 to QB4, and Q 4.0 turns ON.


The other way round.

MASTER :

Input I 0.2 is turned on.

In OB1 it transfers in byte IB0 format into into QB40, therefore Q 40.2 turns on.

SLAVE:

Reads I 40.2 (which is IB40 read across the DP from master address QB40).

In OB1 it transfers IB40 to QB4, and Q 4.2 turns ON.



As long as the I/O lengths etc match then Output on one will be Input on the other.

The driving of the Outgputs can be Inputs of flags.

I would presume Siemens program was a test with switches and lamps on each PLC.
 
al_d said:
I have programmed the master and nothing in the slave in OB1. I dont understnd how the master and slave can distinguish the I/O if both PLCs have I124.0.. and Q124.0.
It isn't difference from the point of view of PLC program between it's own I/O and DP I/O in your case. Only PLC OS knows how to access DP I/O. Master reads slave data and stores it in master I area. Master writes data from it's Q area to slave. Master don't know at which adresses DP I/O data are defined by you in slave! It only knows at which DP address intellectual slave is attached, own I, Q adresses for this slave and I/O table dimensions. It do nothing with data sended to slave I area after sending. It only sends it. It don't know what a slave do with it's data stored in slave's Q area - master reads this data only.
Your mistake is you aren't programmed slave OB1.
 
PeterW is there any chance of uploading my project and for you to see what i have done?
 
Master:

L IB 0 // Master inputs
T QB 40 // Data to slave
L IB 40 // Data from slave
T QB 4 // Master outputs

Slave:

L IB 0 // Slave inputs
T QB 40 // Data to master
L IB 40 // Data from master
T QB 4 // Slave outputs

If you turn on input on master slave output turns on and vice versa.
 

Similar Topics

Does anyone have an example project of the cm ptp ET200 SP HA with 410-5H DCS (PCs7 9.1 SP1) for MODBUS MASTER/SLAVE communication ?
Replies
2
Views
68
Hello, I am trying to create an AOI that will retrive the clock datetime bits from a master plc through a generic message read instruction and...
Replies
2
Views
467
Hello, I know little English, I want to use 4 plc cqm1 as slave (modbus), and hmi delta as master. Unfortunately, I cannot establish rs485...
Replies
3
Views
524
Hello, I am quite new to PLC programming. The master would be a Beijier HMI (iX T12B SC) and the slave a Beijier Nexto (XP340). I have...
Replies
12
Views
3,157
Hello- I would like to know if there is a way to monitor the status of a master connection to the EDS module on Rx3i rack. I have a master...
Replies
0
Views
1,235
Back
Top Bottom