50897766 s7 300 Asi Diag Lib Doku Classic v30 En

download 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

of 120

Transcript of 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    1/120

    Applications & Tools Answers for industry.

    Diagnostic Block with Visualizationvia HMI or Web Browser for ASInterfaceAS Interface, STEP 7 V5.x

    Library Description November 2013

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    2/120

    Warranty and Liability

    ASI_DIAGV30, Entry ID: 50897766 2

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Warranty and Liability

    Note The Application Examples are not binding and do not claim to be completeregarding the circuits shown, equipping and any eventuality. The applicationexamples do not represent customer-specific solutions. You are responsible forensuring that the described products are used correctly. These ApplicationExamples do not relieve you of your responsibility to use safe practices inapplication, installation, operation and maintenance. When using theseapplication examples, you recognize that we cannot be made liable for anydamage/claims beyond the liability clause described. We reserve the right tomake changes to these Application Examples at any time and without priornotice. If there are any deviations between the recommendations provided in thisapplication example and other Siemens publications e.g. catalogs thecontents of the other documents have priority.

    We do not accept any liability for the information contained in this document. Any claims against us based on whatever legal reason resulting from the use ofthe examples, information, programs, engineering and performance data etc.,described in this application example will be excluded. Such an exclusion will notapply in the case of mandatory liability, e.g. under the German Product Liability Act(Produkthaftungsgesetz), in case of intent, gross negligence, or injury of life, bodyor health, guarantee for the quality of a product, fraudulent concealment of adeficiency or breach of a condition which goes to the root of the contract(wesentliche Vertragspflichten). The damages for a breach of a substantialcontractual obligation are, however, limited to the foreseeable damage, typical forthe type of contract, except in the event of intent or gross negligence or injury tolife, body or health. The above provisions do not imply a change of the burden ofproof to your detriment.

    Any form of duplication or distribution of these application examples or excerptshereof is prohibited without the expressed consent of Siemens Industry Sector.

    Caution

    The functions and solutions described in this entry are mainly limited to therealization of the automation task. Please furthermore take into account thatcorresponding protective measures have to be taken in the context of industrialsecurity when connecting your equipment to other parts of the plant, the enterprisenetwork or the Internet. Further information can be found under the Entry ID50203404.

    http://support.automation.siemens.com/WW/view/en/50203404

    Siemens Industry Online Support

    This document is an article from the Siemens Industry Online Support. Thefollowing link takes you directly to the download page of this document:

    http://support.automation.siemens.com/WW/view/en/50897766

    http://support.automation.siemens.com/WW/view/en/50203404http://support.automation.siemens.com/WW/view/en/50897766http://support.automation.siemens.com/WW/view/en/50897766http://support.automation.siemens.com/WW/view/en/50203404
  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    3/120

    Table of Contents

    ASI_DIAGV30, Entry ID: 50897766 3

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Table of ContentsWarranty and Liability .............................................................................................. 2

    1 Task of the Library ......................................................................................... 5

    1.1 Field of application and benefits ......................................................... 5 1.2 Structure of the library ....................................................................... 5

    2 Library Content ............................................................................................... 9

    2.1 Function diagram ............................................................................... 9 2.2 Information on the program blocks ....... ....... ....... ........ ....... ....... ........ 10 2.2.1 Overview of the blocks ..................................................................... 10 2.2.2 Representation ................................................................................ 12 2.2.3 Call environment.............................................................................. 15 2.2.4 Resources and performance data .................................................... 16 2.3 Overview of the HMI template .......................................................... 18 2.3.1 The diagnostic screen ...................................................................... 18 2.3.2 The statistic screen .......................................................................... 25

    2.4 Overview of the web interface .......................................................... 26 2.4.1 The diagnostic screen ...................................................................... 26 2.4.2 The control board ............................................................................ 29 2.4.3 The statistic screen .......................................................................... 30 2.5 Hardware and software components ....... ........ ....... ....... ........ ....... .... 31 2.5.1 Validity ............................................................................................ 31 2.5.2 Components used ........................................................................... 31 2.6 Guide for the library documentation ................................................. 33

    3 The Program Blocks in Detail ...................................................................... 34

    3.1 The visualization blocks ASI PANEL FB and ASI WEB FB ......... . 34 3.1.1 Core functionality ............................................................................. 34 3.1.2 Managing the AS-i masters .............................................................. 34

    3.1.3 The data supply of the visualization screens (HMI, Web)...... ........ .... 35 3.1.4 Reset after CPU restart.................................................................... 37 3.2 The ASI DIAG FB diagnostic block ................................................ 38 3.2.1 Processing requirements ................................................................. 38 3.2.2 Core functionality ............................................................................. 39 3.2.3 Initialization phase ........................................................................... 39 3.2.4 Reading out of the diagnostic information............ ....... ....... ........ ....... 40 3.2.5 Reset after CPU restart.................................................................... 41 3.2.6 The Watchdog timer ........................................................................ 42 3.3 The control blocks ASI PANELCONTROL FB and ASI WEB

    CONTROL FB ................................................................................ 42 3.3.1 Core functionality ............................................................................. 42 3.3.2 Reset after CPU restart.................................................................... 43 3.4 The raw data of the ASI DIAG FB .................................................. 44 3.4.1 Overview of the diagnostic raw data ................................................. 44 3.4.2 Data structure in the instance data block ....... ....... ....... ........ ....... ...... 44 3.4.3 The structure of DataRecord_ASi_Slaves1 (IE/AS-i Link) ....... ........ .. 46 3.4.4 The structure of DataRecord_ASi_Slaves2 .............. ....... ....... ........ .. 47 3.4.5 The structure of Periphery_fault2 ..................................................... 48

    4 How to Work with the Example Project ....................................................... 49

    4.1 Addresses of hardware components ....... ....... ....... ........ ....... ....... ..... 49 4.2 Using the STEP 7 project ................................................................. 50 4.2.1 Parts of the STEP 7 project.............................................................. 50 4.2.2 Configuration notes.......................................................................... 51 4.2.3 Installing the STEP 7 project ............................................................ 53 4.3 Operating the STEP 7 project .......................................................... 55

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    4/120

    Table of Contents

    ASI_DIAGV30, Entry ID: 50897766 4

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    5 WinCC Flexible Configuration ..................................................................... 57

    5.1 The WinCC flexible project............................................................... 57 5.2 Using visualization screens .............................................................. 58 5.3 Adjusting the AS-i master selection list......... ....... ........ ....... ....... ....... 61 5.3.1 Logic operating diagram of the selection list ....... ........ ....... ....... ....... . 61

    5.3.2 Changes at the user interface .......................................................... 64 5.3.3 List position entries .......................................................................... 64 5.3.4 Integration of the AS-i master in the selection list ........ ....... ....... ....... 66 5.3.5 Definition of the text display for the selection list ........... ........ ....... .... 68 5.4 Adjusting the AS-i slave information ....... ....... ........ ....... ....... ........ ..... 69 5.4.1 Logic operating diagram of the AS-i slave display .......... ........ ....... ... 69 5.4.2 Integration of the AS-i master in the main list ........ ....... ....... ........ ..... 71 5.4.3 Definition of the information for the AS-i slaves ....... ........ ....... ....... ... 73 5.5 Implementing graphics ..................................................................... 75 5.5.1 Coordination of the graphics ............................................................ 75 5.5.2 Graphics display of the AS-i masters ............................................... 76 5.5.3 Graphics display of the AS-i slaves .................................................. 78

    6

    HTML Configuration ..................................................................................... 84

    6.1 Using web pages ............................................................................. 84 6.2 Adjusting the AS-i master information ....... ....... ....... ........ ....... ....... ... 86 6.3 Adjusting the AS-i slave information ....... ........ ....... ....... ........ ....... ..... 88 6.4 Adapting the display texts ....... ....... ....... ........ ....... ....... ........ ....... ...... 89 6.5 Accessing user-defined web pages ....... ........ ....... ....... ....... ........ ...... 90

    7 The ASI_DIAG Library ............................................................................... 92

    7.1 Prerequisites for using the blocks .................................................... 92 7.2 Integrating the library into STEP 7 V5.5 ........................................... 94 7.3 Using library blocks.......................................................................... 95 7.4 Initializing the blocks ...................................................................... 101 7.5 Enabling the web server ................................................................ 105 7.6 Creating a Web2PLC project ......................................................... 106 7.7 Generating the web data blocks ..................................................... 109 7.8 Changing the block properties to non-retain ........ ....... ....... ....... ...... 112 7.9 Loading the blocks into the CPU .................................................... 112

    8 Tips and Tricks ........................................................................................... 113

    8.1 Avoiding unnecessary processing of blocks ....... ....... ........ ....... .... 113 8.2 Visualization in the configuration view ....... ........ ....... ....... ........ ....... 115 8.3 Exporting and importing text lists ................................................... 116

    9 References .................................................................................................. 120

    10 History ........................................................................................................ 120

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    5/120

    1 Task of the Library1.1 Field of application and benefits

    ASI_DIAGV30, Entry ID: 50897766 5

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    1 Task of the Library

    1.1 Field of application and benefits

    AS-Interface slaves are connected with a SIMATIC controller via gateways orcommunication modules. An individual evaluation of the diagnostic data of the AS-imasters and slaves in the STEP 7 user program is very elaborate and therefore nota trivial matter.

    To simplify the AS-i diagnostic for the user, the present library contains a numberof blocks to be able to conveniently evaluate and visualize the diagnostic data:

    in the user program: The read AS-i diagnostic data is ready for individualfurther processing in a data block.

    on HMI panels: The library includes blocks that serve as interface betweenHMI panel and CPU.

    via web browser: SIMATIC CPUs with PROFINET interface provide theopportunity to access CPU variables with the help of individually designed webpages provided by the system. The library includes blocks that serve asinterface between user-defined web pages and CPU.

    1.2 Structure of the library

    The library is made up of three parts:1. A STEP 7 ASI_DIAG block library with the blocks relevant for the diagnosis

    and an additional file with the user-defined web pages for the web server of theCPU.This library is used for generating your own AS-i diagnostic applications.

    2. A STEP 7 example project ASI_DIAG_PROJECT in which the program blocks,the HMI templates and the web-based AS-i diagnostic are used as examples.

    3. This documentation for describing the application of library and exampleproject.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    6/120

    1 Task of the Library1.2 Structure of the library

    ASI_DIAGV30, Entry ID: 50897766 6

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The following tables briefly summarize the components of the code packages oncemore:

    Table 1-1

    Package name Component Application

    STEP 7 project ASI_DIAG_PROJECT

    All blocks relevant for the diagnosis andthe HMI and web visualization havealready been integrated into the projectand their configuration has beencompleted.

    Completed STEP 7 projectfor immediate usage (if yourown hardware configurationcorresponds to the onesupplied).

    STEP 7 library ASI_DIAG

    Relevant program blocks fordiagnostics, HMI and webvisualization of an AS-i network

    User-specific HTML pages andJavaScript for the visualization ofthe diagnostic information andoperation of the functions via web

    server.

    Creating your own diagnosticapplications

    Integration into alreadyexisting projects

    Visualization via HTML Visualization via HMI (copy

    HMI template from STEP 7project)

    Apart from the description of the code package, this document includes:

    a detailed description of the most important blocks regarding the corefunctionality and of the internal functional sequences.

    explanations regarding content and structure of the diagnostic information readfrom the AS-i master.

    This knowledge is vital for working without HMI templates and without HTMLpages.

    In any case, the documents listed in chapter 9 are recommended as accompanyingliterature.

    Scope of validity

    Supports all current AS-i masters from the SIMATIC product range:

    DP/AS-i Link 20E

    DP/AS-i LINK Advanced

    DP/AS-i F-Link

    IE/AS-i LINK Advanced

    CP 343-2 (P)

    ET200SP AS-i Master

    STEP 7 V5.5 SP3 and WinCC flexible 2008 Advanced are used as theconfiguration software.

    Note For further information on the hardware and software requirements refer tochapter 2.5 .

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    7/120

    1 Task of the Library1.2 Structure of the library

    ASI_DIAGV30, Entry ID: 50897766 7

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Schematic layout

    The figure below shows a possible hardware setup for the application of STEP 7blocks.

    Figure 1-1

    AS-Interface

    PROFIBUSPROFINET / IE

    ET 200SP IE/AS-i Link DP/AS-i Link

    DP/AS-i Link

    DP/AS-i F-Link

    S7-300 + CP 343

    HMI-Panel

    PG

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    8/120

    1 Task of the Library1.2 Structure of the library

    ASI_DIAGV30, Entry ID: 50897766 8

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    HMI visualization

    The figure below shows the HMI template for the visual diagnosis of AS-i mastersand slaves:Figure 1-2

    Web visualization

    The figure below shows the web interface for the visual diagnosis of AS-i mastersand slaves:Figure 1-3

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    9/120

    2 Library Content2.1 Function diagram

    ASI_DIAGV30, Entry ID: 50897766 9

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    2 Library Content

    2.1 Function diagram

    The figure below shows a schematic layout of the functionality of the AS-i library:Figure 2-1

    SIMATIC Station

    User programm

    Diagnostic data AS-i Master 1Diagnostic data

    AS-i Master 2Diagnostic data AS-i Master n

    AS-iMaster 2

    AS-iMaster 1

    AS-iMaster n

    ASI DIAG FB ASI PANEL FB

    Reading out & saving

    of diagnostic data

    HMIPanel

    Preparation &display

    Webbrowser

    ASI WEB FB

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    10/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 10

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    2.2 Information on the program blocks

    Overview of the blocks

    The following graphic shows the library blocks in its entity.Figure 2-2

    ASI DIAG FB

    ASI PANEL FB ASI WEB FB

    ASI PANEL

    CONTROL FB

    ASI WEB

    CONTROL FBWWW

    ASI WEB

    INTERFACE DB

    Diagnosis

    VisualizationHMI Panel Web browser

    Central diagnostic block

    The central ASI DIAG FB (FB157) block is used for the reading out andevaluating of the status of AS-Interface slaves and masters.

    The ASI DIAG FB" supplies the status bits for an AS-Interface line (master andslaves) respectively and stores the diagnostic data in the instance data block.

    Per AS-i master one call each of the ASI DIAG FB with independent instance datablock is needed.

    Visualization blocks

    To display the diagnostic data in a WinCC flexible environment on a panel and/orweb browser, the appropriate visualization blocks can optionally be used.

    ASI PANEL FB (FB154) for the visualization on a HMI panel

    ASI WEB FB (FB158) for the visualization via web.

    Note The data exchange between HMI panel and CPU is performed via the ASIPANEL FB instance data block.

    For user-defined web pages an instance data block is not permitted as interfacefor data exchange. This is why the web visualization uses a separate global ASIWEB INTERFACE DB data block (see "web blocks" section).

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    11/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 11

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Control blocks

    Particularly for the ET200SP-AS-i master other operating and monitoring interfacesare available on the panel and web browser.

    Statistic display

    Control board (only integrated in the web browser).

    For the ET200SP-AS-i master to respond to control commands of the user, thefollowing control blocks are responsible:

    ASI PANEL CONTROL FB (FB155) for control via the HMI panel

    ASI WEB CONTROL FB (FB156) for control via the web interface.

    Note The additional operating and monitoring interfaces are only selectable when theactive AS-i master is an ET200SP-AS-i master.

    As a result, the control blocks are also only required when there is an ET200SP- AS-i master in the AS-i network.

    Web blocks

    STEP 7 converts and saves the user-defined web pages as control DB and DBfragments via the Web2PLC tool. The WWW instruction triggers the call of thecoded and fragmented data blocks and the interaction between web page andSTEP 7 user program

    To access the CPU variables, the ASI WEB INTERFACE DB (DB6) global datablock is used next to the above mentioned diagnostic and visualization blocks.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    12/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 12

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Representation

    ASI DIAG FB

    The graphic below shows the FB157 in FBD representation:Figure 2-3

    The parameters have the following meaning:Table 2-1

    Type Variable Data type Defaultvalue

    Meaning

    I n p u

    t

    Master_Address DINT L#0 Logic address of the master module as LongINT e.g. L#1.

    ASi_Web_DB DINT L#0 Optional web visualization: Number of the ASIWEB FB instance data block.

    ASi_Panel_DB DINT L#0 Optional HMI visualization: Number of the ASIPANEL FB instance data block.

    MASTER_ID INT L#0 Device type of the AS-i master; the followingapplies1: IE/AS-i LINK Advanced2: DP/AS-i (F-)Link, CP343-1 (P), DP/AS-I Link(Adv.)3: ET200SP AS-i Master

    REQ BOOL 1 Request Bit; when there is a positive edge atREQ, the block will be processed.

    O u

    t p u

    tBUSY BOOL 0 True, when the block is processed.

    ERROR BOOL 0 True, when an error has occurred.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    13/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 13

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    ASI DIAG FB

    The graphic below shows the FB158 in FBD representation:

    Figure 2-4

    This block has no parameters.

    ASI PANEL FB

    The graphic below shows the FB154 in FBD representation:

    Figure 2-5

    This block has no parameters.

    ASI WEB CONTROL FB

    The graphic below shows the FB156 in FBD representation:Figure 2-6

    This block has no parameters.

    ASI PANEL CONTROL FB

    The graphic below shows the FB155 in FBD representation:

    Figure 2-7

    This block has no parameters.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    14/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 14

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    WWW instruction

    The graphic below shows the www instruction in FBD representation:Figure 2-8

    Table 2-2

    Type Variable Data type Defaultvalue

    Meaning

    Input CTRL_DB DINT L#0 Number of the control data block

    Output RET_VAL DWORD 0 Contains an error code in the event of an error.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    15/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 15

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Call environment

    Overview

    ASI DIAG must be called in the cyclic OB 1 and is enabled either by a parameterinput in the OB 1 call, or automatically by calling the block in an error or cyclicinterrupt OB.

    Enabling by means of another OB occurs by means of the error or cyclic interruptorganization block (OB). The block can be optionally integrated here.

    Enabling ASI DIAG FB via the error or cyclic interrupt OBs has the advantage thatthe block is only processed for certain situations (error or cyclic interrupt). Thisapproach saves unnecessary processing of the diagnostic block in the cyclicexecution level.

    Note The error and cyclic interrupt OBs are only active for one cycle; the ASI DIAG

    FB, however, takes several runs for its execution.Therefore, the block is only triggered in this OB. Further processing is handledby the cyclic OB 1.

    Per AS-i master one call each of the ASI DIAG FB with independent instancedata block is needed.So it is mandatory to call all ASI DIAG FBs in OB 1, while the calls in the erroralarms or cyclic interrupts are optional.

    For the visualization it is sufficient to call the respective blocks once in the cyclicOB 1 execution level. The following blocks are concerned

    For the HMI visualization: ASI PANEL FB ASI PANEL CONTROL FB

    For the web visualization ASI DIAG FB ASI WEB CONTROL FB WWW

    The following table summarizes all call types:Table 2-3

    OB 1 Error OB 8x Cyclic interrupt

    OB 3xASI DIAG FB (optional) (optional)

    ASI PANEL FB

    ASI PANEL CONTROL FB

    ASI DIAG FB

    ASI WEB CONTROL FB

    WWW instruction

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    16/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 16

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Error OBs

    When an error occurs, the AS-i master generates a diagnostic interrupt and sendsit to the CPU. In order to respond to the error with a defined (programmed)

    behavior, this alarm calls a respective organization block in the user program. OB 82: diagnostic interrupt OB

    OB 83: unplug/plug OB

    OB 84: CPU hardware error OB

    OB 85: program sequence error OB

    OB 86: module rack failure OB

    NOTICE Not all masters trigger a diagnostic interrupt for a slave I/O error. This is why anadditional call via a cyclic interrupt OB may be useful.

    Cyclic Interrupt OBs

    By using the cyclic interrupt OBs of S7 CPUs, certain program sequences can bestarted after up to nine equidistant time intervals. Numbers OB 30 OB 38 serveas cyclic interrupt OBs.

    The call in the cyclic interrupt OB has the function to poll the AS-i masters cyclicallyin a certain time grid. Errors can also be detected this way, even if the AS-i masterreports no diagnostic interrupt and hence causes no error OB call.

    Employing the cyclic interrupts avoids putting unnecessary load on the cyclic OB 1.

    Resources and performance data

    Library resourcesThe table below shows the size of the program blocks or instance data blocks inmain memory:Table 2-4

    No. Block Size Note

    1. ASI DIAG FB 6052 Bytes A separate instance data blockper AS-i line is required.2. Instance data blocks to

    ASI DIAG FB2548 Bytes

    3. ASI PANEL FB 2018 Bytes Only when a panel for operatingand monitoring is used.4. Instance data blocks to

    ASI PANEL FB772 Bytes

    5. ASI PANEL CONTROL FB 442 Bytes

    6. Instance data blocks toASI PANEL CONTROL FB

    180 Bytes

    7. ASI DIAG FB 1240 Bytes Only when a web browser foroperating and monitoring is used.8. Instance data blocks to

    ASI WEB FB670 Bytes

    9. ASI WEB CONTROL FB 630 Bytes

    10. Instance data blocks toASI WEB CONTROL FB

    172 Bytes

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    17/120

    2 Library Content2.2 Information on the program blocks

    ASI_DIAGV30, Entry ID: 50897766 17

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Number of AS-i masters

    One ASI DIAG FB per AS-i master is required for the visualization. Which masterstores its data under which instance data block number, is stored internally in listsin the ASI PANEL FB or ASI WEB FB.

    In ASI PANEL FB there is space for 255 list entries and therefore for 255 AS-imasters or AS-i lines, for ASI WEB FB the number of list entries is restricted to20, for reasons of performance.

    The real maximum number of ASI DIAG FBs in the project is largely dependenton the frame conditions. These include factors such as:

    CPU used and its computing power

    type of the FB calls(restrictions for the number of parallel running SFB 52/SFB 53 jobs)

    maximal OB 1 cycle time

    size of the work memory of the CPU

    Watchdog timer

    The watchdog timer prevents the diagnostic FB from being stuck in an infinite loop.This is preset to 400ms.

    Using the watchdog timer (TIME variable DBX2380.0 byte 4 in the instance datablock of the ASI DIAG FBs) enables analyzing the average processing time of ablock.

    AS-i performance data

    Up to 62 slaves can be connected per AS-i line, which are addressed as address1A - 31A and 1B - 31B. According to the specification, the update time is 5ms for31 slaves and up to 10ms for maximum configuration.

    Load memory capacity

    The user-defined web pages are coded in data blocks, fragmented and stored inthe load memory of the CPU. The size of the allocation area depends on thecontent of the web pages. Plug-in memory cards can increase the internal loadmemory of the CPU.

    The web pages of this application require a load memory of approx. 144kbytesstorage space.

    Restrictions for read/write record and command interface

    In the ASI DIAG FB library block, information on the status of the AS-i slaves is

    requested and read at the respective master via data records or the commandinterface. System functions SFB 52 (RDREC; read data record) and SFB 53(WRREC; write data record) are used for this.

    Depending on the CPU type, only a certain number of SFB calls, hence ASI DIAGFB calls as well, can be processed in parallel.The number varies between four (for smaller CPUs) and eight (for larger CPUs)simultaneous calls.Further information is available in the following FAQ: BID:15364459 .

    Note In most cases no particular action is required; but if it is, please note theapproach according to chapter 7.3 .

    http://support.automation.siemens.com/WW/view/en/15364459http://support.automation.siemens.com/WW/view/en/15364459
  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    18/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 18

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    2.3 Overview of the HMI template

    With the help of WinCC flexible, there is the option to visualize the AS-i network viaa panel.

    Note All the functions described in this chapter only work in conjunction with thefunction blocks.

    ASI DIAG FB ASI PANEL FB ASI PANEL CONTROL FB

    The diagnostic screen

    Overview of the layout of the AS-i master diagnosis

    The diagnostic screen provides the status of the configured AS-i masters and theirslaves clearly and graphically and therefore enables a convenient diagnosticoverview.

    The data required for this purpose is read via the ASI DIAG FB from the AS-imaster and prepared by the ASI PANEL FB.

    The AS-i diagnostic screen is subdivided into four areas:Figure 2-9

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    19/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 19

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The table below shows the meaning of the individual areas:Table 2-5

    No. Function

    1. Selecting and deselecting the AS-i master; each AS-i master is represented with itsbus.

    2. State of the AS-i master according to the AS-i specification.

    3. Overview and state of the slaves connected at the bus.

    4. Menu fields

    AS-i master selection

    The AS-i master is selected via a drop-down list. The following screenshot showsthe list with the five entries as an example:Figure 2-10

    Only those AS-i masters appear in the drop-down list which have previously loggedon at the ASI PANEL FB via their ASI DIAG FB with their instance data block

    number. More information can be found in chapter 0 (Initialization phase ). A graphic of the AS-i master and the slaves can also appear next to the displaytext.

    Note Information on how to change display texts or graphics and adding further AS-imasters is available in chapter 5 (WinCC Flexible Configuration ).

    Status of the AS-i master

    From all AS-i master connections information can be read or written via datarecords or command calls.

    Apart from information via the connected slaves, the AS-i master also providesappropriate status flags according to the AS-i specification.The flags of the selected AS-i masters are read and highlighted in color in WinCCflexible depending on their status.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    20/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 20

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Figure 2-11

    The meaning of the individual statuses is illustrated in the following table:Table 2-6

    Flag Display text Meaning

    AUTO_ADDR_ENABLE Automatic addressassignation enabled

    The flag indicates whether automaticaddressing is blocked (bit = 0) orenabled (bit = 1) by the user.

    OFFLINE_READY Offline The flag is set if the offline phase isactive.

    APF AS-i Power Fail The flag is set if the voltage at the AS-i line is too low.

    CONFIG_MODE AS-i Master inconfiguration mode

    The flag is set in the configurationmode and reset in protected mode.

    AUTO_ADDR_AVAIL Automatic addressassignation possible

    The flag is set if the automaticaddress programming can beperformed (i.e. if precisely one AS-islave has failed).

    LDS_0 Slave with address 0present

    The flag has been set if an AS-islave with address 0 exists.

    CONFIG_OK Configuration Error The flag is set when the setpointconfiguration and the actualconfiguration match.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    21/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 21

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    A diagnostic as shown in the example in figure 2-11 means the following state ofthe AS-i master:

    Automatic addressing is disabled.

    The AS-i master is in offline mode The voltage at the connected AS-i line is too low, or no AS-i line is connected.

    The AS-i master is in configuration mode

    The setpoint configuration does not correspond to the actual configuration.

    Slave state

    The Slave state area displays an overview of the configured slaves. A maximumof 62 slaves (31 A slaves and 31 B slaves) can be diagnosed. In addition, there isdiagnostic information for a possibly existing AS-i slave with the address 0.

    The status of the slaves is read via data records or command calls from the AS-imasters.

    With the Get_lists_and_flags call and if required Read_I/O_fault_list thefollowing entries are read from the AS-i master:

    List of active AS-i slaves (LAS)

    List of detected AS-i slaves (LDS)

    List of configured AS-i slaves (LPS)

    List of the present I/O error of the enabled AS-i slaves (LPF)

    Flags of the AS-i master according to AS-i specification.

    Using WinCC flexible, the slave states are symbolized via various backgroundcolors.

    Figure 2-12

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    22/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 22

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The following color assignments apply:Table 2-7

    Color Meaning

    Green The slave is detected, enabled and configured. No I/O error reported.Yellow The slave was detected but has not yet been configured.

    Orange The slave reports an I/O error.

    Red The slave is configured but has failed (disabled and/or not detected).

    Gray Slave is not configured and does not exist.

    Blueframe

    The AS-i master has not detected a multiple assignment of this address. Thisfunction is not supported by all AS-i masters. This function is available, e.g. forthe ET200SP AS-i master.

    For each slave a detailed description can be stored (e.g. MLFB number, location,function).

    A simple click on a slave displays the stored information and the current status inplain text in the output field.Figure 2-13

    Note How to store additional information on the slaves is described in chapter 5.4 ( Adjusting the AS-i slave information )

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    23/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 23

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Further states

    Apart from the states of the AS-i master and the AS-i slaves, failures from thevisualization environment are also displayed. These include messages, such as:

    No connection between CPU and visualization;

    CPU in stop;

    No data from ASI PANEL FB

    The visualization displays the messages in plain text, as shown in the figure below:Figure 2-14

    Checking whether the connection between CPU and display device exists, isimplemented via system messages. System messages at the operator panelprovide information of internal states of the operator panel and the controller.

    The table shows the possible states and the cause:Table 2-8

    Message text Trigger

    CPU in STOP No further value change at the counter in ASI PANELFB.

    Data missing from HMI block The AS-i master has not logged on to the ASI PANELFB or reports an internal error inASI DIAG FB.The ASI PANEL FB receives no or incorrectinformation.

    No connection to CPU Connection between CPU and visualization terminated.

    As soon as the CPU goes to stop or the data block of ASI PANEL FB supplies no

    further data, the status of the slaves is grayed.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    24/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 24

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Figure 2-15

    Menu fields

    The menu field is used to switch between languages, to change images and toterminate Runtime.Figure 2-16

    Note The Statistic menu field is only enabled if the currently selected AS-i master isan ET200SP AS-i master.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    25/120

    2 Library Content2.3 Overview of the HMI template

    ASI_DIAGV30, Entry ID: 50897766 25

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The statistic screen

    Overview of the AS-i statistic layout

    The statistic screen shows the error counter of AS-i masters and AS-i slaves.The data is read via the ASI DIAG FB from the AS-i master and prepared by theASI PANEL FB. The transmission of the function commands to the AS-i master isvia ASI PANEL CONTROL FB.Figure 2-17

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    26/120

    2 Library Content2.4 Overview of the web interface

    ASI_DIAGV30, Entry ID: 50897766 26

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    2.4 Overview of the web interface

    The combination of HTML and JavaScript provides an option to create user-defined

    websites for PROFINET CPUs and to carry out a web-based diagnosis of the AS-inetwork and perform online functions. All files (HTML, images, JavaScript, etc.) required for the display are converted tocontrol and fragment DBs via the Web2PLC tool. The WWW" instructioncyclically updates the website.

    Note For all the functions described in this chapter the following blocks are required: ASI DIAG FB ASI WEB FB ASI WEB CONTROL FB ASI WEB INTERFACE FB

    WWW all control and fragment DBs of the websites.

    The diagnostic screen

    Overview of the layout of the AS-i master diagnosis

    The diagnostic screen provides the status of the configured AS-i masters and theirslaves clearly and graphically and therefore enables a convenient diagnosticoverview.

    The data required for this, is read via the ASI DIAG FB from the AS-i master,prepared through the ASI WEB FB and provided to the website via theASI WEB INTERFACE DB interface. The screen of the AS-i web diagnostic issubdivided into four areas:Figure 2-18

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    27/120

    2 Library Content2.4 Overview of the web interface

    ASI_DIAGV30, Entry ID: 50897766 27

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The table below shows the meaning of the individual areas:Table 2-9

    No. Function

    1. Selecting and deselecting the AS-i master; each AS-i master is represented with itsbus.

    2. State of the AS-i master according to the AS-i specification.

    3. Overview and state of the slaves connected at the bus.

    4. Menu fields

    AS-i master selection

    The AS-i master is selected via a drop-down list and is transferred into the CPU viathe button next to it . The current AS-i master is displayed via a text field.

    The following screenshot shows the list:Figure 2-19

    AS-i master state

    Via a data record, information can be read or written through the AS-i masterconnection.

    Apart from information via the connected slaves, the AS-i master also providesappropriate status flags according to the AS-i specification.

    The flags of the selected AS-i masters are read and highlighted in color on the webinterface according to their status.Figure 2-20

    The meaning of the individual statuses is analog to the HMI visualization (seeTable 2-6 ).

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    28/120

    2 Library Content2.4 Overview of the web interface

    ASI_DIAGV30, Entry ID: 50897766 28

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Slave state

    The Slave state area displays an overview of the configured slaves. A maximumof 62 slaves (31 A slaves and 31 B slaves) can be diagnosed. In addition, there is

    diagnostic information for a possibly existing AS-i slave with the address 0.The state of the slaves is read via a data record from the AS-i master.

    With the Get_lists_and_flags call and if required Read_I/O_fault_list thefollowing entries are read from the AS-i master:

    List of active AS-i slaves (LAS)

    List of detected AS-i slaves (LDS)

    List of configured AS-i slaves (LPS)

    List of the present I/O error of the enabled AS-i slaves (LPF)

    Flags of the AS-i master according to AS-i specification.

    Using JavaScript, the slave states are symbolized via various background colors.Figure 2-21

    The color assignments are according to the color-coding of the HMI visualization(see Table 2-7 ).

    For each slave a detailed description can be stored (e.g. MLFB number, location,function).

    By simply clicking on a slave, the stored information and the current status isdisplayed as plain text in the output field underneath the Slave state area.Figure 2-22

    Note How to store additional information on the slaves is described in chapter 6.3 ( Adjusting the AS-i slave information )

    If the CPU or the AS-i master is no longer available, the states of the slaves aregrayed.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    29/120

    2 Library Content2.4 Overview of the web interface

    ASI_DIAGV30, Entry ID: 50897766 29

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Menu fields

    The menu field is for changing the language.Figure 2-23

    The control board

    Note The control board can only be selected for an ET200SP AS-i master.

    Overview of the AS-i control board layout

    The TIA Portal offers a control board for the ET200SP AS-i master in online mode,in order to directly perform functions from the portal. This control board isreproduced on the web interface. The following functions are available:

    Change operating mode

    Adopt slave configuration

    Transfer AS-i slave address

    The function commands are transferred via the ASI WEB INTERFACE DBinterface to the user program, prepared in the ASI WEB CONTROL FB and arealso sent through it to the AS-i master.

    The screen of the AS-i control board is subdivided into three areas.Figure 2-24

    The table below shows the meaning of the individual areas:Table 2-10

    No. Function

    1. Status of the AS-i master and changing the operating mode

    2. Adopt slave configuration

    3. Transfer AS-i slave address

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    30/120

    2 Library Content2.4 Overview of the web interface

    ASI_DIAGV30, Entry ID: 50897766 30

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The statistic screen

    Note The statistic overview can only be selected for an ET200SP AS-i master.

    Overview of the AS-i statistic layout

    The statistic screen shows the error counter of AS-i masters and AS-i slaves.Figure 2-25

    The values are read via the ASI DIAG FB from the AS-i master, prepared throughthe ASI WEB FB and are provided to the website via theASI WEB INTERFACE DB. The transmission of the function commands isanalogous to the control board.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    31/120

    2 Library Content2.5 Hardware and software components

    ASI_DIAGV30, Entry ID: 50897766 31

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    2.5 Hardware and software components

    Validity

    This application is valid for

    STEP 7 V5.5 SP3

    SIMATIC S7-300 from firmware 3.2 onward

    SIMATIC S7-400 from firmware 6.0 onward

    Components used

    Library requirements

    The library blocks are hardware independent and can be integrated in all STEP 7classic projects.

    The WinCC flexible visualization screens were optimized for the following operatorpanels:

    MP277 8 (resolution corresponds to the 10 panel)

    Runtime 15

    The following AS-i masters are supported here:

    DP/AS-i Link 20E (6GK1 415-2AA10)

    DP/AS-i LINK Advanced single master (6GK1 415-2BA10)

    DP/AS-i LINK Advanced double master (6GK1 415-2BA20)

    DP/AS-i F-Link (3RK3 141-1CD10 / 3RK3 141-2CD10) IE/AS-i LINK single master (6GK1 411-2AB10)

    IE/AS-i LINK double master (6GK1 411-2AB20)

    CP 343-2 (6GK7 343-2AH01-0XA0)

    CP 343-2P (6GK7 343-2AH11-0XA0)

    ET200SP AS-i Master (3RK7137-6SA00-0BC1)

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    32/120

    2 Library Content2.5 Hardware and software components

    ASI_DIAGV30, Entry ID: 50897766 32

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Hardware components of the example project

    The example project was created with the following components:Table 2-11

    No. Order number No. Component

    1. 6ES7317-2EK14-0AB0 1 CPU317-2 PN/DP

    2. 6GK1 415-2BA20 1 DP/AS-i LINK Advanced Double Master

    3. 6GK1 411-2AB20 1 IE/AS-i LINK Double Master

    4. 6GK7 343-2AH11-0XA0 1 CP 343-2P

    5. 3RK7137-6SA00-0BC1 1 CM AS-i Master ST

    6. 6ES7155-6AU00-0BN0 1 ET 200SP IM155-6 PN ST

    7. 6ES7193-6PA00-0AA0 1 Server module

    8. 6AV6643-0CB01-1AX5 1 HMI panel MP277 8

    Software components

    Table 2-12

    No. Order number No. Component

    1. 6ES7810-4CC10-0YA5 1 STEP 7 V5.5 Floating license

    2. 6AV6613-0AA51-3CA5 1 WinCC flexible 2008 Advanced

    3. Located on CD2 of theSTEP 7 installationsoftware

    1 Web2PLC (is only required for the webapplication)

    Software requirements for the web server

    The user-defined web pages were designed for Internet Explorer 8 andFirefox 11. A JavaScript is used for the interaction on the web page.

    Proper usage of the web visualization requires a mandatory activation ofJavaScript on your browser.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    33/120

    2 Library Content2.6 Guide for the library documentation

    ASI_DIAGV30, Entry ID: 50897766 33

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    2.6 Guide for the library documentation

    This document provides the user with an overview and if necessary a detailed

    description of the library blocks. Furthermore, short configuration instructions forthe following scenarios are shown:

    how the AS-i diagnostic blocks are used and configured in a project.

    how the preprogrammed visualization masks are used.

    For a convenient diagnosis of the AS-i slaves and AS-i masters, thepreprogrammed WinCC flexible projects can be used in conjunction with the ASIPANEL FB. This block prepares the diagnostic raw data of the AS-i masters andsupplies it to a panel.

    It is furthermore possible to process the actual diagnostic raw data in the userprogram. The supplied visualization options are optional. In this case, somechapters of this document become irrelevant for you.

    The table below shows the respective chapters:Table 2-13

    Chapter Panel+ASI DIAG FB

    Web interface +ASI DIAG FB

    Processingby user

    Chapter 2.3 Overview of the HMI template

    Chapter 2.4 Overview of the web interface

    Chapter 3.1 The visualization blocks ASI PANEL FBand ASI WEB FB

    Chapter 3.2 The ASI DIAG FB diagnostic block

    Chapter 3.3 The control blocks ASI PANELCONTROLFB and ASI WEB CONTROL FB

    Chapter 3.4 The raw data of the ASI DIAG FB

    Chapter 4 How to Work with the Example Project

    Chapter 5 WinCC Flexible Configuration

    Chapter 6 HTML Configuration

    Chapter 7 The ASI_DIAG Library

    Chapter 8.1 Avoiding unnecessary processing of blocks

    Chapter 8.2 Visualization in the configuration view

    Chapter 8.3 Exporting and importing text lists

    Chapter 9 References

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    34/120

    3 The Program Blocks in Detail3.1 The visualization blocks ASI PANEL FB and ASI WEB FB

    ASI_DIAGV30, Entry ID: 50897766 34

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    3 The Program Blocks in DetailThis chapter gives a detailed description of the library blocks regarding the corefunctionality and the internal function processes.

    Furthermore, content and structure of the diagnostic information read from the AS-imaster is explained. This knowledge is vital for working without visualization.

    3.1 The visualization blocks ASI PANEL FB and ASIWEB FB

    Note The visualization blocks ASI PANEL FB and ASI WEB FB are identical interms of functionality.Due to the application of use (ASI PANEL FB for the HMI panel andASI WEB FB for the web interface) they only differ in the way of the datapreparation.

    Core functionality

    The function blocks ASI PANEL FB and ASI WEB FB have two important tasks:

    managing the configured AS-i masters with the respective instance data blocknumber.

    Providing images for the AS-i master visualization in WinCC flexible and theweb browser with data.

    Managing the AS-i masters

    For storing diagnostic information and status about itself and its connected slaves,each AS-i master requires the ASI DIAG FB with its appropriate instance datablock.

    For the visualization in WinCC flexible or web browser the ASI PANEL FB or ASIWEB FB accesses the respective instance data blocks, reads out the informationand copies it to its appropriate instance data block.

    For assigning AS-i Master Instance data block number the visualizationblocks manage a master list in which all ASI DIAG FBs log on with the respectivenumber.

    The following screenshot gives an example of the master list with five logged onASI DIAG FBs:Figure 3-1

    The master list only shows which position refers to which data block number, anddoes not provide information on the respective AS-i master itself. You find theactual type (IE/AS-i link, PROFIBUS/ central processor module, ET200SP) stored

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    35/120

    3 The Program Blocks in Detail3.1 The visualization blocks ASI PANEL FB and ASI WEB FB

    ASI_DIAGV30, Entry ID: 50897766 35

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    in the respective ASI DIAG FB instance data block via the MASTER_ID inputparameter.

    Using this list, WinCC flexible and the website forms the display texts of theselection list for the AS-i master diagnostic screen (see chapter 5.3 Adjusting the

    AS-i master selection list as well as chapter 6.2 Adjusting the AS-i masterinformation) .

    Note The positions in the master list are decisive for the order of the AS-i masters inthe selection list and the visualization interfaces.

    Position [0] in the master list corresponds to position 1 in the selection list.

    The data supply of the visualization screens (HMI, Web)

    The second task of the visualization blocks is supplying the visualization screenswith the desired data.

    On the visualization screens the user is given the option, via the selection list, toselect an AS-i master configured in STEP 7.

    Depending on the AS-i master whose data is required, the raw information from therespective ASI DIAG FB instance data block is transferred to the appropriatevisualization block and prepared for display.

    The following graphic illustrates this procedure, using the example of an HMI panel.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    36/120

    3 The Program Blocks in Detail3.1 The visualization blocks ASI PANEL FB and ASI WEB FB

    ASI_DIAGV30, Entry ID: 50897766 36

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Figure 3-2

    Selection list in WinCC flexible Master list in ASI PANEL FB

    iDB101

    ASI PANEL FB

    iDB105

    ASI DIAG FBs

    Data record

    Row dataWinCC flex

    display

    Display in WinCC flexible

    iDB104

    Data record

    iDB103

    Data record

    iDB102

    Data recordData record

    iDB100

    DP/AS-i LinkiDB 100

    Get row data e.g. from iDB100

    Format data for the displayDisplay ofdiagnostic data

    WinCC flexible STEP 7 User program

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    37/120

    3 The Program Blocks in Detail3.1 The visualization blocks ASI PANEL FB and ASI WEB FB

    ASI_DIAGV30, Entry ID: 50897766 37

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Reset after CPU restart

    To remove old data from the instance data blocks of the blocks ASI PANEL FB

    and ASI WEB FB, the block properties of STEP 7 are accessed. Using the NonRetain keyword resets the data blocks to the loading values each time the networkis switched on and off and after each STOP-RUN transition of the CPU.Figure 3-3

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    38/120

    3 The Program Blocks in Detail3.2 The ASI DIAG FB diagnostic block

    ASI_DIAGV30, Entry ID: 50897766 38

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    3.2 The ASI DIAG FB diagnostic block

    Processing requirements

    For the program to run in ASI DIAG FB certain requirements must be fulfilled.

    The function block is equipped with an REQ input parameter, which is responsiblefor processing the program.

    Note Principally, the following applies:If REQ is connected to 0, the block will not be processed .

    The default setting for REQ is value 1.

    Overview

    Depending on the call environment, different responses are required at the REQinput of the ASI DIAG FB. The table below shows the respective responses:Table 3-1

    Call layer Status at REQ input Response

    OB 1 Positive edge Block FB157 is enabled andprocessed

    OB 1 Unconnected (defaultvalue at REQ is true)

    The block is only processed after it haspreviously been activated (throughanother OB error / cyclic interruptOB).

    OB 1 false The block is never processed.

    OB 8x, OB 3x Unconnected (defaultvalue at REQ is true)

    The block is activated (furtherprocessing occurs in OB 1).

    OB 8x, OB 3x false The block is never processed.

    Detailed description

    If the block is called up in an error or cyclic interrupt OB, no further connection isnecessary at the REQ input. The block is triggered if OB 8x/3x is called up (defaultsetting of the REQ input is 1).

    Since one cycle is not sufficient for processing the ASI DIAG FB, furtherprocessing occurs in OB 1 where the integration of ASI DIAG FB is thereforemandatory. REQ can also remain unconnected here, since a trigger has alreadybeen performed by another OB.

    If the function block shall be processed even without trigger by an error or cyclicinterrupt in OB 1, the REQ input must be triggered by a positive edge.

    Note Further information and examples on the interconnection and call options areavailable in chapter 7.3 ff. (Using library blocks) .

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    39/120

    3 The Program Blocks in Detail3.2 The ASI DIAG FB diagnostic block

    ASI_DIAGV30, Entry ID: 50897766 39

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Core functionality

    The ASI DIAG FB function block has two core functionalities:

    Organization of independent initialization. The AS-i master reports to thevisualization blocks if required.

    Reading the diagnostic information and flags from the AS-i master. The readdata is prepared, sorted and stored in the internal instance data block of the

    AS-i master.

    Since each AS-i master provides different data, it is mandatory that each AS-imaster has its appropriate ASI DIAG FB instance data block assigned to it.

    Initialization phase

    The AS-i master is initialized after calling the block and is necessary for laterprocessing of the WinCC flexible/web display as well as for reading out of thediagnostic information.

    In this phase the ASI DIAG FB logs in at the master list of the visualization blockby storing its instance data block number if visualization is desired.

    The following arrangement applies:Table 3-2

    Input parameters Value Response of the AS-i master block

    ASi_Web_DB >0 Login at the ASI WEB FB master list.

    ASi_Web_DB 0 No logon in the ASI WEB FB; visualization via webis not desired.

    ASi_Panel_DB >0 Login at the ASI PANEL FB master list.

    ASi_Panel_DB 0 No logon in the ASI PANEL FB; visualization viaHMI panel is not desired.

    The following diagram outlines this phase:Figure 3-4

    Has themaster already been

    initialized?

    Has themaster already been

    initialized?

    Jumpinitialization phase

    Jumpinitialization phase

    Entry in the master list

    of the "ASI WEB FB"

    Entry in the master list

    of the "ASI WEB FB"

    Master list in

    "ASI WEB FB"

    Master list in

    "ASI WEB FB"

    yes

    nein

    iDB number

    Input parameter

    ASi_Web_DB 0?

    Input parameter

    ASi_Web_DB 0?

    Entry in the master listof the "ASI PANEL FB"Entry in the master listof the "ASI PANEL FB"

    Master list in"ASI PANEL

    FB"

    Master list in"ASI PANEL

    FB"iDB number

    Input parameter ASi_Panel_DB 0?

    Input parameter ASi_Panel_DB 0?

    yes

    yes

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    40/120

    3 The Program Blocks in Detail3.2 The ASI DIAG FB diagnostic block

    ASI_DIAGV30, Entry ID: 50897766 40

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Reading out of the diagnostic information

    Prerequisite for the read out of diagnostic information is the initialization phase and

    the specification of the AS-i master type via the MASTER_ID input parameter.There are essential differences in the approach to read the diagnostic informationand flags from the AS-i master between the IE/AS-i link and PROFIBUS/central/ET200SP-AS-i master.

    The AS-i master is addressed via the Master_Address input parameter which isconfigured with the logic address from the hardware configuration.

    IE/AS-i LINK

    For the IE/AS-i Link (MASTER_ID = 1), reading occurs via a single Read datarecord command (data record number 84).Figure 3-5

    The content of the data record is stored in the instance data block of the AS-imaster.

    PROFIBUS/central/ET200SP AS-i master

    PROFIBUS-AS-i master, CP343-1 (P) (MASTER_ID = 2) and the ET200SP AS-imaster (MASTER_ID = 3) have a command interface via which the acyclic services

    are processed. The command interface is addressed respectively with data recordnumber 2 via the Read data record and Write data record commands.

    Unlike the IE/AS-i Link, a write data record command comes first, where thecommand number that is to be read is transferred. The status of the commandprocessing can be polled via so-called status nibbles (bit 7-4 of byte 1 of the logicaddress of the AS-i master). As soon as command processing has beencompleted, the results of the command can be fetched via a Read data recordcommand.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    41/120

    3 The Program Blocks in Detail3.2 The ASI DIAG FB diagnostic block

    ASI_DIAGV30, Entry ID: 50897766 41

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The sequence is represented as follows:Figure 3-6

    Iscommand processing

    complete?

    Send "read data record"command with data record

    number 2

    Save result ofcommand in iDB

    no

    yes

    Send"Write data record"

    commandwith data record number 2

    and command number

    Evaluate status Nibble(Bit 7-4)

    Note This sequence does not have to be implemented independently in the userprogram, but can be via the ASI_CTRL block.This block handles the command protocol independently and also enables the

    user to parameterize SIMATIC AS-i masters and to read out information data.Notes on this matter can be found here:http://support.automation.siemens.com/WW/view/en/51678777

    The ASI_CTRL is already integrated in the ASI DIAG FB. Because of this,nothing else has to be done.

    Note PROFIBUS devices and the ET200SP AS-i master only differ in terms of thecommand numbers and the structure of the read data. The functionality via thecommand interface is identical.

    Reset after CPU restart

    Deleting old information from the instance data blocks of the AS-i master requires areset function. Unlike the instance data blocks of the blocks ASI PANEL FB andASI WEB FB, this is not realized via the Non Retain block function, but code-based. The Non Retain should be enabled for the instance data blocks of all AS-imasters, which may quickly become confusing for several masters.

    The code-based reset is stored in ASI DIAG FB. After each processing thevariables that are no longer used are set to default values.

    http://support.automation.siemens.com/WW/view/en/51678777http://support.automation.siemens.com/WW/view/en/51678777
  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    42/120

    3 The Program Blocks in Detail3.3 The control blocks ASI PANELCONTROL FB and ASI WEB CONTROL FB

    ASI_DIAGV30, Entry ID: 50897766 42

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The Watchdog timer

    In order to prevent that the ASI DIAG FB is stuck in an infinite loop, there is a

    watchdog timer that is programmed as switch-on delay. A switch-on delay delays a rising edge by a defined time interval (PT), i.e. theoutput Q of the switch-on delay is only set to value 1 after this time interval haselapsed and stays in this state until the IN input changes to 0.

    If the input IN already changes to 0 before the delay time has elapsed, output Qremains on 0.

    In the time diagram the switch-on delay has been defined as follows:

    Figure 3-7

    In ASI DIAG FB this process has been realized as follows:

    At the beginning, the watchdog is started with a positive edge. If the program isrunning without errors and within the defined time interval of 400ms, the input ofthe timer is reset and the output remains 0.

    If the program gets stuck due to an error occurring during processing, and thedefined delay time elapses, the output of the timer is set and the program

    processing is cancelled. This procedure prevents the program from getting stuckin a step sequence.

    3.3 The control blocks ASI PANELCONTROL FB andASI WEB CONTROL FB

    Core functionality

    The control blocks ASI WEB CONTROL FB and ASI PANEL CONTROL FBhave the following tasks

    to respond to commands from the statistic screen or the control board.

    to prepare the respective command for the AS-i master and to transfer it to it.Commands from the visualization screens are among others:

    Change operating mode.

    Adopt slave configuration.

    Change AS-i slave address

    Select slave for the error counter.

    Delete the error counter on AS-i master or AS-i slave.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    43/120

    3 The Program Blocks in Detail3.3 The control blocks ASI PANELCONTROL FB and ASI WEB CONTROL FB

    ASI_DIAGV30, Entry ID: 50897766 43

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Note The control board and the statistic display are only available for the ET200SP- AS-i master. This is why it is only necessary to prepare the commands for thecommand interface.

    The ASI_CTRL block is used for the communication to the ET200SP-AS-imaster.

    Reset after CPU restart

    To remove old data from the instance data blocks of the blocks ASI PANELCONTROL FB and ASI WEB CONTROL FB, the block properties of STEP 7 areaccessed. Using the Non Retain keyword resets the data blocks to the loadingvalues each time the network is switched on and off and after each STOP-RUNtransition of the CPU.Figure 3-8

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    44/120

    3 The Program Blocks in Detail3.4 The raw data of the ASI DIAG FB

    ASI_DIAGV30, Entry ID: 50897766 44

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    3.4 The raw data of the ASI DIAG FB

    Processing the diagnostic raw data in the user program requires knowing which

    information is provided by the system and where it is located in the instance datablock of the ASI DIAG FB.

    Overview of the diagnostic raw data

    The status of the slaves and the AS-i masters is read from the AS-i masters viadata records or command calls.

    Calling Get_lists_and_flags and if required Read_I/O_fault_list provides thefollowing entries:

    List of active AS-i slaves (LAS)

    List of detected AS-i slaves (LDS)

    List of configured AS-i slaves (LPS) List of the present I/O error of the enabled AS-i slaves (LPF)

    Flags of the AS-i master according to AS-i specification.

    Each slave assigns one bit per list, hence, a list has 8 bytes of read data assignedto it.

    If the bit is FALSE, the AS-i slave is depending on the list not detected,disabled or not configured or does not indicate any I/O errors.

    Data structure in the instance data block

    For the IE/AS-i Link a total of 36 bytes are read and for the other AS-i master 48

    bytes.This has the result that the read lists have a different offset. The slave sequence isfurthermore not identical there.

    Due to these discrepancies, two data areas were declared for storing thediagnostic data of the AS-i masters in function block "ASI DIAG FB:

    For the IE/AS-i LINK: DataRecord_ASi_Slaves1(in the instance data block: byte 2290- byte 2325)

    For the remaining AS-i master: DataRecord_ASi_Slaves2

    (in the instance data block: byte 2326- byte 2357) PeripheryFault_2

    (in the instance data block: byte 2358- byte 2371)

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    45/120

    3 The Program Blocks in Detail3.4 The raw data of the ASI DIAG FB

    ASI_DIAGV30, Entry ID: 50897766 45

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Slave sequence in the lists

    For the IE/AS-i link and the ET200SP AS-i master the slaves are addressed inascending bit address.

    The following assignments apply:Table 3-3

    Slave no. Address (byte x beginning of list)

    0A Byte x, bit 0

    1A Byte x, bit 1

    2A Byte x, bit 2

    8A byte (x+1), bit 0

    9A byte (x+1), bit 1

    10A byte (x+1), bit 2

    0B byte (x+4), bit 0

    1B byte (x+4), bit 1

    2B byte (x+4), bit 2

    8B byte (x+5), bit 0

    9B byte (x+5), bit 1

    10B byte (x+5), bit 2

    For the remaining AS-i master the slaves are addressed in descending bitaddress.

    The following assignments apply:Table 3-4

    Slave no. Address (byte x beginning of list)

    0A Byte x, bit 7

    1A Byte x, bit 6

    2A Byte x, bit 5

    8A byte (x+1), bit 79A byte (x+1), bit 6

    10A byte (x+1), bit 5

    0B byte (x+4), bit 7

    1B byte (x+4), bit 6

    2B byte (x+4), bit 5

    8B byte (x+5), bit 7

    9B byte (x+5), bit 6

    10B byte (x+5), bit 5

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    46/120

    3 The Program Blocks in Detail3.4 The raw data of the ASI DIAG FB

    ASI_DIAGV30, Entry ID: 50897766 46

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The structure of DataRecord_ASi_Slaves1 (IE/AS-i Link)

    For the IE/AS-i link, all lists (LAS, LDS, LPS, LPF and AS-i master flags) required

    for the diagnosis are read with only one call (Get_lists_and_flags) and stored inthe DataRecord_ASi_Slaves1 data area.

    Structure of the information

    The following table shows the structure of the 36 bytes forDataRecord_ASi_Slaves1:Table 3-5

    Byte Address in iDB Description

    Byte [0] - Byte [1] DBB 2290 DBB 2291 Version ID

    Byte [2] Byte [9] DBB 2292 DBB 2299 List of activated slaves (LAS)

    Byte [10] Byte [17] DBB 2300 DBB 2307 List of detected slaves (LDS)

    Byte [18] Byte [25] DBB 2308 DBB 2315 List of configured slaves (LPS)

    Byte [26] Byte [33] DBB 2316 DBB 2323 List of present I/O faults (LPF)

    Byte [34] DBB 2324 AS-i master flags 1

    Byte [35] DBB 2325 AS-i master flags 2

    Bit granular description of the AS-i master flags

    Assignment and meaning of the bits for AS-i Master Flags 1 are given below:Table 3-6

    Bit Meaning

    0 CONFIG_OK

    1 LDS_0

    2 AUTO_ADDR_ASSIGN

    3 AUTO_ADDR_AVAIL

    4 CONFIG_MODE

    5 NORMAL_MODE

    6 APF

    7 OFFLINE_READY

    Assignment and meaning of the bits for AS-i Master Flags 2 are given below:Table 3-7

    Bit Meaning0 PERIPHERY_OK

    1 DATA_EXCHANGE_ACTIVE

    2 OFFLINE

    3 AUTO_ADDR_ENABLE

    4 GROUND_ERROR

    5 EPROM_OK

    6 reserved

    7 reserved

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    47/120

    3 The Program Blocks in Detail3.4 The raw data of the ASI DIAG FB

    ASI_DIAGV30, Entry ID: 50897766 47

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Example

    In the DataRecord_ASi_Slaves1 data structure, hence for Slave 1 , the followingaddresses are relevant:Table 3-8

    Address forslave 1A

    Address forslave 1B

    Meaning

    DBX 2292.1 DBX 2296.1 Slave active (LAS)

    DBX 2300.1 DBX 2304.1 Slave detected (LDS)

    DBX 2308.1 DBX 2312.1 Slave configured (LPS)

    DBX 2316.1 DBX 2320.1 I/O error (LPF)

    The structure of DataRecord_ASi_Slaves2

    For PROFIBUS/ ET200SP-AS-i master and CP343-1 (P), the lists LAS, LDS, LPSand AS-i master flags required for the diagnosis are read via theGet_lists_and_flags command and are stored in the DataRecord_ASi_Slaves2data area.

    Structure of the information

    The following table shows the structure of the 32 bytes forDataRecord_ASi_Slaves2:Table 3-9

    Byte Address in iDB Description

    Byte [0] - Byte [7] DBB 2326 DBB 2333 List of activated slaves (LAS)

    Byte [8] Byte [15] DBB 2334 DBB 2341 List of detected slaves (LDS)Byte [16] Byte [23] DBB 2342 DBB 2349 List of configured slaves (LPS)

    Byte [24] DBB 2350 AS-i master flags 1

    Byte [25] DBB 2351 AS-i master flags 2

    Byte [26] Byte [31] DBB 2352 DBB 2357 reserved

    Bit granular description of the AS-i master flags

    Assignment and meaning of the bits for AS-i Master Flags 1 are given below:Table 3-10

    Bit Meaning

    0 OFFLINE_READY1 APF

    2 NORMAL_MODE

    3 CONFIG_MODE

    4 AUTO_ADDR_AVAIL

    5 AUTO_ADDR_ASSIGN

    6 LDS_0

    7 CONFIG_OK

    Assignment and meaning of the bits for AS-i Master Flags 2 are given below:

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    48/120

    3 The Program Blocks in Detail3.4 The raw data of the ASI DIAG FB

    ASI_DIAGV30, Entry ID: 50897766 48

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Table 3-11

    Bit Meaning

    0 OFFLINE

    1 INTERNAL2 EEPROM_OK

    3 AUTO_ADDR_ENABLE

    4 PERIPHERY_FAULT

    5 reserved

    6 reserved

    7 MPO startup

    Example

    In the DataRecord_ASi_Slaves2 data structure, hence for Slave 1 , the followingaddresses are relevant:Table 3-12

    Address forslave 1A

    Address forslave 1B

    Meaning

    DBX 2326.7 DBX 2330.7 Slave active (LAS)

    DBX 2334.7 DBX 2338.7 Slave detected (LDS)

    DBX 2342.7 DBX 2344.7 Slave configured (LPS)

    The structure of Periphery_fault2

    The still missing LPF list is read through the Read_I/O_fault_list command forPROFIBUS/ ET200SP-AS-i master and CP343-1 (P) and is stored separately inthe Periphery_fault2 data area.

    Structure of the information

    The following table shows the structure of the 14byte for Periphery_fault2:Table 3-13

    Byte Address in iDB Description

    Byte [0] - Byte [7] DBB 2358 DBB 2365 List of present periphery faults (LPF)

    Byte [8] Byte [13] DBB 2366 DBB 2371 reserved

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    49/120

    4 How to Work with the Example Project4.1 Addresses of hardware components

    ASI_DIAGV30, Entry ID: 50897766 49

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    4 How to Work with the Example ProjectThis chapter shows how you can use the included ASI_DIAG_PROJECT STEP 7project without any changes .

    4.1 Addresses of hardware components

    Network addresses

    The SIMATIC station, the panel and the AS-i components have been configuredwith the following addresses:

    Figure 4-1

    Module address

    The AS-i masters are assigned the following addresses in the process image:Table 4-1

    AS-i Master Address

    IE/AS-i link interface 1 8184

    IE/AS-i link interface 2 8182

    ET200SP AS-i Master 273

    DP/AS-i link interface 1 124

    CP343-1P 256

    The symbolic flag tags are used throughout the STEP 7 project for the address andthe device type. This has the advantage that if the addresses in the project change,they only have to be adjusted in one position.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    50/120

    4 How to Work with the Example Project4.2 Using the STEP 7 project

    ASI_DIAGV30, Entry ID: 50897766 50

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    The assignment is in network 1 of OB100.Figure 4-2

    4.2 Using the STEP 7 project

    Parts of the STEP 7 project

    The STEP 7 ASI_DIAG_PROJECT project contains the following elements:

    Blocks, to conveniently provide diagnostic information of one or several AS-imaster systems for further evaluations in the STEP 7 user program and forrepresentation on a HMI panel or a web browser.

    HMI templates to visualize the diagnostic information on a HMI panel.

    User-defined web pages for visualizing the diagnostic information via the webserver of the CPU.

    You can find these projects in the download section of this document(see chapter 9).

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    51/120

    4 How to Work with the Example Project4.2 Using the STEP 7 project

    ASI_DIAGV30, Entry ID: 50897766 51

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Configuration notes

    Note The configurations below are already stored in the STEP 7 project

    ASI_DIAG_PROJECT.

    Login data

    For full access (write and read rights) to the user-defined websites on the CPU aprevious login is required.

    The login data as well as the respective rights are stored in the CPU properties inSTEP 7. In this example project, the user name and the password is siemens .Figure 4-3

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    52/120

    4 How to Work with the Example Project4.2 Using the STEP 7 project

    ASI_DIAGV30, Entry ID: 50897766 52

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Cyclic interrupt

    Employing the cyclic interrupts avoids putting unnecessary load on the cyclic OB 1.The call intervals can be specified in the CPU properties.Figure 4-4

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    53/120

    4 How to Work with the Example Project4.2 Using the STEP 7 project

    ASI_DIAGV30, Entry ID: 50897766 53

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Installing the STEP 7 project

    Note For the following installation instruction it is assumed that you are using theSTEP 7 project without any changes.Changes in the hardware configuration and addresses require an adjustment ofthe WinCC flexible projects (see chapter 5).

    When using the STEP 7 ASI_DIAG_PROJECT project the steps below must befollowed:

    Table 4-2

    Step Function Screen/Comment

    1. Set up your network in accordance with thespecifications in chapter 4.1 ( Addresses ofhardware components) .

    Connect any number of AS-i slaves to the AS-inetworks

    2. Connect one AS-i network with any numberof AS-i slaves per AS-i master.

    3. The ACTUAL configuration has to beaccepted for all AS-i masters as SETPOINTconfiguration.The approach is described in the respectivemanual (see chapter 9 References) .

    IE/AS-i link and DP/AS-i link: The ACTUAL/SETPOINT transfer can take place viathe display.For the ET200SP AS-i master the transfer is viathe SET button.In the CP343-1 P the ACTUAL/SETPOINTcomparison is via STEP 7.

    4. Unzip the50897766_ASI_DIAG_Classic_CODE_S7300.zip ZIP archive into a directory of yourchoice.

    The STEP 7 project is located in theASI_DIAG_PROJECT folder.

    5. Open the SIMATIC MANAGER and navigateto the project via File > Open.

    6. Check the module address of your AS-i master. If it deviates from yourconfigured address, the Master_Address block parameter of ASI DIAG FB must beadjusted each time it is called in theorganization blocks.When using a CP343-2 (P) please ensurethat the address is located in the processimage of the CPU.

    To facilitate the change of address, it is workedwith symbolic variables throughout the project.

    Assigning the module addresses to the symbolicvariables is performed in network 1 of OB 100.

    7. Save the changes.

    8. Download the project into your controller.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    54/120

    4 How to Work with the Example Project4.2 Using the STEP 7 project

    ASI_DIAGV30, Entry ID: 50897766 54

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    Step Function Screen/Comment

    9. Select the HMI station or Runtime and openit.

    10. WinCC flexible is opened.

    Compile the project.

    11. When the compilation was error free, loadthe project into the panel.

  • 8/12/2019 50897766 s7 300 Asi Diag Lib Doku Classic v30 En

    55/120

    4 How to Work with the Example Project4.3 Operating the STEP 7 project

    ASI_DIAGV30, Entry ID: 50897766 55

    C o p y r i g

    h t

    S i e m e n s

    A G 2 0 1 3 A l l r i g

    h t s r e s e r v e

    d

    4.3 Operating the STEP 7 project

    In this example project the two visualization variants are enabled by connecting thetwo inputs ASi_Web_DB and ASi_Panel_DB.Figure 4-5

    Visualization via the HMI panel

    Loading the HMI projects onto the panel automatically starts Runtime with