Siemens SIMATIC FM 350-2 Configuring

Counter module in simatic pcs 7

Advertisement

Configuring the SIMATIC FM 350-2
Counter Module in SIMATIC PCS 7
Application Description December 2013
Applikationen & Tools
Answers for industry.

Advertisement

Table of Contents
loading

Summary of Contents for Siemens SIMATIC FM 350-2

  • Page 1 Configuring the SIMATIC FM 350-2 Counter Module in SIMATIC PCS 7 SIMATIC PCS 7 Application Description December 2013 Applikationen & Tools Answers for industry.
  • Page 2: Warranty And Liability

    Internet. Further information can be found under the item ID 50203404. http://support.automation.siemens.com/WW/view/en/50203404 Siemens Industry Online Support This article is taken from the Siemens Industry Online Support. The following link takes you directly to the download page of this document: http://support.automation.siemens.com/WW/view/en/83146298 Counter Module SIMATIC FM 350-2...
  • Page 3: Table Of Contents

    Count direction ................62 3.6.7 Loading values ................66 3.6.8 Comparing the counter reading with a value ........68 3.6.9 Extending the counter limits ............. 72 Related literature ..................79 History ......................79 Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 4: Task

    The AS has to read the input whenever the signal changes. The following figure illustrates how a changing input signal provides the same measurement result every time the input is read. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 5: Solution

    Solution One possibility for the measurement of signals is the use of the SIMATIC FM 350-2 counter module. With its integration you can realize the following tasks for process automation:...
  • Page 6: Hardware And Software Components

    Hardware and software components 1.3.1 Validity This application applies to: SIMATIC PCS 7 V8.0 SP1 SIMATIC FM 350-2 firmware version V6.0 and higher 1.3.2 Components used The application has been created with the following components: Hardware components Table 1–1: Hardware components used Component Order no.
  • Page 7: Simatic Pcs

    Note SIMATIC PCS 7 6ES7658-5AX08-0YA5 V8.0 SP1 V8.0 FM Configuration The configuration interface is Package supplied with the counter module or can be found in the following entry: http://support.automation.si emens.com/WW/view/en/6 0237759 Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 8: Basic Principles Of The Counter Module

    For example, B5 is the direction input of the counter module's 5 channel. The inputs for direction, hardware gate and output are optional and do not need to be connected. Figure 2–1: Hardware scheme of the counter module Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 9: Pcs7Cnt1" Driver Block

    If you do not assign the Connect input, the compiler of the CFC editor generates NOTICE an error. In order to compile and load your project, you must assign this input. The configuration instructions for this can be found in chapter 3.5. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 10: Gate Function Of The Counter Channels - Activating, Interrupting And Canceling A Channel

    Figure 2–3: Digital logic with function table for the gate function The configuration instructions for activating the hardware gate can be found in Note chapter 3.6.4. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 11: Interrupting And Canceling A Counting Mode

    The start value is loaded. Counting begins from this value. Set to TRUE Counting continues from Interrupting the current count. - positive edge A description of the configuration can be found in chapter 3.6.4. Note Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 12: Interrupting A Measuring Mode

    In the first measuring cycle, the measured value output is "-1". The reason for Note this feature is so that the first measuring cycle can be differentiated from the real system values that are either "0" or greater. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 13: Counting Rages Of The Module Channels

    Channels 4-7 are read via the peripheral input words and counted in the DWORD area. Here, configurations of the counter range similar to those for channels 0-3 are not possible. DWORD (32-bit) counting range Note DWORD = -2,147,483,648 to 2,147,483,647 Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 14: Operating Modes For The Channels

    This is an example intended to illustrate that irregular signals can also be present. In the following chapters, the count will be portrayed using regular signals. Figure 2–4: Behavior of the counter reading in relation to the input signal Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 15: Continuous Counting

    Figure 2–5: Time diagram for continuous counting, up and down The configuration instructions for continuous counting can be found in Note chapter 3.6.1, and the instructions for loading values are in chapter 3.6.7. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 16: Single Counting

    Between the assigned start value and 0 in the main count direction "down." Once the count process has been completed, it is only repeated when the internal gate is set again. Figure 2–6: Time diagram for single counting, backward and forward Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 17: Periodic Counting

    For example, if you have assigned the value 100 as an end value for counting up, the counter module counts to 99 and then jumps to the value 0 when the next edge occurs. Figure 2–7: Time diagram for periodic counting, up and down Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 18: Frequency Measurement

    Here, the measured value from the first cycle is once again only available in the second time window. The rotational speed is output in 10 at the driver block. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 19: Time Period Measurement

    (1 MHz) with quartz accuracy. The measured value is only written to the output after the assigned time in the second cycle of the time window. The driver block outputs the measured value in ms. Figure 2–9: Time diagram for time period measurement Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 20: Configuration

    The link to the entry in the Industry Online Support Portal is as follows: http://support.automation.siemens.com/WW/view/en/1105178. Installing the configuration package 1. Start the self-extracting archive by double-clicking the configuration package. Figure 3-1: Self-extracting configuration package Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 21 Figure 3-2: Extracting the installation files 4. Click the "OK" button. Close the dialog window for the file extraction by clicking on the "Close" button. Figure 3-3: Dialog window following successful extraction Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 22 5. Launch the setup.exe file by double-clicking it in the destination folder. Figure 3-4: Setup.exe after extraction of the configuration package 6. Select the setup language and then click the "Next >" button. Figure 3-5 Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 23 7. Read the installation instructions and then click the "Next >" button. Figure 3-6 8. Read the product notes in the readme file and click the "Next >" button. Figure 3-7: Product information Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 24 Figure 3-8: License agreement 10. Select the check box for the FM 350-2 counter module from the list and then click the "Next >" button. Installation begins. Figure 3-9: Selection of modules for installation Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 25 3 Configuration Once the installation has been successfully completed, click the "Finish" button. Figure 3–10: Successfully completing installation Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 26: Configuring The Counter Module In Hw Config

    The hardware pictured below may differ from your own. Note 1. Open the SIMATIC Manager. 2. Open your PCS 7 project/multiproject Figure 3–11: SIMATIC Manager 3. Open the hardware configuration for your automation system. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 27 5. In the "PCS7_V80" profile of the hardware catalog, search for the FM 350-2 counter module. 6. Drag the FM 350-2 counter module from the catalog to the next free slot of the ET 200M. Figure 3-13 Counter module in the HW Config Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 28 FM 350-2 counter module, click the "OK" button: When you click the "OK" button, the configuration is saved and the configuration interface opens. If you click "Cancel," the interface does not open. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 29 8. Save the default settings and close the window. Figure 3–15: Configuration interface for the 350-2 counter module 9. Save and compile your hardware configuration. 10. Load your configuration to your automation system. Figure 3–16: HW Config Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 30: Creating Data Areas In The Symbol Table

    Channel 6: Start address + 6 bytes = EW 518 Channel 7: Start address + 7 bytes = EW 519 The following applies for the addressing of these channels (4-7): start address of the counter module + channel number. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 31 4. Open the symbol table by double-clicking on the icon. 5. Enter the channel addresses in the symbol table. The contents of your symbol table may be different from the contents pictured. Note Figure 3–18: Changes in the symbol table Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 32 3 Configuration 6. Save the symbol table and close the symbol editor. Figure 3–19: Symbol Editor Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 33: Adding A Driver Block In The Master Data Library

    Figure 3–20: Library selection 4. Click the "OK" button. The libraries are opened in the component view. 5. In the tree view, select the entry labeled "PCS 7 AP Library V80\Blocks + Templates\Blocks". Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 34 Figure 3–22: Detailed view of the APL V8.0 9. In your master data library, switch to the folder labeled "S7 program(1)/Blocks". 10. Open the context menu by right clicking the selection and select the "Paste" menu command. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 35: Connecting A Channel Data Area To The Driver Block

    6. Drag the "Pcs7Cnt1" driver block to the desired location in the CFC chart. Figure 3–23: CFC editor – Adding the driver block In the default setting, OB30 through OB38 are recommended for the use of the Note "Pcs7Cnt1" driver block. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 36 3 Configuration 7. Open the context menu by right-clicking the "Connect" terminal and select the "Interconnection to Address..." Figure 3–24: CFC editor – Interconnection to address Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 37 3 Configuration 8. Select the data area of the channel you wish to interconnect with the driver block. Figure 3–25: Selecting the addresses Figure 3–26: Input word connected to the driver block Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 38 Figure 3–27: Successful compilation of the driver block If the new interconnections are not immediately displayed, refresh the CFC chart Note using the "F5" button. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 39 FM 350-2 counter module. 10. Once the compilation has been successfully completed, load the CFC chart to your automation system. Figure 3–28: CFC editor – Compiling and loading Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 40: Configuring The Counter Module Channels

    2. Open your PCS 7 project/multiproject Figure 3-29: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the FM 350-2 counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 41 Figure 3-30: Configuration interface for the counter module – Channel selection 7. Select the "Continuous Counting" operating mode. 8. Click the "OK" button to close the window. Figure 3-31: Configuration interface for operating modes Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 42 10. Save and compile the HW Config. Figure 3-33: HW Config 11. Close the HW Config. 12. Open the CFC chart with the driver block. 13. Set the SwGateEn input to TRUE to activate the channel. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 43 You have configured an FM 350-2 counter module channel for continuous counting. The signals at the counter module will be processed in the channel. You can monitor the counter reading on the driver module at the PV1 output. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 44: Single/Periodic Counting

    2. Open your PCS 7 project/multiproject Figure 3–35: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the FM 350-2 counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 45 5. Select the channel you wish to configure. 6. Open the "Operating Mode" menu by double-clicking the center button. Figure 3–36: Configuration interface for the FM 350-2 counter module 7. Select "Single Counting" or "Periodic Counting." Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 46 When you assign the main count direction "down,” you define the start value and the end value is 0. 9. Click the "OK" button to close the window. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 47 Figure 3–38: Configuration interface for the 350-2 counter module 11. Save and compile the HW Config. 12. Load your configuration to your automation system. Figure 3–39: HW Config Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 48 (digital input of the module) must be activated. Result The FM 350-2 channel is configured for single or periodic counting. The function's start/end value has been assigned. The count value can be read out via the PV1 output. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 49: Measurements

    2. Open your PCS 7 project/multiproject Figure 3–41: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the FM 350-2 counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 50 5. Select the channel you wish to configure. 6. Open the "Operating Mode" menu by double-clicking the center button. Figure 3–42: Configuration interface for the 350-2 counter module 7. Select one of the channel's three measurement functions. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 51 Note that the first measured value is only calculated after the sampling time has Note passed. In the first measuring cycle,the measured value output is "-1". 9. Click the "OK" button to close the window. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 52 Figure 3–44: Configuration interface for the 350-2 counter module 11. Save and compile the HW Config. 12. Load your configuration to your automation system. Figure 3–45: HW Config Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 53 PV1 output on the driver block. The PV2 output provides the measured value. Units for the PV2 output: Note Frequency measurement = mHz -3 • Rotational speed measurement = 10 Time period measurement = ms Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 54: Hardware Gate

    1. Open the SIMATIC Manager. 2. Open your PCS 7 project/multiproject Figure 3–47: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 55 6. Open the "Operating Mode" menu by double-clicking the center button. Figure 3–48: Configuration interface for the 350-2 counter module 7. Select the "Use Hardware Gate" check box. Figure 3–49: Configuration interface for operating modes Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 56 Figure 3–50: Configuration interface for the 350-2 counter module 10. Save and compile the HW Config. 11. Load your configuration to your automation system. Figure 3–51: HW Config 12. Close the HW Config. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 57 3 Configuration Result You have activated the channel's hardware gate. Now, the channel will only be activated if the software and hardware gates are active. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 58: Canceling Or Interrupting The Counting Function

    2. Open your PCS 7 project/multiproject Figure 3–52: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the FM 350-2 counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 59 6. Open the "Operating Mode" menu by double-clicking the center button. Figure 3–53: Configuration interface for the 350-2 counter module 7. Select interrupt or cancel for a reset of the internal gate. Figure 3–54: Configuration interface for operating modes Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 60 Figure 3–55: Configuration interface for the 350-2 counter module 10. Save and compile the HW Config. 11. Load your configuration to your automation system. Figure 3–56: HW Config 12. Close the HW Config. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 61 An overview of the behavior of the counter module channels can be found in Note chapter 2.3.2. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 62: Count Direction

    2. Open your PCS 7 project/multiproject Figure 3–57: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the FM 350-2 counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 63 6. Open the "Encoders" menu by double-clicking top left button. Figure 3–58: Configuration interface for the 350-2 counter module 7. Select the "Inverted Direction" check box. Figure 3–59: Configuration interface for encoders Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 64 Figure 3–60: Configuration interface for the 350-2 counter module 10. Save and compile the HW Config. 11. Load your configuration to your automation system. Figure 3–61: HW Config 12. Close the HW Config. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 65 3 Configuration Result You have negated the channel's direction input. The channel counts down for FALSE and up for TRUE. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 66: Loading Values

    An overview of the channel counter limits can be found in chapter 2.4. Figure 3–62: "Pcs7Cnt1" driver block 3. When a positive edge is received at the "LoadDir" connection, the entered value is used as the current counter reading. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 67 You have entered your load value at the corresponding input. Whenever you send a positive edge to the "LoadDir" input, the current counter reading will be overwritten by the load value. Counting resumes starting at this value in your counter channel configuration. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 68: Comparing The Counter Reading With A Value

    2. Open your PCS 7 project/multiproject Figure 3–63: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the FM 350-2 counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 69 6. Open the "Outputs" menu by double-clicking the bottom right button. Figure 3–64: Configuration interface for the 350-2 counter module 7. Select the comparison type. Figure 3–65: Configuration interface – Outputs Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 70 Figure 3–66: Configuration interface for the 350-2 counter module 10. Save and compile the HW Config. 11. Load your configuration to your automation system. Figure 3–67: HW Config Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 71 FALSE. You can monitor this on the driver block at the "CmpVal0" output. If you haven not assigned a comparison parameter for the output, the output will Note be permanently set to TRUE. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 72: Extending The Counter Limits

    2. Open your PCS 7 project/multiproject Figure 3–69: SIMATIC Manager 3. Open the hardware configuration for your automation system. 4. Open the configuration interface by double-clicking the FM 350-2 counter module. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 73 6. If you wish to extend the counting range for channel 0, set "User_Type1" to DWord. For channel 2, set "User_Type2" to DWord. Figure 3-71: Specifying channels – DWord for "User_Type2" with a blocked channel 3. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 74 Figure 3-72: Configuration interface for the 350-2 counter module 9. Save and compile the HW Config. 10. Load your configuration to your automation system. Figure 3-73: HW Config Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 75 . if you have extended the counting range of channel 0 (EW520). Change EW520 to ED520 and delete EW522. 16. Save the symbol table and close the symbol editor. 17. Open the CFC chart with the driver block. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 76 18. Left-click the "Connect" input and select the "Interconnection to Address..." menu command. Figure 3-75: CFC editor – Interconnection to address 19. Select the changed address from the list in accordance with the channel. 20. Compile your CFC chart. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 77 CFC compiler will generate an error during compilation. 21. Once the compilation has been successfully completed, load the CFC chart to your automation system. Figure 3-76: CFC editor – Compiling and loading Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 78 You have connected the new, larger data area to the driver block. A larger data area is now available to the channel for counting. Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...
  • Page 79: Related Literature

    (collection of links for FAQ, manuals, compendium, forum, application examples and multimedia) Manual http://support.automation.siemens.com/WW/view/en/1105178 FM 350-2 Counter module FM Configuration http://support.automation.siemens.com/WW/view/en/60237759 Package History Table 5-1 Version Date Modifications V1.0 12/2013 First edition Counter Module SIMATIC FM 350-2 V1.0, Item ID: 83146298...

Table of Contents