You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old September 3rd, 2007, 06:41 AM   #1
Rafael Guedes
Member
Brazil

Rafael Guedes is offline
 
Join Date: Sep 2007
Location: Rio das Ostras
Posts: 2
Help with Profibus CPU315-2 DP

I'm a newbie on profibus, and I have to send and receive some bits that are on two DBs.
I know how to do this via CP cards using the FC1 and FC2 (DP_SEND and DP_RECV), but this time I have to use the built in DP connection on the CPU, and I could not find any good material to help me on doing this.
What I have to do is to send some physical digital inputs here to a third party PLC, and this last will give me back the signal for my outputs, that's simple stuff, but I can't figure out how to do this...
Thanks
  Reply With Quote
Old September 3rd, 2007, 06:54 AM   #2
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts: 15,745
Hello and welcome to the forum Rafael.

Either the 315-2DP has to be master and the 3rd party device has to be master, or vice-versa. If the 3rd party PLC is not a Siemens, then you have to import the 3rd party PLCs GSD file into the HW Configuration in STEP7.
Then you use the SFC14/15 DPRD_DAT/DPWR_DAT in much the same way you would use DP_RECV/DP_SEND.
__________________
Jesper
NOTICE:
JesperMP has passive-aggressive tendencies, can be impolite and may even use sarcasm !
Also: ᛁᚠ ᚢᚬᚢ ᚴᚬᚾ ᚱᛅᚬᛏ ᚦᛁᛋ ᚦᛅᚾ ᚢᚬᚢ ᚼᚬᚠᛅ ᚴᚬᛁᚾᛅᛏ ᛘᚢ ᚱᛅᛋᛒᛅᚴᛏ
  Reply With Quote
Old September 3rd, 2007, 07:00 AM   #3
Rafael Guedes
Member
Brazil

Rafael Guedes is offline
 
Join Date: Sep 2007
Location: Rio das Ostras
Posts: 2
Thanks for the response,
The only problem I see is usind DP_SEND/DP_RECV, I send a DB containing my Inputs and Outputs Map. With the SFC14 and SFC15 I can only send bytes, am I right? How do I configure these bytes adresses, so I can tell the Third party what the have to look for on the network?
  Reply With Quote
Old September 3rd, 2007, 07:03 AM   #4
Apel
Member
India

Apel is offline
 
Apel's Avatar
 
Join Date: Aug 2007
Location: Singapore
Posts: 98
communicate two PLC CPU

Hi, see this tread from Siemens Site, hope u will find useful,
(Khairul Basar)
**How is an open TCP communication connection established between two S7-300 PN CPUs, and how is data exchanged?
Instructions:
The attached sample program shows how two ST-300 stations with the CPU315-2 PN/DP are connected via the integrated PROFINET interface and how data can be exchanged with the aid of open TCP/IP communication.

( 36 KB )
Fig. 01: Communication between two CPU315-2 PN/DPs via Ethernet

The connection on the PN CPU is not configured in NetPro. The requisite parameters are saved in a user-defined structure (UDT) in a data block. The connection is established in runtime by calling the FB65 ("TCON") function block. Once the connection with the partner station is established, data can be exchanged by means of the FB63 ("TSEND") and FB64 ("TRCV") function blocks. The FB66 ("TDISCON") function block disables the connection again.

Features of communication and of the function blocks for open communication:
  • Communication is connection-oriented, i.e. data transfer does not occur until (and only for as long as) a connection is established with the partner station
  • All the requisite connection settings (e.g. IP address) must be saved in a data block whose structure is specified by the UDT65
  • If a connection has been established, it is monitored by the CPU and, if it is interrupted, reconnection occurs automatically
  • All four function blocks work asynchronously and can last several OB1 cycles
  • TSEND and TRCV can communicate simultaneously via one connection
  • Data blocks up to a size of 1460 bytes can be sent and received
  • The blocks are contained under "Standard Library -> Communication Blocks"
Description of the sample program:
The sample program comprises two separate projects. The projects are separated in terms of the way the connection is established (active/passive). In the description below, the station which establishes the connection actively is called the active station and the station which establishes the connection passively is called the passive station. This designation has nothing to do with transmitting and receiving. Both the active and the passive stations can transmit and receive (including on the same connection).

The connection settings are saved in the DB5 ("CON settings") data block and have been created using the Open Communication Wizard. You can find this wizard and a guide to it in Entry ID 25209116.

The following figure illustrates which parameters are, or have to be, known in the active and passive stations, apart from the unique IP address.
Active stationPassive stationOwn IP address140.140.140.62140.140.140.64

Subnet mask255.255.0.0255.255.0.0Remote IP address140.140.140.64140.140.140.62Local TSAP/port(2000)2001Remote TSAP/port2001(2000)

In this example, the functionality of the T-blocks is encapsulated in an FB with a simple user interface. Here, the FB100 ("my_SEND") is called in the active station, and the FB101 ("my_RECV") is called in the passive station.

How the FB100 ("my_SEND") operates:
The FB100 is called in the OB1 cycle. The calls for the FB65 ("TCON"), FB63 ("TSEND") and FB66 ("TDISCON") can be found in this FB.


Fig. 02
REQ:Communication job starts on receipt of a positive edgeDONE:Signals that a job has been successfully completedHOLD_CON:If this marker is set, disconnection does not occurBUSY:Signals that a job is being processedID:Connection ID (must match the ID in the connection data block)ERROR:Signals that an error has occurred during the processing of an order (precise error codes in the instance data block)LEN:Length of data being sent in bytesSTATUS:Internal status of the FB100CON settings:ANY pointer to the connection data block

A communication job is initiated when the REQ input receives a positive edge, and the data with length LEN is transmitted from the DB6 ("SEND_DATA"). Since communication runs asynchronously, the block is locked internally, i.e. a new job cannot be started until there is no other job running. Via the HOLD_CON input parameter you can indicate whether to maintain the connection with the partner or to disconnect after each transmission.

The ID input parameter must match the connection ID in the "CON settings" data block. The LEN input parameter characterizes the length of data being sent in bytes. At the "CON settings" parameter, a reference is made to the connection parameters in the form of a UDT65 as an ANY pointer (in this example, a reference to DB5 "CON settings").

The output parameters DONE, BUSY, ERROR and STATUS are required for the job evaluation and are only valid in the same cycle. N.B. The output parameters only describe the status of the FB100. You can find further status parameters (TCON, TSEND, TDISCON) in the instance data block for the FB100.

Note:
Since data can only be transmitted while there is a connection in place, the partner may receive incomplete data, and thus an invalid frame, if disconnection occurs immediately after transmission. Therefore, we would advise you to set the HOLD_CON parameter to "true", in general, when calling the FB100.

Pn_cpu_a.zip ( 341 KB )

The STEP 7 project contains an executable sample program for calling the FB100, as well as the FB100 with all the sub-blocks. It has been created with STEP 7 V5.4.

How the FB101 ("my_RECV") operates:
The FB101 is called in the OB1 cycle. The calls for the FB65 ("TCON"), FB64 ("TRCV") and FB66 ("TDISCON") can be found in this FB.


Fig. 03 EN_Rata can be received if "true" is setNDR:Signals that a new data record has been receivedHOLD_CON:If this marker is set, disconnection does not occurERROR:Signals that an error has occurred during the processing of an order (precise error codes in the instance data block)ID:Connection ID (must match the ID in the connection data block)STATUS:Internal status of the FB100LEN:Length of data due to be received in bytesRCVD_LEN:Length of data received in bytesCON settings:ANY pointer to the connection data block

If an input EN_R is set (true), the communication blocks are called and data is received. The received data is saved in DB7 ("RECV_DATA"). If EN_R is not set (false), communication is interrupted. Re-initialization occurs the next time a positive edge is received. Via the HOLD_CON input parameter you can indicate whether to maintain the connection with the partner or to disconnect after receiving each communication.

The ID input parameter must match the connection ID in the "CON settings" data block. The LEN input parameter characterizes the length of data being received in bytes. At the "CON settings" parameter, a reference is made to the connection parameters in the form of a UDT65 as an ANY pointer (in this example, a reference to DB5 "CON settings").

The output parameters DONE, ERROR and STATUS are required for the job evaluation and are only valid in the same cycle. N.B. The output parameters only describe the status of the FB101. You can find further status parameters (TCON, TRECV, TDISCON) in the instance data block for the FB101.

Pn_cpu_p.zip ( 335 KB )

The STEP 7 project contains an executable sample program for calling the FB101, as well as the FB101 with all the sub-blocks. It has been created with STEP 7 V5.4.

Commissioning the active and passive stations:
No.Procedure1Load the file "Pn_cpu_a.zip" or "Pn_cpu_p.zip" onto your PC.

2Extract the archive with STEP 7.

3If you wish to change the PC's IP address or subnet mask, you have to do this in the HWCONFIG as well as in the connection specification. In the event of a change in the connection specification, you are advised to generate a new UDT (using the Open Communication Wizard, Entry ID 25209116). You can then also recreate the connection data block (in this case, DB5 "CON settings").

4Load the project into the station.5Start to establish the connection by activating the FB100 and FB101 blocks via the M120.0 ("Control" variables table).
__________________
Best Questions are asked for Best Solutions.Beehive AutomationFinding best for best product
  Reply With Quote
Old September 3rd, 2007, 07:21 AM   #5
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts: 15,745
@Rafael.
It works the same way. Both with DP_SEND/DP_RECV and DRWR_DAT/DPRD_DAT the data is specified as an ANY pointer.
If you have the data defined symbolically in a DB, you can pass it as a symbol. If you switch symbolic display off, you can see that the ANY pointer is really a combination of start address and how many bytes to transfer.

@Apel.
You seem to have missed that there is only the DP port available, no PN port.
__________________
Jesper
NOTICE:
JesperMP has passive-aggressive tendencies, can be impolite and may even use sarcasm !
Also: ᛁᚠ ᚢᚬᚢ ᚴᚬᚾ ᚱᛅᚬᛏ ᚦᛁᛋ ᚦᛅᚾ ᚢᚬᚢ ᚼᚬᚠᛅ ᚴᚬᛁᚾᛅᛏ ᛘᚢ ᚱᛅᛋᛒᛅᚴᛏ
  Reply With Quote
Old September 3rd, 2007, 07:44 AM   #6
Apel
Member
India

Apel is offline
 
Apel's Avatar
 
Join Date: Aug 2007
Location: Singapore
Posts: 98
try this:
http://support.automation.siemens.co...iew/en/1254686
__________________
Best Questions are asked for Best Solutions.Beehive AutomationFinding best for best product
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Profibus DP communication between two PLCs (315-2 DP) PawelStrzelecki LIVE PLC Questions And Answers 16 July 31st, 2007 05:10 PM
SIEMENS PROFIBUS DP Networking sherman4 LIVE PLC Questions And Answers 1 July 21st, 2005 10:09 AM
first :siemens profibus dp radar tank secound: ethernet!!! mansoreh LIVE PLC Questions And Answers 3 September 4th, 2004 12:57 PM
profibus DP comm.problem apesky LIVE PLC Questions And Answers 4 May 7th, 2004 04:56 AM
S7 Profibus DP configuration Peter Nachtwey LIVE PLC Questions And Answers 10 February 24th, 2004 11:01 AM


All times are GMT -4. The time now is 12:53 AM.


.