Siemens S7 appendix Programming the SEND/RECEIVE Interface, Principle of Job and Data Transfer

Page 75

SEND/RECEIVE Interface in the User Program

3.2Programming the SEND/RECEIVE Interface

Principle of Job and Data Transfer

The user program triggers the transfer of the user data areas with FC calls and monitors the transfer by evaluating the return codes of the FCs.

The following parameters are transferred when the FCs are called:

SThe number of the connection (ID)

SThe location of the user data area in the CPU

For detailed information about the call interface see Chapter 5.

Purpose of the FCs

Calling the function blocks has the following effects:

SThe user data area is transferred to the Ethernet CP or received from the Ethernet CP.

SThe execution of the job is confirmed positively or negatively in a status message.

Programming Connections

Program the SEND/RECEIVE interface in the user program as follows:

1.Use the following functions (FCs) for data transmission on connections:

AG_SEND/AG_LSEND for transferring the user data area to the Ethernet

CP

AG_RECV/AG_LRECV for entering data received from the Ethernet CP in the user data area

2.Evaluate the following bits in the FCs:

for AG_SEND/AG_LSEND the parameters DONE, ERROR, STATUS

for AG_RECV/AG_LRECV the parameters NDR, ERROR, STATUS

Notice

Connection numbers (IDs) must be taken from the configuration when programming.

To ensure correct parameter settings for the block calls, The LAD/STL/FBD editor in STEP 7 provides you with the option of accepting all the relevant parameters from the hardware configuration (HW Config) and from the connection configuration. For more information, refer to Section 5.2

SIMATIC NET NCM S7 for Industrial Ethernet

75

C79000-G8976-C129–06

Image 75
Contents Simatic NET Classification of Safety-Related Notices Correct Usage of Hardware Products Safety Instructions Regarding your ProductTrademarks Qualified PersonnelCopyright E Siemens AG 2001-2002All rights reserved Prior to StartupPrimer Communication services with / NCM S7S7-CP and / NCM S7 ManualSymbols used in this Manual AudienceScope of this Manual Manual Title ContentNCM S7 for Industrial EthernetTopic Document Additional Information on Simatic S7 and StepConventions Access to Online Help of and NCM S7Contents 175 Programming FCs Functions and FBs for S7 Ethernet CPs 141211 191197 201Communication via Ethernet CPs in S7 Stations All-Round Communication in the Industrial Sector Network AccessIndustrial Ethernet DefinitionSimatic S7 Communication with S7 Ethernet CPs Types of CommunicationPG/OP communication Html process control S7 communicationS5-compatible communication with SEND/RECEIVE interface PROFInet communicationPossibilities for Communication between Device Types File management and file access with FTPConfiguration and Diagnostics Application PG/OP Communication via Industrial EthernetIsdn Configuration for PG/OP OperationPG Communication with over Industrial Ethernet Requirements for PG CommunicationNetworking the PG / Engineering Station Requirements ProcedureS7 Communication on Industrial Ethernet NodesClient and server functionality at both ends Profibus Configuring S7 Connections Interface in the User Program of the S7 StationBlock type Client Server Described Communication via Ethernet CPs in S7 Stations ISO Transport Connection S5-compatible Communication SEND/RECEIVE Interface1SEND/RECEIVE interface IP Internet ProtocolWAN StationsFETCH/WRITE Services Server Coordinating Access Using the User ProgramConnection Types Tools ConfiguringNetworking Stations with Step Networking in a MultiprojectVariants Variant examples Characteristics/ConfigurationConfiguration of the System Network/Project Variant One Subnet One ProjectView in a Project Simatic S5 Network/Project Variant Two or More Subnets One Project Organization in a Multiproject Network/Project Variant One Subnet More Than One SubProjectPossibilities for stations outside the current project Merging projects in the multiproject Cell level = subproject Communication via Ethernet CPs in S7 Stations Network/Project Variant Connections between Subnets TCP/IP Communication via Ethernet CPs in S7 Stations Installing and Starting the Ethernet CP With Step Installation FunctionsOperation Procedure Configuration data in the projectUDP Creating an Industrial Ethernet Subnet AimsSelect Insert Subnet Industrial Ethernet Properties of Merged Subnets Multiproject Installing and Starting the Ethernet CP with Step Subnet Attachment Entering an Ethernet CP in the Hardware ConfigurationInstalling and Starting the Ethernet CP with Step Installing and Starting the Ethernet CP with Step Graphic Overview in NetPro Displaying the Network Attachments of a StationResult Overview in Table FormSetting Further CP Properties OverviewAddresses Tab Option Meaning / Effect Options TabCPU Default Setting Time-of-Day Synchronization Tab Addressing Tab Diagnostics TabNon-Siemen Device Ethernet subnet S7-400/3 Substitute Objects in the ProjectPlant Production S7-400/2Attaching Non-S7 Stations to the Subnet Project With Substitute Objects ConfiguredSelecting the Subnet Type for Other Station Example Setting Up Connections Configuring Communication ServicesAssigning the Address Options and Recommendations Assigning Addresses for the First Time Applies to Latest CPsSelect the menu command PLC Assign Ethernet Address Installing and Starting the Ethernet CP with Step Alternative Procedure Installing and Starting the Ethernet CP with Step Downloading the Configuration Data to the Target System PrincipleType of Interface Deactivating the MAC Address in the Configuration Saving the Configuration Data in Non-Volatile MemoryDownloading the Configured Connections Relocating the CP in the Hardware Configuration Page SEND/RECEIVE Interface in the User Program Ethernet CP How the SEND/RECEIVE Interface Works on the CPUFunctions FCs Amounts of DataProgramming Connections Programming the SEND/RECEIVE InterfacePrinciple of Job and Data Transfer Purpose of the FCsAgsend Agrecv Calling FCs in the CPU ProgramSEND/RECEIVE Interface in the User Program Data Exchange S7 CPU Ethernet CP FC Calls Faster than the Transmission TimeFC Calls Slower than the Transmission Time SEND/RECEIVE Interface in the User Program Purpose of TCP Connections Special FeaturesAdditional Information Programming Data Transfer on TCP ConnectionsKnown Problems Recommendations for Use with a High Communications LoadRemedy SEND/RECEIVE Interface in the User Program Configuring Communication Connections Program the SEND/RECEIVE interface in the user program ConfiguringSteps ProgrammingSimatic S5 Possible Connection ConfigurationsOrganization in a Multiproject Connections Characteristics of a ConnectionTasks of the Ethernet CP Requirements for Configuring Connections New Connection Creating a New ConnectionConfiguring Communication Connections Configuring Communication Connections Connections to Non-S7 Stations using Substitute Objects Connections to Partners in Other ProjectsHandling Connections in a Multiproject Unspecified Connections By any partner via specific Tsap EmptyTo or by a specific partner Configuring Communication Connections Further Functions ToolbarPrint Function in the Overview Tab Partner Connections Without AssignmentAssignment to a CP Menu option Edit ConnectionRemain without assignment Connection Partner Display ExampleTabs Configuring ISO Transport ConnectionsIntroduction Opening the DialogGeneral Tab Specifying the Local Connection EndpointLaddr Attributes Description Access Local EndpointConnection Name Reference Only in Multiproject Block ParametersTsap MAC Specifying ISO Transport AddressesAddress Parameters TsapLocal and Remote TSAPs Tsap FormatAddresses Tab Unspecified ISO transport connection Default TSAPsData Transfer Attributes Description Access Connection EstablishmentSpecifying ISO Transport Dynamic Properties Dynamics TabAttributes Description Access Using Fetch Passive / Write Passive ISO Transport with the FETCH/WRITE ModeMessages in the Diagnostic Buffer System MemoryLinks to Other Systems Parameter Description Checking ISO Transport Connection PropertiesOverview Tab Connection Overview with Multiple CPUs in an S7 StationConfiguring ISO-on-TCP Connections Properties Specifying the Local Connection Endpoint Parameter Description Access Local Endpoint Address parameter Specifying ISO-on-TCP AddressesAddresses Tab Addresses Tab Unspecified ISO-on-TCP Connection ISO-on-TCP with the FETCH/WRITE Mode 117 Checking ISO-on-TCP Connection Properties Configuring TCP Connection Properties Specifying the Local Connection Endpoint 121 Specifying TCP Addresses Address Parameters and Connection TypesTCP Addresses Tab Specified TCP Connection PortsApplication / Note Port Addresses Addresses Tab Unspecified TCP Connection TCP with the FETCH/WRITE Mode System Memory Checking TCP Connection Properties Configuring UDP Connection Properties Specifying the Local Connection Endpoint Connection Name Reference Only in Multiproject 23 Sending and Receiving on One UDP Connection Specifying UDP AddressesAddresses Tab Specified UDP Connections Addresses Tab Unspecified UDP Connection UDP with Broadcast and Multicast When to Use Multicast instead of Broadcast ?135 Addresses Tab Connection to all Broadcast Nodes Addresses Tab Connection to all Multicast Nodes Checking the Properties of a UDP Connection Program-Controlled Addressing Free UDP ConnectionRouting to Distribute Load Routing to Distribute LoadProgramming FCs Functions and FBs for S7 Ethernet CPs Block Library General Notes on FCs / FBsWhich Block Version Should I Use? FCs and Module Replacement SparesProgramming FCs Functions and FBs for S7 Ethernet CPs Calling Communication Blocks for an S7-300 Setting Parameters for FC CallsSetting Block Parameters Automatically1 Response to Incorrect AddressesCause Reaction / Code Evaluating Status Codes Parameters for Specifying a CPU Data Area input parametersStatus Information output parameters Specifying the Data Area on the CPUCan be used with Meaning FCs for Configured ConnectionsAglsend / Aglrecv Working without the Job Header 8EH 0BH Working with the Job HeaderMeaning of the Block CallAgsend / Aglsend How the Block Works Time Parameter Declara Type Possible Remarks Tion Values Explanation of the Formal ParametersOn UDP Condition CodesOn ISO Transport8F3AH Done Error Status8F7FH BEU Example of Agsend160 Agrecv / Aglrecv 2 FC6 Agrecv / FC60 AglrecvProgramming FCs Functions and FBs for S7 Ethernet CPs Status code is updated at each block call Recv Input ANY NDR Output BoolStatus Output Word LEN Output INT NDR Error Status166 With FETCH/WRITE FCs for Access Coordination with FETCH/WRITELocks external data access Access with FETCH/WRITELocked = Aglock FETCH/WRITE Aglock FETCH/WRITE1 FC7 Aglock Locked Output Bool 2 FC8 Agunlock 172 Numeric Data / Resource Requirements of the FCs NameMC7 174 NCM S7 Diagnostics What You Should Already Know Diagnostic Options in StepWhere to Find Further Information OverviewFunctions of NCM S7 Diagnostics General diagnostic and statistical functionsMode-Dependent Functions Alternative Installing and Starting NCM S7 DiagnosticsStructure General Menu Commands Menu MeaningOptionsCustomize 181 Profibus Starting Diagnostics from the NCM Program GroupInitial Situation MPIStarting Diagnostics from the Properties Dialog of the CP InternetworkingTCP/IP Other Startup Options If the CP is in the RUN mode How to Use DiagnosticsCall-Specific Diagnostic Functions 187 Meaning Checklist for ‘Typical Problems‘ in a SystemProblem Possible Cause Identifying the Cause and Remedy Checklist for General CP FunctionsEvaluate status bytes in AG-SEND Communication Connections ChecklistEvaluate diagnostic buffer Check the user programFirmware Loader Load Files ApplicationFirmware Uses of the Firmware Loader1st Step NCM S7 Firmware Loader menu commandLoading Firmware Starting the Download3rd Step 2nd Step195 196 References References Sinec CP Order Numbers Glossary General Section NCM S7 for Industrial Ethernet GatewayIndustrial Ethernet MulticastSegment ServicesPROFInet ProtocolTransport layer SubnetSystem Transmission rateBase address Ind. Ethernet stationISO-on-TCP S5S5 connection Media Access Control MACMAC address RFC1006PROFInet PROFInet device, proxy Profibus devicePROFInet PROFInet devicePage FETCH/WRITE Structure of Write Frames Structure of Fetch Frames Dbnr Parameter ValuesS7 Address Area ORG IDAddress Area PI/PQ216 New in Release 04 / up to V5.1 SP2 New in Release 05 / V5.1 SP3Page Index-223 NCM S7 Technical Support Service & Support on the Internet
Related manuals
Manual 21 pages 33.88 Kb