background image

 

 

Applikationen & Tools 

Answers for industry. 

 

Configuring the SIMATIC FM 350-2 
Counter Module in SIMATIC PCS 7 
 

SIMATIC PCS 7 

Application Description   December 2013 
 
 
 

 

Summary of Contents for SIMATIC FM 350-2

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

Page 2: ...ed Such an exclusion shall not apply 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 body or health guarantee for the quality of a product fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract wesentliche Vertragspflichten The damages for a breac...

Page 3: ...ction to counting 14 2 5 2 Continuous counting 15 2 5 3 Single Counting 16 2 5 4 Periodic counting 17 2 5 5 Frequency measurement 18 2 5 6 Rotational speed measurement 18 2 5 7 Time period measurement 19 3 Configuration 20 3 1 Requirements for configuring the counter module 20 3 2 Configuring the counter module in HW Config 26 3 3 Creating data areas in the symbol table 30 3 4 Adding a driver bloc...

Page 4: ...ter the process image has been read Figure 1 1 shows the execution of an OB It illustrates the writing of the outputs PIQ and reading of the inputs into the PII at the start of the cycle After this the program code is edited for example by a function block FB If an input signal changes during program processing this change is not applied to the process image For the called FB Figure 1 1 this means...

Page 5: ... speed Typical tasks for counter modules are Continuous counting up down Single counting up down Periodic counting up down Frequency measurement Rotational speed measurement Time period measurement Dosing You can start and stop the count process either via the user program software or via external signals hardware Count gate and direction signals can be connected directly to the counter module Adv...

Page 6: ...emens com WW view en 1105178 1 3 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 No Order no Note FM 350 2 1 6ES7 350 2AH00 0AE0 Alternatively newer ...

Page 7: ...ware components Table 1 2 Software components used Component No Order no Note SIMATIC PCS 7 V8 0 1 6ES7658 5AX08 0YA5 V8 0 SP1 FM Configuration Package 1 The configuration interface is supplied with the counter module or can be found in the following entry http support automation si emens com WW view en 6 0237759 ...

Page 8: ... support automation siemens com WW view en 1105178 2 1 Hardware information Each of the counter module s eight channels has three digital inputs and one digital output The counter module s signal inputs are labeled with the letter A the direction input with the letter B the hardware gate with the letter I and the output with the letter Q The number after the letter indicates the channel to which t...

Page 9: ...see the driver block with labels for the most important inputs and outputs Figure 2 2 Pcs7Cnt1 FB1833 User defined name Counter channel data connection Software gate Comparison value Output counter value Output measured value Load value Input for load command Feedback for module channel state Connection to upstream diagnostic block NOTICE If you do not assign the Connect input the compiler of the ...

Page 10: ...gate and a hardware gate that are connected by a logical AND The software gate is an interface of the Pcs7Cnt1 driver block and the hardware gate is a digital input on the module The hardware gate is deactivated in the basic setting and can be separately activated for each channel in the hardware configuration The software gate does not have a deactivation function similar to the one available for...

Page 11: ...m the existing value in the counter when a reactivation occurs Table 2 1 Overview of counter behavior when the internal gate is set and the hardware gate has not been activated in the configuration Configuration SW gate Internal gate Behavior Canceling Set to TRUE The start value is loaded Counting begins from this value Interrupting Counting continues from the current count positive edge If you w...

Page 12: ...activated as long as the internal gate is active When the internal gate is set to FALSE the channel is deactivated The driver block s measurement output provides the old measured value until the next activation of the channel Here the selection of interrupt or cancel is not possible Note In the first measuring cycle the measured value output is 1 The reason for this feature is so that the first me...

Page 13: ...nels 0 and 2 For example if you assign channel 0 to a DWORD data area you can no longer use channel 1 The reason for this is that channel 0 blocks the process image data area that was reserved for channel 1 The same thing applies to channel 2 with respect to channel 3 Table 2 3 Possible configurations of channels 0 3 WORD only Mixed configurations DWORD only Channel 0 Channel 0 Channel 0 Channel 0...

Page 14: ...Single count Periodic counting Each time a positive edge is registered by the counter module the module increases the value by a count of one If the count direction down is selected it decreases the value by one Below you can see a diagram with the input signal and the counter reading This is an example intended to illustrate that irregular signals can also be present In the following chapters the...

Page 15: ...unter reaches the high count limit when counting up and another count pulse is received it jumps to the low count limit and continues to count from there without any pulse losses If the counter reaches the low count limit and another count pulse is received it jumps to the high count limit and continues to count from there without any pulse losses Figure 2 5 Time diagram for continuous counting up...

Page 16: ...unter module performs the following counts once when the internal gate is activated Between 0 and the assigned end value in the main count direction up 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 ...

Page 17: ...direction up From the assigned start value to the end value 0 1 in the main count direction down If one of the assigned count limits is reached the counter jumps back to the start value when the next pulse is received The counter channel continues to count from there 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...

Page 18: ...t is 1 The reason for this feature is so that the first measuring cycle can be differentiated from the real system values that are either 0 or greater The measured value is output in mHz at the driver block Figure 2 8 Time diagram for frequency measurement 2 5 6 Rotational speed measurement In this mode which is virtually identical to the frequency measurement mode the FM 350 2 counts the pulses r...

Page 19: ...e the counter module measures the exact time between two positive edges of the count signal by counting pulses of an internal reference frequency 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 ...

Page 20: ...TIC Manager you must install a configuration package This package is provided with the counter module and can be downloaded from the Industry Online Support Portal 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 configurati...

Page 21: ...ndow 3 Start the file extraction by clicking on the Unzip button Once the extraction has been successfully completed the WinZip Self Extractor dialog window opens 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 ...

Page 22: ...6298 22 Copyright Siemens AG 2013 All rights reserved 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 ...

Page 23: ...V1 0 Item ID 83146298 23 Copyright Siemens AG 2013 All rights reserved 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 ...

Page 24: ...eserved 9 Read the license agreement If you agree to the conditions select the check box and click the Next button 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 ...

Page 25: ... Module SIMATIC FM 350 2 V1 0 Item ID 83146298 25 Copyright Siemens AG 2013 All rights reserved 1 Once the installation has been successfully completed click the Finish button Figure 3 10 Successfully completing installation ...

Page 26: ...r module in HW Config Requirements SIMATIC PCS 7 project Your hardware is configured outside of the FM 350 2 counter module Procedure 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 Note The hardware pictured below may differ from your own ...

Page 27: ...e ET 200M into which the counter module is to be integrated Figure 3 12 HW Config Selected interface module IM 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 ...

Page 28: ...ow the Specify Channels menu interface is displayed Keep the default settings and click on the OK button Figure 3 14 Channel specification for the FM 350 2 counter module Note If the following window is displayed when you open the configuration interface for the FM 350 2 counter module click the OK button When you click the OK button the configuration is saved and the configuration interface opens...

Page 29: ...yright Siemens AG 2013 All rights reserved 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 ...

Page 30: ... Note The start address can be found in the HW configuration It is the first address displayed in the input range Channels in the process image Channel 0 Start address 8 bytes EW 520 Channel 1 Start address 10 bytes EW 522 Channel 2 Start address 12 bytes EW 524 Channel 3 Start address 14 bytes EW 526 Note You can find information on the use of DWORD data formats in chapter 3 6 9 Channels outside ...

Page 31: ...nt view of your project 3 Select the S7 program of your automation system Figure 3 17 Symbol table in the component view 4 Open the symbol table by double clicking on the icon 5 Enter the channel addresses in the symbol table Note The contents of your symbol table may be different from the contents pictured Figure 3 18 Changes in the symbol table ...

Page 32: ...3 Configuration Counter Module SIMATIC FM 350 2 V1 0 Item ID 83146298 32 Copyright Siemens AG 2013 All rights reserved 6 Save the symbol table and close the symbol editor Figure 3 19 Symbol Editor ...

Page 33: ...Vxx is not used as the master data library Procedure 1 In the File menu select the Open command The Open Project dialog box is displayed 2 Open the Libraries tab 3 Select the PCS 7 AP Library V80 library and your master data library from the list 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 L...

Page 34: ...ommand Figure 3 21 7 Select the Pcs7Cnt1 driver block FB 1833 and SelST16 FC 369 8 Open the context menu by right clicking the selection and select the Copy menu command 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 ...

Page 35: ...the technology view of your project 2 Optional Generate your CFC chart for the driver block if it does not already exist 3 Open the CFC chart in which the driver block is to be used 4 In the catalog switch to the Libraries tab 5 In the navigation pane open the S7 Program 1 Blocks Channel folder in your project library 6 Drag the Pcs7Cnt1 driver block to the desired location in the CFC chart Figure...

Page 36: ...IC FM 350 2 V1 0 Item ID 83146298 36 Copyright Siemens AG 2013 All rights reserved 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 ...

Page 37: ... 2 V1 0 Item ID 83146298 37 Copyright Siemens AG 2013 All rights reserved 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 ...

Page 38: ... Compile your CFC chart If the connection was successful you will not receive any error messages and additional interconnections will be created as pictured below Figure 3 27 Successful compilation of the driver block Note If the new interconnections are not immediately displayed refresh the CFC chart using the F5 button ...

Page 39: ...error message stating that the FM_DATA connection cannot be interconnected by your driver block check your data area again and save and compile your hardware settings for the 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 ...

Page 40: ...r the individual channels of the FM 350 2 counter module 3 6 1 Continuous counting Requirements The FM 350 2 counter module has been added in the HW Config The driver block is connected to a channel Procedure 1 Open the SIMATIC Manager 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 b...

Page 41: ...el you wish to configure for continuous counting 6 Open the Operating Mode menu by double clicking the center button 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 ...

Page 42: ...he changes to the configuration of the FM 350 2 counter module and close the window Figure 3 32 Configuration interface for the 350 2 counter module 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 ...

Page 43: ...order to use the gate function both the software gate channel driver and the hardware gate digital input of the module must be activated Result 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 ...

Page 44: ...rements The FM 350 2 counter module has been added in the HW Config The driver block is connected to a channel Procedure 1 Open the SIMATIC Manager 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 ...

Page 45: ...5 Copyright Siemens AG 2013 All rights reserved 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 ...

Page 46: ...bled and ready for parameter assignment The default value is the high count limit Figure 3 37 Configuration interface for operating modes Note When you assign the main count direction up the start value is 0 and you define the end value 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 ...

Page 47: ...G 2013 All rights reserved 10 Save the changes to the configuration of the FM 350 2 counter module and close the window 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 ...

Page 48: ...wGateEn input to TRUE to activate the channel Figure 3 40 Pcs7Cnt1 driver block NOTICE In order to use the gate function both the software gate channel driver and the hardware gate 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...

Page 49: ...s The FM 350 2 counter module has been added in the HW Config The driver block is connected to a channel Procedure 1 Open the SIMATIC Manager 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 ...

Page 50: ...pyright Siemens AG 2013 All rights reserved 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 ...

Page 51: ...text box for the signal sampling time becomes active and can be configured Figure 3 43 Configuration interface for operating modes Note Note that the first measured value is only calculated after the sampling time has passed In the first measuring cycle the measured value output is 1 9 Click the OK button to close the window ...

Page 52: ...G 2013 All rights reserved 10 Save the changes to the configuration of the FM 350 2 counter module and close the window 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 ...

Page 53: ...iver block NOTICE In order to use the gate function both the software gate channel driver and the hardware gate digital input of the module must be activated Result You have configured a channel with a measurement function You can read off the counted input signals at the PV1 output on the driver block The PV2 output provides the measured value Note Units for the PV2 output Frequency measurement m...

Page 54: ...ements The FM 350 2 counter module has been added in the HW Config The driver block is connected to a channel Procedure 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 ...

Page 55: ...013 All rights reserved 5 Select the channel you wish to configure 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 ...

Page 56: ...ck the OK button to close the window 9 Save the changes to the configuration of the FM 350 2 counter module and close the window 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 ...

Page 57: ...le SIMATIC FM 350 2 V1 0 Item ID 83146298 57 Copyright Siemens AG 2013 All rights reserved Result You have activated the channel s hardware gate Now the channel will only be activated if the software and hardware gates are active ...

Page 58: ...counter module has been added in the HW Config The driver block is connected to a channel You have configured one of the counting functions on the channel Procedure 1 Open the SIMATIC Manager 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 modul...

Page 59: ...ghts reserved 5 Select the channel you wish to configure 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 ...

Page 60: ...ck the OK button to close the window 9 Save the changes to the configuration of the FM 350 2 counter module and close the window 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 ...

Page 61: ...reserved Result You have configured the behavior of the counter channel When the internal gate is set again the current value will continue to be used or the start value will be reloaded depending on your configuration Note An overview of the behavior of the counter module channels can be found in chapter 2 3 2 ...

Page 62: ...p In this chapter you will find the configuration instructions for inverting this input Note The Pcs7Cnt1 driver block does not have an input at which you can can change the count direction Requirements The counter module has been added in the HW Config The driver block is connected to a channel You have configured one of the counting functions on the channel Procedure 1 Open the SIMATIC Manager 2...

Page 63: ...ns AG 2013 All rights reserved 5 Select the channel you wish to configure 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 ...

Page 64: ...ck the OK button to close the window 9 Save the changes to the configuration of the FM 350 2 counter module and close the window 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 ...

Page 65: ...ation Counter Module SIMATIC FM 350 2 V1 0 Item ID 83146298 65 Copyright Siemens AG 2013 All rights reserved Result You have negated the channel s direction input The channel counts down for FALSE and up for TRUE ...

Page 66: ...he three measurement modes has been configured then it is not possible to load values Procedure 1 Open the CFC chart with the Pcs7Cnt1 driver block 2 Enter the desired value at the LoadPV1_ input Note If the value exceeds the assigned counter limit then the value is changed to the negative or positive value An overview of the channel counter limits can be found in chapter 2 4 Figure 3 62 Pcs7Cnt1 ...

Page 67: ...AG 2013 All rights reserved Result 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 ...

Page 68: ...block is connected to a channel You have configured one of the counting functions on the channel Note If one of the three measurement modes has been configured then it is not possible to load values Procedure 1 Open the SIMATIC Manager 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 b...

Page 69: ... Siemens AG 2013 All rights reserved 5 Select the channel you wish to configure 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 ...

Page 70: ...served 8 Click the OK button to close the window 9 Save the changes to the configuration of the FM 350 2 counter module and close the window 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 ...

Page 71: ...omparison value at the CmpV0 input Figure 3 68 Pcs7Cnt1 driver block Result You have assigned the comparison parameter for the channel s output The output provides a TRUE if the comparison is true Otherwise the output provides a FALSE You can monitor this on the driver block at the CmpVal0 output Note If you haven not assigned a comparison parameter for the output the output will be permanently se...

Page 72: ...ter 2 4 of this document Requirements The counter module has been added in the HW Config For the counter limit extension of channel 0 channel 1 must be unassigned For the counter limit extension of channel 2 channel 3 must be unassigned Procedure 1 Open the SIMATIC Manager 2 Open your PCS 7 project multiproject Figure 3 69 SIMATIC Manager 3 Open the hardware configuration for your automation syste...

Page 73: ...3 All rights reserved 5 Open the following menu Edit Specify Channels Figure 3 70 HW Config Edit menu 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 ...

Page 74: ...served 7 Click the OK button to close the window 8 Save the changes to the configuration of the FM 350 2 counter module and close the window 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 ...

Page 75: ...ane Figure 3 74 Symbol table in the component view 14 Open the symbol table by double clicking on the icon 15 Change the input words EW of the channels on which you extended the counting range into input double word ED Accordingly delete the EW of the blocked channel e if you have extended the counting range of channel 0 EW520 Change EW520 to ED520 and delete EW522 16 Save the symbol table and clo...

Page 76: ...right Siemens AG 2013 All rights reserved 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 ...

Page 77: ...served Note If you do not delete the necessary EW or if it is still interconnected with a channel driver then the 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 ...

Page 78: ... AG 2013 All rights reserved Result You have switched the counting range from Word to DWord You have extended the data area of the driver block in the symbol table You have connected the new larger data area to the driver block A larger data area is now available to the channel for counting ...

Page 79: ...m WW view en 83146298 2 SIMATIC PCS 7 overview collection of links for FAQ manuals compendium forum application examples and multimedia http support automation siemens com WW view en 63481413 3 Manual FM 350 2 Counter module http support automation siemens com WW view en 1105178 4 FM Configuration Package http support automation siemens com WW view en 60237759 5 History Table 5 1 Version Date Modi...

Reviews: