pb_fdl_s7_s5

40
6,0$7,&1(74XLFN6WDUW Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431 1 $ERXWWKLV'RFXPHQW This document contains information on the samples for Profibus communication between an S7 station and a SIMATIC S5 station using the FDL (Fieldbus Data Link) service. )RUDEULHIRYHUYLHZRIWKLVVDPSOHUHIHUWR&KDSWHU )RUGHWDLOHGLQIRUPDWLRQUHIHUWR&KDSWHUDQGWKHFKDSWHUV IROORZLQJ 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

Upload: luisht79

Post on 06-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 1/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

1

$ERXWWKLV'RFXPHQW

This document contains information on the samples for Profibus communicationbetween an S7 station and a SIMATIC S5 station using the FDL (Fieldbus DataLink) service.

)RUDEULHIRYHUYLHZRIWKLVVDPSOHUHIHUWR&KDSWHU

)RUGHWDLOHGLQIRUPDWLRQUHIHUWR&KDSWHUDQGWKHFKDSWHUV

IROORZLQJ

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

Page 2: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 2/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

2

2YHUYLHZRIWKH6DPSOH

6FKHPDWLFRIWKH6\VWHP

&KHFNLQJWKH)XQFWLRQDOLW\RIWKH6DPSOH

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

PG/PC with

STEP 7/STEP 5/NCM

as

H Q D Ã  

Q B à v r s h p r à  

8 Q V à h q à 8 Q  

66WDWLRQ S7 135 Station

Local Profibus

network

Page 3: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 3/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

3

)XQFWLRQ'LDJUDP

The following diagram illustrates how the sample works:

'DWD([FKDQJH

2 bytes of data are exchanged cyclically by the stations involved in communication.

663DUWQHU 

The S7 partner initiates connection establishment and the sending of new data. TheS5 partner returns the received data to the S7 end. Return means that received data issent back to the S7 end after it has been completely received.

3UHSDUHGDWD

IRUVHQGLQJ

6DYHUHFHLYHG

GDWD

Receive data and copy

it to the send buffer

Send data (2 bytes)

Send data (2 bytes)

SIMATIC S7-400 Station SIMATIC S5 Station

Page 4: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 4/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

4

3URJUDP

'HVFULSWLRQRIWKH6HQG

•  An "AG_SEND" FC is called every cycle tosend 2 bytes of data.

• Parallel to the send job, an "AG_RECV" FC iscalled to fetch received data from the CP.The data is saved once it has beencompletely received.

• Once the RECEIVE job has been processedwithout error, the data to send is incrementedby 1 and the send/receive cycle begins again.

'HVFULSWLRQRIWKH6HQG•  An FB “RECEIVE” is triggered in every

cycle.

• If the "FB RECEIVE" signals newlyreceived data, an FB “SEND" is triggeredwith the newly received data to send thereceived data back.

OB1

FC-AG_RECV

FC-AG_SEND

MY_RECEIVE_CALL

MY_SEND_CALL

OB1

FC40

FC41

S5 EndS7 End

SEND-T2

CALL

FB RECEIVE

FB SEND

FB41

OB1

REC-T2

FC5

FC6 FB120

FB121

Page 5: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 5/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

5

2SHUDWRU&RQWURODQG0RQLWRULQJ

An operator control and monitoring function is available using the supplied variabletable.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 VDPSOHLVIXQFWLRQLQJFRUUHFWO\ by observing that the data sent and received from the activestation is FKDQJLQJFRQWLQXRXVO\.

Page 6: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 6/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

6

6\VWHP6WUXFWXUH

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

Page 7: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 7/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

7

1RWH

6FRSHRI$SSOLFDWLRQRIWKLV'RFXPHQW

The content of this document assumes a specific configuration.This documentation can, however, be used for all FDL samples of communicationbetween a SIMATIC S7 and a SIMATIC S5 station.

! &DXWLRQ

The samples relate to specific hardware configurations. These must exist toensure problem-free operation.If you want to use a different configuration, you must make modifications (refer tothe notes below).

*HQHUDO6WUXFWXUH

Bus system PROFIBUS

Communications protocol SDA (Send Data with Acknowledge)

Active End SIMATIC S7

Passive End SIMATIC S5

Communications processors CP 443-5,CP 5431

Services FDL

The sample uses the FDL protocol. Using this protocol and the SDA services, thereis a data exchange between a SIMATIC S7 station and a a SIMATIC S5 station.A CP 443-5 Basic is used as the communication processor in the active SIMATICS7-400 .A CP 5431 is used at the passive SIMATIC S5 end.

Page 8: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 8/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

8

+DUGZDUH5HTXLUHGIRUWKH$FWLYH(QG

ORFDWLRQ 0RGXOH1 PS407 10A

2 CPU 414-1

3 CP 443-5

1RWH

8VLQJDGLIIHUHQW&38If you want to use a different CPU for the sample, please read the document"Change_CPU".

1RWH

8VLQJDGLIIHUHQW&3If you want to use a different CP for the sample, please read the document"Change_CP".

+DUGZDUH5HTXLUHGIRUWKH3DVVLYH6(QG

6ORW 0RGXOH

1 CPU

2 CP 5431

3 Power supply

4 Rack

Page 9: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 9/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

9

&DEOHVDQG2WKHU+DUGZDUH5HTXLUHG

MPI cable

PROFIBUS Cable

2 Profibus connectors

PG or PC with MPI port

5HTXLUHG6RIWZDUH

You require the following software to run the sample:

• Microsoft Windows 95 or Windows NT 4.0 as the operating system

• STEP 7 V4.02 (See also "1RWH")

• NCM S7 PROFIBUS V4.02 + Service Pack 1

• STEP 5 V6.65

• NCM 5431

Page 10: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 10/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

10

,QWURGXFWLRQWRWKH5HTXLUHG%ORFNVDQGWKHLU &RPPXQLFDWLRQ6WUXFWXUH

This chapter covers the following topics:

• How the sample works

• Blocks required for communication and their communication structure

Page 11: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 11/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

11

+RZWKH6DPSOH:RUNV

'DWD([FKDQJH2 bytes of data are exchanged cyclically by the stations involved in communication.

$FWLYH3DVVLYH(QG

The active SIMATIC S7 end initiates the SEND / RECEIVE function. The passiveSIMATIC S5 end receives the data and sends it back to the active end.Profibus is used as the network medium.

6WHSE\6WHS([HFXWLRQRIWKH8VHU3URJUDPDWWKH$FWLYH(QG6,0$7,&6

• SEND:A data field 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, thereceived data is written to the receive buffer.

• Incrementing data:The value of the data to be sent is incremented by 1 and the send/receive cyclestarts again.

6WHSE\6WHS([HFXWLRQRIWKH8VHU3URJUDPDWWKH3DVVLYH(QG6,0$7,&6

• SEND:A receive job is triggered at the passive end every cycle. When new data isreceived, it is entered in the common receive/send buffer.

• RECEIVE:A send job is triggered when new data is received.

Page 12: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 12/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

12

%ORFNV5HTXLUHGIRU&RPPXQLFDWLRQDQGWKHLU &RPPXQLFDWLRQ6WUXFWXUH

This chapter describes the AG_SEND and AG_RECV blocks required for SEND / RECEIVE communication in greater detail.

Page 13: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 13/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

13

6)XQFWLRQ$*B6(1')&

3XUSRVHRIWKH%ORFN

The AG_SEND function (FC) transfers data from the specified send buffer of theSimatic S7 to the configured partner station. The send buffer pointer can point to aprocess image area, a bit memory area, or a data block area.The addresses and SAP of the partner are specified during configuration and areassigned a connection ID with which the AG_SEND function sends the data.

7KHEORFNSDUDPHWHUVDUHGHVFULEHGLQGHWDLOLQ&KDSWHU

6)XQFWLRQ6(1')%

3XUSRVHRIWKH%ORFN

The function block sends the PLC data from the specified send buffer to the specifiedaddress area of the CP.The addresses and TSAPs of the partners are set in the CP configuration.

7KHEORFNSDUDPHWHUVDUHGHVFULEHGLQGHWDLOLQ&KDSWHU

Page 14: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 14/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

14

6)XQFWLRQ$*B5(&9)&

3XUSRVHRIWKH%ORFN

The AG_RECV function sends the data received from the specified partner station tothe specified receive buffer of the Simatic S7. The receive buffer can point to aprocess image area, a memory bit area or a data block area. The receive buffer mustbe at least as long as the longest data field that can be expected.

The addresses and TSAPs of the partners are specified during configuration and areassigned a connection ID with which the AG_RECV function receives the data.

7KHEORFNSDUDPHWHUVDUHGHVFULEHGLQGHWDLOLQ&KDSWHU

6)XQFWLRQ5(&(,9()%

3XUSRVHRIWKH%ORFN

The function block transfers the CP data from the specified address area to thespecified send buffer of the PLC. The receive buffer can reference a process imagearea, a bit memory area, or data block area. The receive buffer must be at least aslong as the longest data field that can be expected.

The addresses and TSAPs of the partners are set in the CP configuration.

7KHEORFNSDUDPHWHUVDUHGHVFULEHGLQGHWDLOLQ&KDSWHU

Page 15: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 15/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

15

3URJUDP6WUXFWXUHVDQG([WUDFWVRI&RGH

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

Page 16: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 16/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

16

3URJUDP6WUXFWXUHRIWKH$FWLYH3DUWQHU 

No

Program/cycle start

CallAG_SEND

Error occurredwith

AG_SEND?

Save error

number

Yes

Yes

No

CallAG_RECV

Error occurredwith

AG_RECV?

AG_RECV jobcomplete?

Save errornumber

Incrementvariable value

Yes

No

Page 17: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 17/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

17

([WUDFWVRI&RGHIRUWKH$FWLYH3&3DUWQHU 

$FWLYH(QG6\PEROV

6\PERO7DEOH8VHGIRUWKH6HQG5HFHLYH6DPSOHV

8VHV

The use of symbols makes the code easier to read. The symbolic name thenappears in the program instead of the address.

Example: Instead of "MW50" you see "RECEIVE_DATA" in the code.

Page 18: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 18/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

18

$FWLYH(QG2%

3XUSRVH

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.

&DOO

OB1 is called in every CPU cycle.

1DPH

OB1

&RGH

'HVFULSWLRQ

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

Page 19: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 19/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

19

$FWLYH(QG$*B6(1'-RE

3XUSRVH

Two bytes of data are sent to the configured partner using the Send / Receiveservice $*B6(1'.

&DOO

Called within OB1.

1DPH

MY_SEND_CALL (FC40)

&RGH

Page 20: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 20/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

20

0HDQLQJRIWKH3DUDPHWHUVIRUWKH656HUYLFH$*B6(1'

• 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 canalso be read out using "Netpro")

• SEND:Address of a local data area from which the values are transferred.

• 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.

'HVFULSWLRQ

&$//$*B6(1'

The S/R service "send data" is called. Depending on the "SEND_ERROR" bit, thestatus word is saved or the function is exited using a conditional block end (BEC).

6XPPDU\

The send block is signaled 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 datablock (DB43).

Page 21: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 21/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

21

$FWLYH(QG$*B5(&9-RE

3XUSRVH

Two bytes of data are sent to the configured partner using the Send / Receiveservice $*B6(1'.

&DOO

Called within OB1.

1DPH

MY_RECEIVE_CALL (FC41)

&RGH

Page 22: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 22/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

22

0HDQLQJRIWKH3DUDPHWHUVIRUWKH656HUYLFH$*B5(&9

• 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 canalso 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.

'HVFULSWLRQ

&$//$*B5(&9

The S/R service "receive data" is called. Depending on the "RECV_ERROR" bit,the status value is saved. Otherwise the received data length is accepted and ifreceived correctly the data word is incremented.

6XPPDU\

The receive block is triggered in every cycle to receive data and write it to thereceive buffer (DB41). When an error occurs during sending, the returned statusvalue is saved in a data block (DB43). If no error occurs in reception the data isincremented.

Page 23: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 23/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

23

3URJUDP6WUXFWXUHIRUWKH3DVVLYH3DUWQHU 

Yes

Yes

No

Program/cycle start

CallRECEIVE

Error occurredwith RECEIVE?

Save error

number

Call SENDwith send bit

Receivep

Save error

number

Reset send bit

No

Yes

No

Error occurredwith SEND?

Page 24: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 24/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

24

([WUDFWVRI&RGHIRUWKH6,0$7,&63DVVLYH3DUWQHU 

3DVVLYH(QG2%

3XUSRVH

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.

&DOO

OB1 is called in every CPU cycle.

1DPH

OB1

&RGHOB1

Segment 1

:

: JU FB 1

Name : TRIGGER

ANST : F 2.0

:

: JU FB 2

Name : SEND-T2

ANST : F 2.0

:

: JU FB 102

Name : REC-T2

:

:BE

'HVFULSWLRQ

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

Page 25: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 25/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

25

3DVVLYH(QG6(1'-RE

3XUSRVH

Two bytes of data are sent to the configured partner using the Send / Receiveservice 6(1'.

&DOO

Called within OB1.

Page 26: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 26/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

26

&RGH

 FB 2

Segment 1

Name : SEND-T2

: JU FB 123

Name : CONTROL

SSNR : KY 0,0

A-NR : KY 0,2

ANZW : FW 10

PAFE : FY 14

: A F 11.2

: AN F 17.0

: = F 17.1

: A F 11.2

: = F 17.0

: A F 17.1

: AN F 15.0

: RB =TRIGGER

: A =TRIGGER

: AN F 11.1

: R F 17.0

: JC FB 120

Name : SEND

SSNR : KY 0,0

A-NR : KY 0,2

ANZW : FW 10

QTYP : KS DB

DBNR : KY 0,41

QANF : KF +0

QLAE : KF +1

PAFE : FY 15

:BE

Page 27: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 27/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

27

0HDQLQJRIWKH3DUDPHWHUVIRUWKH656HUYLFH6(1')%

• SSNR:Interface number of CP.

A-NR:The order 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.

'HVFULSWLRQ

The S/R service "Send Data" is called. Depending on the "Data_transfer" and"PAFE" bytes, the send bit is reset and the block is closed.

6XPPDU\

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

Page 28: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 28/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

28

3DVVLYH(QG5(&(,9(-RE

3XUSRVH

Two bytes of data are sent by the configured partner using the S/R 5(&(,9(.

&DOO

Called within OB1.

&RGH

FB 41

Segment 1Name : REC-T2

:: JU FB 123

Name : CONTROLSSNR : KY 0,0A-NR : KY 0,102ANZW : FW 110PAFE : FY 114

:: AN F 111.0: BEB:: JC FB 121

Name : RECEIVESSNR : KY 0,0A-NR : KY 0,102ANZW : FW 110ZTYP : KC DBDBNR : KY 0,41ZANF : KF +0ZLAE : KF -1PAFE : FY 115

:: O F 115.0: O F 111.3: BEB:::

:BE

Page 29: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 29/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

29

0HDQLQJRIWKH3DUDPHWHUVIRUWKH656HUYLFH5(&(,9(

• SSNR:Interface number of CP.

• A-NR:This parameter shows the order number for the connection of the local communicationCP.

• 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. When "–1" the length of the data to receive.

• PAFE:Process image error in executing the receive block.

'HVFULSWLRQ

The S/R service "Receive Data" is called. When the "receive end" bit "PAFE" bitshave been successfully passed the block is closed and the send job bit is set.

6XPPDU\

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

Page 30: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 30/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

30

2SHUDWRU&RQWURODQG0RQLWRULQJ

This chapter covers the following topic:

• Operator control and monitoring

Page 31: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 31/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

31

2SHUDWRU&RQWURODQG0RQLWRULQJ

1RWHIf problems occur during operator control and monitoring, please read Chapter 7,Troubleshooting.

0RQLWRULQJ

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

6WHS 'HVFULSWLRQ

1 Insert this end of the MPI cable in the MPI port of the S7 CPU in the activestation

2 Select "Blocks" in the project window of the SIMATIC Manager under the activestation.

3 Double-click "VAT1".

4 In the "Monitoring and Modifying Variables" program, select 3/&!&RQQHFWWR!&RQILJXUHG&38

5 To monitor the specified variables, select "9DULDEOH!0RQLWRU

1RWHThe monitor function is active when "Online" is displayed in the status bar in the"Monitoring and Modifying Variables" program and you can see a continuouslychanging progress bar.

Page 32: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 32/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

32

When you have completed the steps listed above, you will see the followingvariable table (value deviations are possible!):

6(1'3DUDPHWHU 

In the upper part, "SEND", you can see the parameters of the AG_SENDSend/Receive service.,IWKHVDPSOHLVZRUNLQJFRUUHFWO\

$PRQJVWRWKHUWKLQJVWKHSDUDPHWHU6(1'B'21($*B6(1'MRE

FRPSOHWHGFKDQJHVLWVVWDWHFRQWLQXRXVO\IURP!

5(&(,9(3DUDPHWHU 

In the "RECEIVE" section you will see the same but for the Send/Receive serviceAG_RECV.,IWKHVDPSOHLVZRUNLQJFRUUHFWO\

$PRQJVWRWKHUWKLQJVWKHSDUDPHWHU5(&9B1'5GDWDUHFHLYHGVKRXOG

VKRZDFRQWLQXRXVO\FKDQJLQJVWDWXVRI!

If the error output is set, you will see the status messages of the blocks in "last errorin program".

,IWKHVDPSOHLVZRUNLQJFRUUHFWO\

'XHWRWKHXSGDWHF\FOHRIWKHYDULDEOHWDEOHWKHZULWWHQDQGUHDGGDWDVKRXOG

EHGLIIHUHQW

,IWKHVDPSOHLVIXQFWLRQLQJFRUUHFWO\WKHGDWDVKRXOGEHFRQWLQXRXVO\

FKDQJLQJ

Page 33: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 33/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

33

1RWHThe meaning of the values of the parameters for AG_SEND and AG_RECV isexplained in detail in the relevant documentation and in the NCM online help (for

example 6WDUW!6LPDWLF!1&06352),%86!+HOS)XQFWLRQV)&!(QJOLVK).

1RWHThe sample is functioning correctly when the value of the data read and writtenchanges continuously.

! Don’t forget!The variable table must be online and monitoring must be active for the values tobe updated.

2SHUDWRU&RQWURO

You can call the functions using the variable table provided with the sample. How tostart and activate it was described above.

1RWH

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

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

6WHS 'HVFULSWLRQ

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

2 Select "Variable" -> "Activate Modify Value"

&RUUHFWIXQFWLRQ

If the value has been successfully modified, the value read should also return anew value.

Page 34: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 34/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

34

([LWLQJ2SHUDWRU&RQWURODQG0RQLWRULQJ

6WHS 'HVFULSWLRQ

1 In the "Monitoring and Modifying Variables" program select 7DEOH!([LW

2 Click the "No" button in the subsequent dialog.

Page 35: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 35/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

35

7URXEOHVKRRWLQJ

This chapter is intended to help you if you encounter problems installing andstarting up the sample.

Page 36: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 36/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

36

3UREOHPV'RZQORDGLQJWKH+DUGZDUH&RQILJXUDWLRQWKH&RQQHFWLRQRUWKH

%ORFNV

Run the following checks.

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

6WHS 'HVFULSWLRQ

1 Is the MPI cable connected to both the PG/PC and the S7 CPU?

2 In the "Setting the PG/PC Interface" program is the correct interface parameterset assigned to the "Access point of application" "S7ONLINE (STEP 7)"? Forexample, "MPI-ISA on board (MPI)" if you are using the PG-MPI port?

3 Is the hardware configuration in the project (offline configuration) identical inevery way with the actual configuration (online configuration)?

4 Has the CPU been reset?

5HPHGLHV

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

$QVZHUWR6WHSZDV12

No connection can be established to the S7 CPU, it is not possible to download tothe CPU.

6WHS 'HVFULSWLRQ

1 Insert one end of the MPI cable in the MPI port on your PG or PC.

2 Insert the other end of the MPI cable in the MPI port of your S7 CPU.

Page 37: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 37/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

37

$QVZHUWR6WHSZDV12

No connection can be established to the S7 CPU, it is not possible to download tothe CPU.

6WHS 'HVFULSWLRQ

1 Start the "Setting the PG/PC Interface" program: "Start" -> "Simatic" -> "STEP7" -> "Setting the PG/PC Interface".

2 Set the module you want to use as the MPI port in "Interface parameterassignment used".For example, "MPI-ISA on board (MPI)" if you are using the PG-MPI port.

3 Click the "OK" button.

<RXUDQVZHUWRVWHSZDV12

6WHS 'HVFULSWLRQ

1 Adapt the actual hardware configuration to that of the project or read thedocumentation "Change_CPU" or "Change_CP" if you want to use a differentCPU or CP than the one used in the sample.

<RXUDQVZHUWRVWHSZDV12

6WHS 'HVFULSWLRQ

1 Reset the CPU.

Page 38: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 38/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

38

9DULDEOH7DEOH:ULWWHQDQGUHDGGDWDGRQRWFKDQJH

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

6WHS 'HVFULSWLRQ

1 Is the Profibus cable connected to both the active and passive stations?

2 Can you see "Online" in the status bar of the variable table?

3 Can you see a continuously changing progress bar in the status bar?

5HPHGLHV

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

7KHDQVZHUWRVWHSZDV12

No connection can be established between the stations and data exchange is notpossible.

6WHS 'HVFULSWLRQ

1 Connect the end of the PROFIBUS cable to the CP port of the station.

2 Repeat steps 1 and 2 for the passive station.

Page 39: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 39/40

6,0$7,&1(74XLFN6WDUW 

Profibus Communication: S7-CP 443-5 Basic/Ext. S5-CP 5431

39

<RXUDQVZHUWR6WHSZDV12

No connection was established to the S7 CPU and monitoring was not possible.

6WHS 'HVFULSWLRQ

1 In the program "Monitoring and Modifying Variables", select 3/&!

&RQQHFW7R!&RQILJXUHG&38

<RXUDQVZHUWRVWHSZDV12The monitoring function is not activated.

6WHS 'HVFULSWLRQ

1 Select 9DULDEOH!0RQLWRU in the "Monitoring and Modifying Variables"program.

Page 40: pb_fdl_s7_s5

8/2/2019 pb_fdl_s7_s5

http://slidepdf.com/reader/full/pbfdls7s5 40/40

6,0$7,&1(74XLFN6WDUW 

9DULDEOH7DEOH2SHUDWRUFRQWUROLVQRWZRUNLQJ

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

6WHS 'HVFULSWLRQ

1 Have you activated 9DULDEOH!0RGLI\9DOXH9DOLG in the "Monitoring andModifying Variables" program?

2 Is the value you entered for memory word 52 (MW52) between 0 and 32767?

5HPHGLHVCorrect the problem by working through the steps below if your answer was no toone of the questions above.

<RXUDQVZHUWRVWHSZDV12

6WHS 'HVFULSWLRQ

1 Select 9DULDEOH!0RGLI\9DOXH9DOLG in the "Monitoring and ModifyingVariables" program.

<RXUDQVZHUWRVWHSZDV12

6WHS 'HVFULSWLRQ

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

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