Top Banner
Siemens AG Training Center SEND/RECEIVE Interface Page 1 Contents Page SEND-RECEIVE Interface in the CPU...................................................................................... 2 CPU Cycle and Transmission Time.......................................................................................... 3 Data Quantities per Job ....................................................................................................... 4 User Data Area in the CPU....................................................................................................... 5 Programming the SEND/RECEIVE Interface........................................................................... 6 Typical Execution Sequence for the FCs in the CPU Cycle...................................................... 7 The FCs..................................................................................................................................... 8 Entering the FCs in the STEP 7 Library.................................................................................... 9 General Notes on the FCs.......................................................................................................... 10 Reactions to Incorrect Address Entries..................................................................................... 11 FC AG_SEND/AG_LSEND...................................................................................................... 12 Explanation of the Formal Parameters....................................................................................... 13 Operation of the AG_SEND FC.................................................................................................. 15 Condition Codes of AG_SEND.................................................................................................. 16 FC AG_RECV/AG_LRECV ....................................................................................................... 19 Explanation of the Formal Parameters....................................................................................... 20 Operation of the AG_RECV FC.................................................................................................. 21 Condition Codes of AG_RECV.................................................................................................. 23 Job Header ............................................................................................................................... 26 Date: 01.09.1999 File No.: 7E_SRSS.1 SIMATIC NET Industrial Ethernet Siemens AG 1999. All rights reserved. Programming with the SEND/RECEIVE Interface
26

09_7KE_SRSS

Aug 07, 2015

Download

Documents

sokol_polece

S7ETH Industrial Ethernet
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 1

Contents Page

SEND-RECEIVE Interface in the CPU...................................................................................... 2CPU Cycle and Transmission Time.......................................................................................... 3Data Quantities per Job ....................................................................................................... 4User Data Area in the CPU....................................................................................................... 5Programming the SEND/RECEIVE Interface........................................................................... 6Typical Execution Sequence for the FCs in the CPU Cycle...................................................... 7The FCs..................................................................................................................................... 8Entering the FCs in the STEP 7 Library.................................................................................... 9General Notes on the FCs.......................................................................................................... 10Reactions to Incorrect Address Entries..................................................................................... 11FC AG_SEND/AG_LSEND...................................................................................................... 12Explanation of the Formal Parameters....................................................................................... 13Operation of the AG_SEND FC.................................................................................................. 15Condition Codes of AG_SEND.................................................................................................. 16FC AG_RECV/AG_LRECV ....................................................................................................... 19Explanation of the Formal Parameters....................................................................................... 20Operation of the AG_RECV FC.................................................................................................. 21Condition Codes of AG_RECV.................................................................................................. 23Job Header ............................................................................................................................... 26

Date: 01.09.1999File No.: 7E_SRSS.1

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Programming with the SEND/RECEIVE Interface

Page 2: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 2

FCs The following FCs (functions) are available for handling communication viaconfigured connections:

• AG_SEND / AG_LSENDThis function passes the user data from the specified user data areato the Ethernet CP for transmission.

• AG_RECV / AG_LRECVThis function puts the user data received into the user data areaspecified in the call.

Note The information given here applies to both AG_SEND andAG_LSEND and AG_RECV and AG_LRECV unless otherwise stated !

The diagram above illustrates this procedure: The user program uses the FCs AG_SEND/ AG_LSEND and AG_RECV / AG LRECV to instruct the Ethernet CP to send or receive data via the configured connection.

Data exchange Data is exchanged between CPU and Ethernet CP as dictated by theS7 CPU <-> calls to the FCs AG_SEND and AG_RECV in the CPU program.Ethernet CP

The Ethernet CP processes the Send and Receive jobs independently of theCPU cycle and the transmission takes a certain amount of time. The interface with the FCs in the user program is synchronized by means of acknowledgements. There are two possibilities:

• The CPU cycle is faster than the transmission time.• The CPU cycle is slower than the transmission time.

Date: 01.09.1999File No.: 7E_SRSS.2

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

SEND-RECEIVE Interface in the CPU

Ethernet station SIMATIC S7

CPdatabase

CPdatabase

CPU

User data bufferUser data buffer

Send

Receive

Ethernet CP

STEP 7user program

STEP 7user program

User data areas

User data areas

AG_SEND

AG_RECV

CPU cycle Transmission time

Communicationconnection

Page 3: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 3

FC Calls Faster If an FC is called again in the user program before all the data has beenthan the sent or received, the following happens at the FC interface:Transmission Time

• AG_SEND:No further job is accepted until the transmission of the data on the connection has been acknowledged by the Ethernet station. During this time, the user programm receives the message "job active" until the Ethernet CP can accept the next job on the same connection.

• AG_RECV:The job is acknowledged with the message “no data available yet" if there is no received data on the Ethernet CP. The user program receives this message in the CPU cycle until the Ethernet CP hasreceived all the data on the connection.

FC Calls Slower If an FC is called again after the data has been completely transferred orthan the received, the procedure is as follows at the FC interface:Transmission Time

• AG_SEND:The job is positively acknowledged. The Ethernet CP is ready toreceive a new send job.

• AG_RECV:The job is acknowledged with “New data received” when the data hasbeen transferred to the user program. Following this, the FC call can berepeated.

Date: 01.09.1999File No.: 7E_SRSS.3

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

CPU Cycle and Transmission Time

� FC calls faster than the transmission time

� FC calls slower than the transmission time

Page 4: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 4

Date: 01.09.1999File No.: 7E_SRSS.4

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Data Quantities per Job

The Ethernet CP can transfer the following quantities of data per job via a connection

ISOTransport

ISO-on-TCP

TCP UDP

Send 8192 bytes 8192 bytes 8192 bytes 2048 bytes

Receive 8192 bytes 8192 bytes 8192 bytes 2048 bytes

Note: With TCP you can only use the AG_LSEND andAG_LRECV functions, regardless of the quantity of data tobe transferred.

Older CPs do not support transfer of more than 240 bytes of data.

Please read the product information for your CP.

Page 5: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 5

Alternative Different data areas in the CPU can be used for communication viadata areas configured connections. Your choice of data area depends on the type of CPU

and the task involved. The alternatives are:

• Data block (DB):Data blocks can be used for storing Send/Receive data.

• Process image:This choice is only possible if continuous Send and Receive areas can be reserved in the process image of the S7 CPU. The capacity may be restricted by the capabilities of the CPU and by the number of centralsignal modules.

• Bit memory address area:The bit memory address area can be used, for example, if there is notsufficient space in the process image because of the central signal modules.

Date: 01.09.1999File No.: 7E_SRSS.5

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

User Data Areas in the CPU

• Data block (DB)

• Process image

• Bit memory address area

Page 6: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 6

Connections Program the SEND-RECEIVE interface in the user program as follows:

• Use the following FCs for transferring data via configured connections:

- AG_SEND for passing the user data area to the Ethernet CP;

- AG_RECV for entering the data received from the Ethernet CP into the user data area;

• Evaluate the condition codes issued by the FCs:

- For AG_SEND these are the parameters DONE, ERROR andSTATUS, and

- For AG_RECV the parameters NDR, ERROR and STATUS

Note You must use the configured connection numbers (IDs) when programming.

Date: 01.09.1999File No.: 7E_SRSS.6

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Programming the SEND/RECEIVE Interface

Principle of joband data transfer

The user program triggers the transfer of the user data areas by means of FC calls and monitors the execution by evaluating the condition code bits returned by the FCs. The parameters assigned to the FCs when they are called include:

• Connection number (ID);

• Location of the user data area in the CPU.

Purpose of the FCs Calling FC blocks results in the following action:

• The user data area is passed to the Ethernet CPor accepted from the Ethernet CP.

• Positive or negative confirmation of execution of the jobis indicated in the status word.

Page 7: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 7

We can observe the following:

• The user program, which can consist of any number of blocks (OBs,FBs or FCs), accesses several connections.

• The user program can send data via connections by means ofAG_SEND calls at any point (event-driven and program-controlled execution).

• The user program can accept data received via connections by meansof AG_RECV calls at any point in the CPU cycle.

Note: The FCs can be called more than once in one cycle for the same connection.

Date: 01.09.1999File No.: 7E_SRSS.7

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Typical Execution Sequence for the FCs in the CPU Cycle

AG_RECV

User program

AG_RECV

AG_SEND

Read PII

OB

AG_SEND

Write PIQ

Read in data receivedvia the connection

Connection

Connection

Connection

Pass Send data to the connection

Key: CPU cycleHatching/shading shows which connections and FCs go together

AG_SEND

AG_RECV

Page 8: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 8

Note For TCP connections you can only use the FCs AG_LSEND and AG_LRECV, regardless of the amount of data to be transferred.

Date: 01.09.1999File No.: 7E_SRSS.8

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

The FCs

Block number FC type

5 AG_SEND

6 AG_RECV

50 AG_LSEND

60 AG_LRECV

Purpose

Send data <= 240 bytes

Receive data <= 240 bytes

Send data, max 8192 bytes

Receive data, max 8192 bytes

The FCs are supplied with the NCM S7-Ethernet configuring software.

The following list shows the block numbers used for these FCs on delivery.You can change these block numbers if you wish.

Page 9: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 9

In order to be able to use the FCs for writing your user program, follow the procedure outlined above.

Date: 01.09.1999File No.: 7E_SRSS.9

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Entering FCs in the STEP 7 Library

1. Open the library in the SIMATIC Manager with File >Open >Library.

Result:The currently existing libraries are displayed.

If the entry “SIMATIC NET CP” is not present, proceed as follows:

2. Search for the directory “Simnetcp” in SIEMENS\STEP 7\S7libs\simaticnand select or open the file CP.S7L in it.

Result:The library “SIMATIC NET CP” is now created in the STEP 7 library.

Page 10: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 10

Specifying the When you call an FC, you assign the starting address of the CP moduleCP Address to the LADDR parameter. You can obtain the starting address of the Ethernet CP

module from the hardware configuration.

Ascertaining the The module starting address can be determined from the slot-orientedCP Address address assignment for signal modules. The rules for analog modules apply to

the Ethernet CP.

When the CP is configured with the STEP 7 hardware configuration tool, the starting address of the module appears in the configuration table.

Specifying the When you call an FC you supply it with the address and length of the dataData Area in the area in the CPU. Please note that the maximum length of the data areaCPU depends on the type of FC used.

FC Output On complete restart/restart of the Ethernet CP (e.g. when the switch isParameters on operated), the output parameters of the FC are reset as follows:CP Startup

• DONE = 0

• NDR = 0

• ERROR = 0

• STATUS = 8180H for AG_RECV and 8181H for AG_SEND

Date: 01.09.1999File No.: 7E_SRSS.10

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

General Notes on the FCs

• Specification of the CP address- LADDR parameter- Starting address of module from hardware configuration table- Slot-oriented address assignment for Ethernet CP as for analog

modules

• Specification of the data area in the CPU- Address and length- Max. length 8192 bytes, depending on the type of block used

Page 11: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 11

If the S7 CPU cannot communicate with the Ethernet CP at the specified module starting address, the result is as shown above.

Note:

The SIMATIC S7 addresses the Ethernet CP like an analog module. If anincorrect address is specified, this can result in error codes which are not derived from error messages from the FCs themselves.

Date: 01.09.1999File No.: 7E_SRSS.11

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Reactions to Incorrect Address Entries

Error Response

CP address indicates a non-existentCP module or digital module.

CPU remains in Stop mode due to a system error.

CP address indicates a module withanalog I/Os.

Possible error codes in STATUS:8184H System error80B0H Data record unknown to module.80C0H Data record cannot be read.80C3H Resource (memory) occupied.80D2H Incorrect logical base address.

Page 12: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 12

Purpose of The FC AG_SEND passes on data to the Ethernet CP for transmissionthe FC via a configured connection.

The data area specified can be an area in the process image, a bit memory address area or a data block area.

Successful execution is signalled when the complete user data area has been transmitted via Ethernet.

Date: 01.09.1999File No.: 7E_SRSS.12

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

FC AG_SEND / AG_LSEND

STL Explanation

ACT DONE

ID ERROR

LADDR STATUS

SEND

LEN

call fc 5ACT := M 10.0ID := MB 11LADDR := W#16#0100SEND := P#db99.dbx10.0 byte 240LEN := MW 12DONE := M 10.0ERROR := M 10.7STATUS := MW 14

//AG-SEND FC call

=LADDR 256 dec. in hardware configuration

Call interface inLAD

Example in STL

BOOL

INT

WORD

ANY

INT

BOOL

BOOL

WORD

Page 13: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 13

Date: 01.09.1999File No.: 7E_SRSS.13

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Explanation of the Formal Parameters (1)

Parameter

ACT

Declaration Type Poss. values Remarks

INPUT BOOL 0,1 If ACT = 1, LEN bytes from the transport data area specified with the SENDparameter are sent.

If ACT = 0, the DONE, ERROR andSTATUS codes are updated.

ID INPUT INT 1,2...64(S7-400)1,2...16(S7-300)

The ID parameter specifies the connection number of the transport connection.

LADDR INPUT WORD Module starting address

When the CP is configured with the STEP 7hardware configuration tool, the module starting address appears in the configuration table. Enter this address here.

SEND INPUT ANY Address and length of transport data areaThis may be:- Process image area- Bit memory address area- Data block area

Page 14: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 14

Date: 01.09.1999File No.: 7E_SRSS.14

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Explanation of the Formal Parameters (2)Parameter

LEN

Declaration Type Poss. values Remarks

INPUT INT 1..8192 bytes forISO and ISO-on-TCP1..2048 bytes for UDP

Number of bytes from the transport data area to be sent with the job. The number can be from 1 to the length specified for theSEND parameter.

DONE OUTPUT BOOL 0: Job inprogress

1: Jobcompleted

This parameter indicates whether or not the job has been completed without errors. Aslong as DONE=0, no new job can be started.The CP sets DONE to 0 when it accepts ajob.For meanings in conjunction with theERROR and STATUS parameters, see the Condition Codes table.

OUTPUT 0: -1: Error

ERROR BOOL Error codeFor the meaning in conjunction with theDONE and STATUS parameters see the Condition Codes table.

WORDSTATUS OUTPUT SeeCondition Codes table

Status codeFor the meaning in conjunction with theDONE and ERROR parameters see the Condition Codes table.

Page 15: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 15

The diagram above shows the normal execution sequence of a data transfer initiated by AG_SEND in the user program.

The Ethernet CP acknowledges every AG_SEND job in the user program by setting the DONE, ERROR and STATUS output parameters.

The condition codes can be updated without issuing a new Send job by setting the ACT parameter = 0.

Date: 01.09.1999File No.: 7E_SRSS.15

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Operation of the AG_SEND FCUser program (CPU cycle)

AG_SEND0, 1, 8181 1)

AG_SEND1, 0, 0000 1)

AG_SEND0, 0, 8181 1)

Supply AG_SENDwith data ‘X’

ACT = 1

AG_SEND0, 0, 8181 1)

Supply AG_SENDACT = 0

AG_SEND1, 0, 0000 1)

Supply AG_SENDACT = 0

Time Time

Ethernet CP

Transmission of ‘X’via Ethernet

active

Time

Communication partner

Startup phase

Key:1) Parameter transfer

DONE, ERROR, STATUS

Page 16: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 16

Date: 01.09.1999File No.: 7E_SRSS.16

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Condition Codes of AG_SEND (1)

0 0 8181H Job active.

0 1 8183H No configuration data or Transport service in Ethernet CP not yet started.

0 1 8184H System error

0 1 8185H LEN parameter longer than SEND source area.

0 1 8186H ID parameter invalid, ID != 1,2...64.

0 1 8301H SAP not activated at destination station.

0 1 8302H No Receive resources at destination station, receiving station cannot process received data fast enough or has not provided any resources for receiving data.

0 1 8303H The SDA service (Send Data with Acknowledge) is not supported by the destination station at this SAP (no SDA on Ethernet).

0 1 8304H Connection not established.

DONE ERROR STATUS Meaning

1 0 0000H Job completed without errors.

0 1 7000HThis code is possible only with the S7-400.The FC was called with ACT=0; the job has not yet been processed

Page 17: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 17

Date: 01.09.1999File No.: 7E_SRSS.17

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Condition Codes of AG_SEND (2)

DONE ERROR STATUS Meaning

0 1 8311H Destination station not obtainable at the specified Ethernetaddress.

0 1 8312H Ethernet error in CP.

0 1 8F22H Source area invalid, e.g. :Area not present in DBLEN parameter < 0

0 1 8F24H Range error when reading a parameter.

0 1 8F28H Alignment error when reading a parameter.

0 1 8F32H DB number in parameter too high.

0 1 8F33H DB number error.

0 1 8F3AH Area not loaded (DB).

0 1 8F42H Timeout when reading a parameter from the I/O area.

0 1 8F44H Address of parameter to be read disabled in access track.

0 1 8F7FH Internal error, e.g. illegal ANY referencee.g. LEN parameter = 0.

Page 18: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 18

Date: 01.09.1999File No.: 7E_SRSS.18

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Condition Codes of AG_SEND (3)

DONE ERROR STATUS Meaning

0 1 8090H No module with this starting address or CPU in STOP.

0 1 8091H Module starting address not at double word boundary.

0 1 80B0H Data record unknown to module.

0 1 80B1H Destination area invalide.g. destination area > 240 bytes.

0 1 80B2H communication bus link between CPU and CP not established.

0 1 80C0H Data record cannot be read.

0 1 80C1H Specified data record currently being processed.

0 1 80C2H There are too many jobs pending.

0 1 80C3H Resources (memory) of CPU temporarily occupied.

0 1 80C4H Communication error.

0 1 80D2H Incorrect module starting address.

Page 19: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 19

Purpose of The FC AG_RECV receives the data transferred via a configuredthe FC connection from the Ethernet CP.

The data area specified as the data destination can be an area in the process image, a bit memory address area or a data block area.

Successful execution is signalled when the data has been received from the Ethernet CP.

Date: 01.09.1999File No.: 7E_SRSS.19

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

FC AG_RECV / AG_LRECV

ID NDR

LADDR ERROR

RECV STATUS

LEN

STL Explanation

call fc 6ID := DB 100.DBW 1LADDR := W#16#0100RECV := P#M 0.0 BYTE 100NDR := DB 100.DBX 0.6ERROR := DB 100.DBX 0.7STATUS := DB 100.DBW 2LEN := DB 100.DBW 4

//AG-RECV FC call

Call interface in LAD

Example in STL

INT

WORD

ANY

BOOL

BOOL

WORD

INT

Page 20: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 20

Date: 01.09.1999File No.: 7E_SRSS.20

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Explanation of the Formal Parameters (1)

Parameter

ID

Declaration Type Poss. values Remarks

INPUT INT 1,2...16 The ID parameter specifies the connection number of the transport connection.

LADDR INPUT WORD Starting address of module

When the CP is configured with the STEP 7hardware configuration tool, the module starting address appears in the configuration table. Enter this address here.

RECV INPUT ANY Address and length of transport data area

This may be:- Process image area- Bit memory address area- Data block area

LEN INPUT INT 1..8192 for ISO and ISO-on-TCP1..2048 for UDP

Number of bytes transferred from theEthernet CP to the transport data area.

Page 21: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 21

Date: 01.09.1999File No.: 7E_SRSS.21

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Explanation of the Formal Parameters (2)

Parameter

NDR

Declaration Type Poss. values Remarks

OUTPUT BOOL 0: -1: New data

This parameter indicates whether new data has been accepted.For the meaning in conjunction with theERROR and STATUS parameters, see the Condition Codes table.

ERROR OUTPUT BOOL 0: -1: Error

Error codeFor the meaning in conjunction with the NDRand STATUS parameters see the ConditionCodes table.

STATUS OUTPUT WORD See ConditionCodes table

Status codeFor the meaning in conjunction with the NDRand ERROR parameters see the ConditionCodes table.

Page 22: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 22

The diagram above shows the normal execution sequence for data acceptance initiated by AG-RECV in the user program.

The Ethernet CP acknowledges every AG-RECV job in the user program by setting the NDR, ERROR and STATUS output parameters.

Date: 01.09.1999File No.: 7E_SRSS.22

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Operation of the AG_RECV FCUser program (CPU cycle)

AG_RECV0, 1, 8180 1)

AG_RECV1, 0, 0000 1)

Accept/evaluate received data ‘A’

AG_RECV

Time Time

Ethernet CP

Transmission of ‘B’via Ethernet in progress

Time

Communication partner

Key:1) Parameter transfer

NDR, ERROR, STATUS

Transmission of ‘A’via Ethernet in progress

AG_RECV0, 0, 8180 1)

AG_RECV1, 0, 0000 1)

Accept/evaluate received data ‘B’

Transmission of ‘C’via Ethernet in progress.

.

.

Page 23: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 23

Date: 01.09.1999File No.: 7E_SRSS.23

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Condition Codes of AG_RECV (1)

NDR ERROR STATUS Meaning

0 0 8181H Job active.

0 0 8180H Data not yet present.

1 0 0000H New data accepted.

0 1 8183H No configuration data or ISO Transport service not yet started in Ethernet CP.

0 1 8184H System error.

0 1 8185H Destination buffer (RECV) too small.

0 1 8186H ID parameter invalid, ID != 1,2...(16) 64.

0 1 8304H Connection not established.

0 1 8F23H Source area invalid, e.g.:Area not present in DB.

0 1 8F25H Range error when writing a parameter.

0 1 8F29H Alignment error when writing a parameter.

0 1 8F30H Parameter in write-protected 1st active data block.

Page 24: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 24

Date: 01.09.1999File No.: 7E_SRSS.24

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Condition Codes of AG_RECV (2)

NDR ERROR STATUS Meaning

0 1 8F31H Parameter in write-protected 2nd active data block.

0 1 8F32H DB number in parameter too high.

0 1 8F33H DB number error.

0 1 8F3AH Destination area not loaded (DB).

0 1 8F43H Timeout when writing a parameter into the I/O area.

0 1 8F45H Address of parameter to be written disabled in the access track.

0 1 8F7FH Internal error, e.g. illegal ANY reference.

0 1 8090H No module with this starting address or CPU in STOP.

0 1 8091H Module starting address not at doubleword boundary.

0 1 80A0H Negative acknowledgement when reading from module.

0 1 80B0H Data record unknown to module.

0 1 80B1H Destination area invalid.

0 1 80A4H Communication bus link between CPU and CP not established

Page 25: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 25

Date: 01.09.1999File No.: 7E_SRSS.25

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Condition Codes of AG_RECV (3)

NDR ERROR STATUS Meaning

0 1 80B2H Communication bus link between CPU and CP not established.

0 1 80C0H Data record cannot be read.

0 1 80C1H Specified data record currently being processed.

0 1 80C2H Too many jobs pending.

0 1 80C3H Resources (memory) of CPU temporarily occupied.

0 1 80C4H Communication error.

0 1 80D2H Incorrect module starting address.

Page 26: 09_7KE_SRSS

Siemens AGTraining Center

SEND/RECEIVE InterfacePage 26

Date: 01.09.1999File No.: 7E_SRSS.26

SIMATIC NET Industrial EthernetSiemens AG 1999. All rights reserved.

Job Header

Data byte 0 Data byte 1

Data byte 2040 Data byte 2041

Byte

0,1

2,3

4,5

6,7

2046,2047

Port Low Byte High Byte

142 11IP address

40 35

Job buffer

Job header

User data

User data area

The address and job parameters for a specified connection are defined in the connection configuration. The user program only needs to provide the user data area by means of AG_SEND/AG_LSEND and AG_RECV/AG_LRECV.

Job Header Free UDP connections need a job header in the user data area.The diagram shows the structure of the job buffer and the position and meaning of the parameters in the job header.The user data area can be up to 2048 bytes long.6 bytes are reserved for the job header and up to 2042 bytes of user data can be transferred.