Sei sulla pagina 1di 41

SIMATIC NET Quick Start

About this Document

This document provides you with information on the samples of Profibus communication between a SIMATIC S7 station and a SIMATIC S5 station using the FDL service (Fieldbus Data Link) with free layer 2 access. For a brief overview of this sample, refer to Chapter 2. For detailed information, refer to Chapter 3 and the chapters following. The document covers the following topics:
    

System structure Introduction to the required blocks and their communication structure Program structures and extracts of code Operator control and monitoring Troubleshooting

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Overview of the Sample

Schematic of the System


S7-300 Station S7 135 Station

MPI interface

Local Profibus network

PG interface on CPU and CP

as

PG/PC with STEP 7/STEP 5/NCM

Checking the Functionality of the Sample


The variable table of the active S7 station allows you to determine if the sample is functioning correctly. The variable table is contained in the Blocks folder of the STEP 7 project. Data being sent and received has continuously changing values (see also "Operator Control and Monitoring").

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Function Diagram
The following diagram illustrates how the sample works:

SIMATIC S7-300 Station

SIMATIC S5 Station

Run startup Prepare data for sending Send data (2 bytes of user data) Receive data and copy it to the send buffer

Send data (2 bytes of user data)

Save received data

Data Exchange
6 bytes of data are exchanged cyclically by the stations involved in communication. These consist of 4 bytes of header to specify the partner station and 2 bytes of user data.

S7/S5 Partner
The S7 partner initiates connection establishment and the sending of new data. The S5 partner returns the received data to the S7 end. Return means that received data is sent back to the S7 end after it has been completely received.

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Program

S7 End

S5 End
STARTUP

FB125 FB111

OB20/ OB21/ OB22

OB1
MY_SEND_CALL

FC AG_SEND

RECEIVE REC<-SDA

FC5 FC40 OB1


FC AG_RECV MY_RECEIVE_CALL

FB121 FB41 OB1


SEND SEND>SDA

FC6 FC41

FB120 FB40

Description of the S7 end:





Description of the S5 end:


 

An "AG_SEND" FC is called every cycle to send 2 bytes of user data. Parallel to the send job an "AG_RECV" FC is called to fetch received data from the CP. The data is saved once it has been completely received. Once the RECEIVE job has been processed without error, the data to send is incremented by 1 and the send/receive cycle begins again.

A "RECEIVE" FB is triggered in every cycle. When the "RECEIVE" FB signals newly received data, the "SEND" FB is triggered with the newly received data to send the received data back.

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Operator Control and Monitoring


An operator control and monitoring function is available using the supplied variable table. The following conditions must be met to allow you to use the "Monitoring and Modifying Variables" program:
  

There must be an online connection to the CPU. "Monitor variables" must be activated. The values to be modified must be marked as valid.

If the conditions listed above are met, you can determine whether the sample is functioning correctly by observing that the data sent and received from the active (S7) station is changing continuously.

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

System Structure
This chapter lists the hardware and software required to run the sample.

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Note Scope of Application of this Document The content of this document assumes a specific configuration. This documentation can, however, be used for all FDL samples of communication between a SIMATIC S7 PLC and SIMATIC S5 stations.

General Structure
Bus system Communications protocol Active end Passive end Communications processors Services PROFIBUS SDA (Send Data with Acknowledge) SIMATIC S7 SIMATIC S5 CP 342-5,CP 5431 FDL (free layer 2 access)

The sample uses the FDL protocol. Using this protocol and the SDA services, there is a data exchange between a SIMATIC S7 station and a a SIMATIC S5 station. As communications processors, a CP 342-5 is used at the active SIMATIC S7-300 end and a CP 5431 at the passive SIMATIC S5 end.

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Hardware Required for the Active End

location 1 2 4

Module PS307 10A CPU314 CP 342-5

Order Number 6ES7 307-1KA00-0AA0 6ES7 314-1AE02-0AB0 6GK7 342-5DA00-0XE0

Hardware Required for the Passive (S5) End

Slot 1 2

Module S5-135U/155U (CPU 928) CP 5431

Order Number 6ES5 928-3UA12 6GK1543-1AA01

Suitability for other Hardware Configurations

Caution The samples relate to specific hardware configurations. These must exist to ensure problem-free operation. If you want to use a different configuration, adaptations will be necessary.

Note Using a different CPU If you want to use a different CPU for the sample, please read the document "Change_CPU".

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Note Using a different CP If you want to use a different CP for the sample, please read the document "Change_CP".

Cables and Other Hardware Required

MPI cable PROFIBUS Cable 2 Profibus connectors PG or PC with MPI port

Required Software
You require the following software to run the sample:
    

Microsoft Windows 95, Windows 98 or Windows NT 4.0 as the operating system STEP 7 V5.03 NCM S7 Profibus V5.03 STEP 5 V6.65 COM 5431 V

Profibus Communication: S7-CP342-5 S5-CP5431

SIMATIC NET Quick Start

Introduction to the Required Blocks and their Communication Structure


This chapter covers the following topics:
 

How the sample works Blocks required for communication and their communication structure

Profibus Communication: S7-CP342-5 S5-CP5431

10

SIMATIC NET Quick Start

4.1 How the Sample Works


Data Exchange
Two bytes of user data is exchanged cyclically via Profibus between the stations involved in communication. Here, we are using the FDL (SDA) service of the free layer 2 access.

Active / Passive End


The initiative for sending data is taken by the active SIMATIC S7 PLC. When it receives a data field, the passive SIMATIC S5 end sends it back to the active SIMATIC S7 end. Profibus is used as the network medium.

Step-by-Step Execution of the User Program at the Active End (SIMATIC S7)


Specify the DESTINATION: The destination of the data to be sent is specified for every send job in the user program with a 4 byte long job header, since the FDL service is used with free layer 2 access. SEND: A data block of 2 bytes is sent to the passive partner in every cycle. RECEIVE: A receive job is triggered in every cycle and, depending on the return value, the received data is written to the receive buffer. The received data contain a 4 byte long job header to specify the sender. Increment data: The value of the data to be sent is incremented by 1 and the send/receive cycle starts again.

 

Step-by-Step Execution of the User Program at the Passive End (SIMATIC S5)


SEND: A receive job is triggered at the passive end every cycle. When new data are received, these are entered in the common receive/send buffer and the SEND is triggered. RECEIVE: A send job is triggered when new data is received.

Profibus Communication: S7-CP342-5 S5-CP5431

11

SIMATIC NET Quick Start

4.2 Blocks Required for Communication and their Communication Structure


This chapter provides a detailed description of the AG_SEND and AG_RECV and the FB SEND and FB RECEIVE required for SEND / RECEIVE communication.

Profibus Communication: S7-CP342-5 S5-CP5431

12

SIMATIC NET Quick Start

4.2.1 S7 Function AG_SEND (FC5)

Purpose of the Block


The AG_SEND function (FC) transfers data from the specified send buffer of the Simatic S7 to the programmed partner station. The send buffer pointer can point to a process image area, a bit memory area, or a data block area. The connection ID is generated by the configuration software when an "unspecified FDL connection" is configured. The Profibus address and SAP no. of the partner must be specified in the user program using a 4-byte job header. This specifies the destination of the send job. The block parameters are described in detail in Chapter 5.

4.2.2 S5 Function SEND (FB120)

Purpose of the Block


The function block transfers data from the specified send area of the SIMATIC S5 to the partner station. The send buffer pointer can point to a process image area, a bit memory area, or a data block area. The job number used is generated by the NCM configuration software when an "FDL connection" is configured. The Profibus address and SAP no. of the partner must be specified in the user program using an 8-byte job header. This specifies the destination of the send job. The block parameters are described in detail in Chapter 5.

Profibus Communication: S7-CP342-5 S5-CP5431

13

SIMATIC NET Quick Start

4.2.3 S7 Function AG_RECV (FC6)

Purpose of the Block


The AG_RECV function sends the data received from the specified partner station to the specified receive buffer of the Simatic S7. The receive buffer can point to a process image area, a memory bit area or a data block area. The receive buffer must be at least as long as the longest data field that can be expected. The connection ID is generated by the configuration software when an "unspecified FDL connection" is configured. The address and SAP no. of the partner station is supplied with the data in a 4-byte job header. The block parameters are described in detail in Chapter 5.

4.2.4 S5 Function RECEIVE (FB121)

Purpose of the Block


The function block receives the data sent by the partner station. The receive area pointer can point to a process image area, a bit memory area, or a data block area. The job number used is generated by the NCM configuration software when an "FDL connection" is configured. The Profibus address and SAP no. of the partner is indicated in an 8-byte job header. This is a reference to the source of the received data.

The block parameters are described in detail in Chapter 5.

Profibus Communication: S7-CP342-5 S5-CP5431

14

SIMATIC NET Quick Start

Program Structures and Extracts of Code

This chapter introduces you to the structure of the program for both the active and passive ends and important sections of code are shown and explained.

Profibus Communication: S7-CP342-5 S5-CP5431

15

SIMATIC NET Quick Start

5.1 Program Structure of the Active Partner


Program/cycle start

Fill send job header

Call AG_SEND

Error occurred with AG_SEND?

Yes

No

Save error number

Call AG_RECV

Error occurred with AG_RECV?

Yes

No AG_RECV job complete? No

Yes

Received data header : Partner addr = Yes

No Save error number

Increment variable value

Profibus Communication: S7-CP342-5 S5-CP5431

16

SIMATIC NET Quick Start

5.2 Extracts of Code for the Active Partner


5.2.1 Active End: Symbols

Symbol Table Used for the Send / Receive Samples

Use of Symbolic Constants


Through the use of symbolic constants, the code is more readable and it is easier to make program changes. Example: Instead of "MW42" you then see "SEND_STATUS" in the code. If you want to use the variable "MW 42" instead of "MW44", you simply need to modify the symbol table. You do not need to make changes in the actual program.

Profibus Communication: S7-CP342-5 S5-CP5431

17

SIMATIC NET Quick Start

5.2.2 Active End: OB1

Purpose
OB1 is responsible for cyclic execution of the user program. In this sample program, the blocks that implement the send / receive functionality (AG_SEND and AG_RECV) are called.

Call
OB1 is called in every CPU cycle.

Name
OB1

Code
// // example for send/receive with 2 bytes of data // CALL MY_SEND_CALL" // CALL MY_RECEIVE_CALL" //

Description
OB1 calls the blocks named "MY_SEND_CALL" (call AG_SEND) and "MY_RECEIVE_CALL" (call FC AG_RECV) in every cycle.

Profibus Communication: S7-CP342-5 S5-CP5431

18

SIMATIC NET Quick Start

5.2.3 Active End: AG_SEND Job

Purpose
Two bytes of data are sent to the configured partner using the Send / Receive service AG_SEND.

Call
Called within OB1.

Name
MY_SEND_CALL (FC40)

Code
// L 4 // job header: PB address of destination station T DB40.DBB 2 L 3 // job header: LSAP of destination station T DB40.DBB 3 L B#16#0 //job header: Service (SDA = 00h) T DB40.DBB4 // CALL "AG_SEND" ACT := TRUE ID := 1 LADDR := W#16#100 SEND := P#DB40.DBX2.0 BYTE 6 LEN := 6 DONE := SEND_DONE" ERROR := SEND_ERROR" STATUS := SEND_STATUS" // AN "SEND_ERROR" BEC // L "SEND_STATUS" T "PARAMETER_ERROR_DB".send_error_status

Profibus Communication: S7-CP342-5 S5-CP5431

19

SIMATIC NET Quick Start

Meaning of the Parameters for FC "AG_SEND"


 

ACT: Edge signal for executing the block. ID: This identifier identifies the S/R connection (obtained with "CPU -> Connections"). LADDR: This parameter provides the address of the local CP (assigned in "HW Config" and can also be read out using "Netpro") SEND: Address of a local data area from which values are sent (send area). LEN: Length of the data area to be sent. DONE: Indicates error-free execution of the job. ERROR: Indicates whether or not an error has occurred. STATUS: Provides detailed information about states or errors during execution of the job.

    

Assignment of the Send Area:


PB Address Service Data byte 0 LSAP unused Data byte 1 Byte 0,1 Byte 2,3 Byte 4,5 Job header

Description
CALL "AG_SEND": The "Send data" FC is called. Depending on the "SEND_ERROR" bit, the status word is saved or the function is exited using a conditional block end (BEC).

Summary
The job header of the send job is filled to specify the destination station for the data to be sent. The actual user data transferred start in byte 4 of the send area. The send block is triggered in every cycle to send data from the send buffer (DB40). When an error occurs during sending, the returned status value is saved in a data block (DB43).

Profibus Communication: S7-CP342-5 S5-CP5431

20

SIMATIC NET Quick Start

5.2.4 Active End: AG_RECV Job

Purpose
Using FC AG_RECV, 2 bytes of data received from the partner are entered in the specified receive area.

Call
Called within OB1.

Name
MY_RECEIVE_CALL (FC41)

Code
// CALL "AG_RECV" ID := 1 // connection ID LADDR := W#16#100 // logic module address SEND := P#DB41.DBX2.0 BYTE 6 // ANY pointer to receive buffer NDR := RECV_NDR" DONE := RECV_DONE" ERROR := RECV_ERROR" STATUS := RECV_STATUS" // current function status LEN := RECV_BUFFERLENGTH" // A "RECV_ERROR" // if function error, jump JC err // L "RECV_BUFFERLENGTH" // save length of receive data T "RECV_DB".receive_bufferlength // A RECV_NDR" // receive new data? FP EDGE_MEMORY" JCN m001 // L DB41.DBB2 // if partner address = 4, go on L 4 ==I JCN m001 // L SEND_DB".send_data[0] // increment send data + 1 T SEND_DB".send_data[0] M001: BE // err: L RECV_STATUS" // save current (error) T PARAMETER_ERROR_DB".receive_error_status

Profibus Communication: S7-CP342-5 S5-CP5431

21

SIMATIC NET Quick Start

Meaning of the Parameters of FC AG_RECV"




ID: This identifier identifies the S/R connection (obtained with "CPU -> Connections"). LADDR: This parameter provides the address of the local CP (assigned in "HW Config" and can also be read out using "Netpro") RECV: Address of a local data area from which the values are transferred. NDR: Indicates error-free execution of the job. ERROR: Indicates whether or not an error has occurred. STATUS: Provides detailed information about states or errors during execution of the job. LEN: Length of the data area to be sent.

    

Description
CALL "AG_RECV": The FC for data reception is called. The status value is saved depending on the "RECV_ERROR" bit. Otherwise, the received data length is accepted and the data word incremented if the data was received correctly (new send data prepared).

Summary
The receive block is triggered in every cycle to receive data and write it to the receive buffer (DB41). When an error occurs during sending, the returned status value is saved in a data block (DB43). If data is received correctly from the defined partner station (PB addr = 4), the data is incremented.

Profibus Communication: S7-CP342-5 S5-CP5431

22

SIMATIC NET Quick Start

5.3 Program Structure for the Passive Partner

Program/cycle start

Call RECEIVE

Yes

Error occurred with AG RECV?

No Set send bit

Yes
Copy I/O data

Call SEND

Error occurred with AG SEND?

Yes

No No Reset send bit


Repeat SEND

Profibus Communication: S7-CP342-5 S5-CP5431

23

SIMATIC NET Quick Start

5.4 Extracts of Code for the SIMATIC S5 Passive Partner


5.4.1 Passive End: OB1

Purpose
OB1 is responsible for cyclic execution of the user program. The following sample program calls the blocks for executing the functions SEND and RECEIVE.

Call
OB1 is called in every CPU cycle.

Name
OB1

Code
:JU FB 41 Name :REC<-SDA : :JU FB 40 Name :SEND>SDA : :BE call receive-function call send function

Description
OB1 calls the block with the name REC<-SDA and SEND>SDA in each CPU cycle.

Profibus Communication: S7-CP342-5 S5-CP5431

24

SIMATIC NET Quick Start

5.4.2 Passive End: OB20-OB22

Purpose
OB20-OB22 are intended for programming with the various possible PLC startup types.

Call
The blocks OB20 to OB22 are called depending on the type of startup, for example, warm or cold restart. The calls in the example are identical for all three types of startup.

Name
OB20 / OB21 / OB22

Code
OB 20 :JU FB 111 Name :STARTUP ERR : F 200.0 : :BE synchron for CP 5431 synchron error for CP 5431

Description
OB20 calls the "STARTUP" FB during startup to initialize communication.

Profibus Communication: S7-CP342-5 S5-CP5431

25

SIMATIC NET Quick Start

5.4.3 Passive End: FB111

Purpose
FB111 initializes the communications processor.

Call
FB111 is called during startup by one of the OBs OB20 to OB22.

Name
FB111

Code
: :JU FB 125 Name :SYNCHRON SSNR : BLGR : PAFE : : :A := : :BE F 255.0 PAFE error ? KY 0,0 KY 0,6 FY 255 SSNR - CP5431

=ERR

Description
In "STARTUP" FB 111, the function block FB125 is called to initialize the communications processor.

Profibus Communication: S7-CP342-5 S5-CP5431

26

SIMATIC NET Quick Start

5.4.4 Passive End: SEND Job

Purpose
Using FB SEND, 2 bytes of data are sent to the configured partner.

Call
Called within OB1.

Name
FB40

Code
Name :SEND>SDA :A F 45.7 :JU FB 120 Name : SEND SSNR : KY A-NR : KY ANZW : FW QTYP : KS DBNR : KY QANF : KF QLAE : KF PAFE : FY 0,0 0,134 56 DB 0,40 +1 +5 54 : :A F :AN F := F : :A F := F : :A F : :AN F :R F : :BE send to remote-station 2 bytes "call-send-bit"

job number (ncm5431) send send send send 57.2 55.0 55.1 57.2 55.0 55.1 54.0 45.7 edge flag "data transfer completed" no pafe by send reset "call-send-bit" buffer buffer buffer length type is db is db40 offset is dw1 (5 words/10 bytes)

anzw "job complete without err" edge flag "data transfer completed"

Profibus Communication: S7-CP342-5 S5-CP5431

27

SIMATIC NET Quick Start

Meaning of the Parameters of the "SEND" FB (FB120)


       

SSNR: Interface number of CP. A-NR: The job number identifies the S/R connection of the CP. ANZW: Display word QTYP: Type of buffer area. DBNR: The DB number for data blocks. QANF: Offset within the buffer area. QLAE: Length of the area to send in WORD. PAFE: Error byte of the block.

Description
FB "SEND" is called. Depending on the "Data_transfer" and "PAFE" bytes, the send bit is reset and the block is closed.

Summary
The send block is triggered in every cycle to transfer data.

Profibus Communication: S7-CP342-5 S5-CP5431

28

SIMATIC NET Quick Start

5.4.5 Passive End: RECEIVE Job

Purpose
Using FB RECEIVE, 2 bytes of data received from the partner are accepted.

Call
Called within OB1.

Name
FB41

Code
FB41 Name :REC<-SDA :O F 0.0 :ON F 0.0 :JU FB 121 :RECEIVE : KY 0,0 : KY 0,134 : FW 46 : KS DB : KY 0,41 : KF +1 : KF -1 : FY 44 : :A F 47.2 :AN F 45.0 := F 45.1 :A F 47.2 := F 45.0 : :A F 45.1 :AN F 44.0 :S F 45.7 : :C DB 41 :L DW 5 :C DB 40 :T DW 5 : :BE receive data from remote-station call receive data job number (ncm5431) receive buffer type is db dB number is 41 receive buffer offset is dw1 receivel ength is joker anzw "job complete without err" edge flag "data acceptance complete"

Name SSNR A-NR ANZW ZTYP DBNR ZANF ZLAE PAFE

edge flag "data acceptance complete" no pafe error set "call send bit" data transfer receive to send

Profibus Communication: S7-CP342-5 S5-CP5431

29

SIMATIC NET Quick Start

Meaning of the Parameters of FB "RECEIVE"


 

SSNR: Interface number of CP. A-NR: This parameter shows the job number for the connection of the local communication CP. ANZW: Display word ZTYP: ID for type of receive buffer. DBNR: Number of the data block. ZANF: Offset of the receive buffer. ZLAE: Length of the data area to send. If "1" is set, the length of the data is obtained when the data is received. PAFE: Process image error in executing the receive block.

    

Description
FB "RECEIVE" is called. When the "receive end" bit "PAFE" bits have been successfully passed the block is closed and the send job bit is set.

Summary
The receive block is triggered in every cycle to receive data and, after successful reception, to trigger the send job.

Profibus Communication: S7-CP342-5 S5-CP5431

30

SIMATIC NET Quick Start

Operator Control and Monitoring

This chapter covers the following topics:


 

Monitoring Variables at the SIMATIC S7 End Operation at the SIMATIC S7 End

Profibus Communication: S7-CP342-5 S5-CP5431

31

SIMATIC NET Quick Start

6.1 Operator Control and Monitoring

Note If problems occur during operator control and monitoring, please read Chapter 7, Troubleshooting.

Monitoring
You can monitor the functions using the variable table provided with the sample. The following table explains how to use the variable table.

Step 1 2 3 4 5

Description Insert this end of the MPI cable in the MPI port of the S7 CPU in the active station Select "Blocks" in the project window of the SIMATIC Manager under the active station. Double-click "VAT1". In the "Monitoring and Modifying Variables" program, select "PLC" >"Connect to " -> "Configured CPU" To monitor the specified variables, select "Variable" -> "Monitor"

Note The monitor function is active when "Online" is displayed in the status bar in the "Monitoring and Modifying Variables" program and you can see a continuously changing progress bar.

Profibus Communication: S7-CP342-5 S5-CP5431

32

SIMATIC NET Quick Start

Display when Monitoring


When you have completed the steps listed above, you will see the following variable table (other values are possible!):

Explanation of the Parameters


SEND Parameters In the upper part, "SEND", you can see the parameters of the AG_SEND Send/Receive service. If the sample is functioning correctly: Amongst other things, the parameter "SEND_DONE" (AG_SEND job complete) should change its state constantly from "0" -> "1" and back again. RECEIVE Parameters In the lower part, "RECEIVE", you should observe the same for the AG_LRECV service. If the sample is functioning correctly: Amongst other things, the parameter "RECV_NDR" (receive data) should change its state continuously from "0" -> "1" and back again. If the error output is set, you will see the status messages of the blocks in "last error in program". If the sample is working correctly: Due to the update cycle of the variable table, the written and read data should be different. If the sample is functioning correctly, the data should be continuously changing!

Profibus Communication: S7-CP342-5 S5-CP5431

33

SIMATIC NET Quick Start

Note The sample is functioning correctly when the value of the data read and written changes continuously. Don't forget! The variable table must be online and monitoring must be active for the values to be updated.

Operator Control
You can call the functions using the variable table provided with the sample. How to start and activate it was described above.

Note To call up the functions, the variable table must be "Online" and "Monitor" must be active so that the values can be updated (see above).

The following table shows you how to change the value of the data sent to (and then read by) the passive end.

Step 1 2

Description Enter a value between 0 and 32767 in the last column ("Modify Value") of the line "MW 52" "SEND_DATA" in the variable table. Select "Variable" -> "Activate Modify Value"

Correct function: If the value has been successfully modified, the value read should also return a new value.

Profibus Communication: S7-CP342-5 S5-CP5431

34

SIMATIC NET Quick Start

Exiting Operator Control and Monitoring


Step 1 2 Description In the "Monitoring and Modifying Variables" program select "Table" -> "Exit" Click the "No" button in the subsequent dialog.

Profibus Communication: S7-CP342-5 S5-CP5431

35

SIMATIC NET Quick Start

Troubleshooting
This chapter is intended to help you if you encounter problems installing and starting up the sample.

Profibus Communication: S7-CP342-5 S5-CP5431

36

SIMATIC NET Quick Start

Problems Downloading the Hardware Configuration, the Connection, or the Blocks


Run the following checks. If your answer is "NO" to a question, go straight to the corresponding steps in "Remedies".

Step 1 2

Description Is the MPI cable connected to both the PG/PC and the S7 CPU? In the "Set PG/PC Interface" program is the correct interface parameter set assigned to the "Access point of application" "S7ONLINE (STEP 7)"? For example,"MPI-ISA on board (MPI)" if you are using the PG-MPI port. Is the hardware configuration in the project (offline configuration) identical in every way with the actual configuration (online configuration)? Has the CPU been reset?

3 4

Remedies
Correct the problem by working through the steps below if your answer was no to one of the questions above.

Answer to Step 1 was "NO" No connection can be established to the S7 CPU, it is not possible to download to the CPU.

Step 1 2

Description Insert one end of the MPI cable in the MPI port on your PG or PC. Insert the other end of the MPI cable in the MPI port of your S7 CPU.

Profibus Communication: S7-CP342-5 S5-CP5431

37

SIMATIC NET Quick Start

Answer to Step 2 was "NO" No connection can be established to the S7 CPU, it is not possible to download to the CPU.

Step 1 2

Description Start the "Set PG/PC Interface" program: "Start" -> "Simatic" -> "SIMATIC NET" -> "Set PG/PC Interface". Set the module you want to use as the MPI port in "Interface parameter set used". For example, "MPI-ISA on board (MPI)" if you are using the PG-MPI port. Click the "OK" button.

Your answer to step 3 was "NO"

Step 1

Description Adapt the actual hardware configuration to that of the project or read the documentation "Change_CPU" or "Change_CP" if you want to use a different CPU or CP than the one used in the sample.

Your answer to step 4 was "NO"

Step 1 Reset the CPU.

Description

Profibus Communication: S7-CP342-5 S5-CP5431

38

SIMATIC NET Quick Start

Variable Table: Written and read data do not change.


Run the following checks. If your answer is "NO" to a question, go straight to the corresponding steps in "Remedies".

Step 1 2 3

Description Is the Profibus cable connected to both the active and passive stations? Can you see "Online" in the status bar of the variable table? Can you see a continuously changing progress bar in the status bar?

Remedies
Correct the problem by working through the steps below if your answer was no to one of the questions above.

The answer to step 1 was "NO" No connection can be established between the stations and data exchange is not possible.

Step 1 2

Description Connect the end of the PROFIBUS cable to the CP port of the station. Repeat step 1 for the passive station.

Profibus Communication: S7-CP342-5 S5-CP5431

39

SIMATIC NET Quick Start

Your answer to Step 2 was "NO" No connection was established to the S7 CPU and monitoring was not possible.

Step 1

Description In the program "Monitoring and Modifying Variables", select "PLC" -> "Connect To" -> "Configured CPU".

Your answer to step 3 was "NO" The monitoring function is not activated.

Step 1

Description In the "Monitoring and Modifying Variables" program, select "Variable" -> "Monitor".

Profibus Communication: S7-CP342-5 S5-CP5431

40

SIMATIC NET Quick Start

Variable Table: Operator control is not working.


Run the following checks. If your answer is "NO" to a question, go straight to the corresponding steps in "Remedies".

Step 1 2

Description Have you activated "Variable" -> "Modify Value Valid" in the "Monitoring and Modifying Variables" program? Is the value you entered for memory word 52 (MW52) between 0 and 32767?

Remedies
Correct the problem by working through the steps below if your answer was no to one of the questions above.

Your answer to step 1 was "NO"

Step 1

Description Select "Variable" -> "Modify Value Valid" in the "Monitoring and Modifying

Variables" program.

Your answer to step 2 was "NO"

Step 1

Description Enter a value between 0 and 32767 in the last column ("Modify Value") of the line "MW 52" "SEND_DATA" in the variable table.

Note If you do not find the solution to your problem in this chapter, reinstall the sample.

Profibus Communication: S7-CP342-5 S5-CP5431

41

Potrebbero piacerti anche