Application Example 06/2015 Key Panel Library / TIA Portal Configuration Manual https://support.industry.siemens.com/cs/ww/en/63482149
Warranty and Liability Warranty and Liability Note The application examples are not binding and do not claim to be complete with regard to configuration, equipment or any contingencies. The application examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for the correct operation of the described products. These application examples do not relieve you of the responsibility of safely and professionally using, installing, operating and servicing equipment. When using these Application Examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these Application Examples at any time and without prior notice. If there are any deviations between the recommendations provided in this Application Example and other Siemens publications e.g. catalogs the contents 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 of the examples, information, programs, engineering and performance data etc., described in this application example will be excluded. Such an exclusion will 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 compensation for damages due to a breach of a fundamental contractual obligation is, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these application examples or excerpts hereof is prohibited without the expressed consent of Siemens AG. Security information Siemens provides products and solutions with industrial security functions that support the secure operation of plants, solutions, machines, equipment and/or networks. They are important components in a holistic industrial security concept. With this in mind, Siemens products and solutions undergo continuous development. Siemens recommends strongly that you regularly check for product updates. For the secure operation of Siemens products and solutions, it is necessary to take suitable preventive action (e.g. cell protection concept) and integrate each component into a holistic, state-of-the-art industrial security concept. Third-party products that may be in use should also be considered. For more information about industrial security, visit http://www.siemens.com/industrialsecurity. To stay informed about product updates as they occur, sign up for a productspecific newsletter. For more information, visit https://support.industry.siemens.com. Entry ID: 63482149, V3.1, 06/2015 2
Table of Contents Table of Contents Warranty and Liability... 2 1 Preface... 4 1.1 Contents of this document... 4 1.2 Scope of validity of this documentation... 4 1.3 Correlation of the documentation... 4 2 Field of Application... 5 2.1 Task... 5 2.2 Solution... 5 2.3 Hardware and software components... 6 2.3.1 Validity... 6 2.3.2 Components used... 6 2.3.3 Sample files and projects... 6 3 Configuration Instruction... 7 3.1 Opening the library... 7 3.2 How to work with the library... 9 3.2.1 Introduction... 9 3.2.2 Procedure... 9 4 Description of the function blocks... 10 4.1 FC300... 10 4.1.1 Parameter... 10 4.1.2 Description... 11 4.1.3 Address assignment... 11 4.2 FB301... 12 4.2.1 Parameter... 13 4.2.2 Description... 13 4.2.3 Address assignment... 14 5 Links & Literature... 15 6 History... 15 Entry ID: 63482149, V3.1, 06/2015 3
1 Preface 1.1 Contents of this document 1 Preface 1.1 Contents of this document The document on hand describes the usage of the STEP 7 library for Key Panels. The library provides blocks for a simplified control of the keyboard LEDs. Previously, the colors of the LEDs were mixed by the respective output bits. 1.2 Scope of validity of this documentation This documentation applies for STEP7 library Key_Panels_Library. 1.3 Correlation of the documentation This documentation refers to the following operating instruction: SIMATIC HMI KP8/KP8F SIMATIC HMI KP32F Entry ID: 63482149, V3.1, 06/2015 4
2 Field of Application 2.1 Task 2 Field of Application 2.1 Task You wish to control the LEDs of a Key Panel. The buttons of the Key Panel shall light in the desired colors at the defined positions. 2.2 Solution Advantages The KeyPanel_Library provides you with program blocks which you can use for easily controlling and testing your Key Panel. The solution presented here, offers you the following advantages Save time and costs Expandability Assumed knowledge Basic knowledge of STEP 7 (TIA Portal) and possibly STEP 7 Safety is assumed. Entry ID: 63482149, V3.1, 06/2015 5
2 Field of Application 2.3 Hardware and software components 2.3 Hardware and software components 2.3.1 Validity This application is valid for STEP 7 as of V13 SP1 WinCC Advanced as of V13 SP1 S7-1200, S7-1500, S7-400, S7-300 Key Panels KP8 PN, KP8F PN, KP32F PN 2.3.2 Components used The application was created with the following components: Hardware components Table 2-1 Component Qty Article number Alternatives SIMATIC S7-1516F-3 PN/DP SIMATIC S7-315F-2 PN/DP Software components 1 6ES7 516-3FN00-0AB0 Other SIMATIC S7-1200 (F) or S7-1500(F) 1 CPUs 1 6ES7 315-2FH13-0AB0 Other SIMATIC S7-300 (F) or S7-400(F) 1 CPUs SIMATIC KP32F PN 1 6AV3 688-3EH47-0AX0 different Key Panel 1 Table 2-2 Component Qty Article number Note SIMATIC Step 7 (Safety 1 ) V13 SP1 1 6ES7.. 2.3.3 Sample files and projects The following list includes all files and projects that are used in this example. Table 2-3 Component 63482149_KeyPanel_Library.zip 63482149_Manual_en.pdf Note This zip file includes the library KeyPanel_Library for application in your STEP 7 project. This document. 1 F functionality of the CPU is necessary when using Key Panels with F functionality (KP8F PN and KP32F PN) and vice versa. Entry ID: 63482149, V3.1, 06/2015 6
3 Configuration Instruction 3.1 Opening the library 3 Configuration Instruction 3.1 Opening the library To open the KeyPanel_Library, please proceed as follows: Table 3-1 No. Action 1. Unzip the zip-file of the library into an empty directory. 1. Start the TIA Portal. 2. Select Options > Global Libraries > Open library from the menu. 3. Open the directory in which you have extracted the zip-file of the library. 4. Select the KeyPanel_Library.al13 file and then click on Open. 5. In the TIA Portal, you click on the Libraries tab on the right. 6. Double-click to open the library KeyPanel_Library. Entry ID: 63482149, V3.1, 06/2015 7
3 Configuration Instruction 3.1 Opening the library No. Action 7. Open the Master copies folder. 8. The blocks LED_Control and LED_Test can be adopted in your project via drag & drop. Entry ID: 63482149, V3.1, 06/2015 8
3 Configuration Instruction 3.2 How to work with the library 3.2 How to work with the library 3.2.1 Introduction The library contains two blocks each for the SIMATIC CPUs S7-1200 or S7-1500 and the SIMATIC CPU S7-300 or S7-400. Table 3-2 Block number Block name Function FC300 LED_Control Controlling the LEDs in any key of the Key Panel. Red, yellow, green, blue and white are possible colors in which the selected key can light up. Color and position of the key is given as formal operand at the FC. (See Table 4-1) FB301 LED_Test Lamp test: Controls all LEDs of the entire Key Panel. 3.2.2 Procedure Table 3-3 No. Action 1. Drag a block, for example FC300, from the KeyPanel_Library library into the program editor. 2. Open the organization block, in which you wish to call the function block, for example OB1 Main. 3. Drag the function block into a network of the organization block. 4. Assign the inputs according to the specifications in Table 4-1 and chapter 4.1.2 (for FC300) or Table 4-2 and chapter 4.2.2 (for FB301). Tip: When moving the cursor onto a parameter, a tooltip with the possible inputs is displayed. 5. After successful configuration, you load the parameterization into the controller and test the function. Entry ID: 63482149, V3.1, 06/2015 9
4 Description of the Function Blocks 4.1 FC300 4 Description of the Function Blocks 4.1 FC300 Validity Symbol This section describes the function of the FC300: Controlling the LEDs of a button. Figure 4-1 4.1.1 Parameter Table 4-1 Name Data type Memory area Description Range of values EN Bool I, Q, M, D, L, T, Z Enable input 0..1 Active Bool I, Q, M, D, L, T, Z Control input 0..n Type Int I, Q, M, D, L, const Number of keys of the Key Panel type Address Int I, Q, M, D, L, T, Z Base address of the Key Panel 8 or 32 KeyLedNr Int I, Q, M, D, L, const Target key number 0..7 (KP8(F)) 0..31 (KP32F) Color Int I, Q, M, D, L, const Desired color 0..5 0 off 1 red 2 yellow 3 green 4 blue 5 white ENO Bool I, Q, M, D, L Enable output 0..1 0..n Entry ID: 63482149, V3.1, 06/2015 10
4 Description of the Function Blocks 4.1 FC300 4.1.2 Description The FC300 block must be called once for each key whose LEDs shall be controlled. The operands EN and ENO have been described in the system manual. The event to be used for switching the key LED on is configured at operand Active. Active is only evaluated if a 1 signal is pending at the EN operand. The number of keys of the Key Panel type is default at operand Type. It is only use for internal monitoring of all pending signals. The base address of the Key Panel assigned in HW Config is specified at operand Address. Operand KeyLedNr. is used for selecting the key whose LEDs shall be controlled at the respective Key Panel. Operand Color specifies the color in which the key shall light at the Active operand for signal 1. Personal and material damage due to false addressing WARNING The FC block writes the calculated color coding back to the base address of the Key Panel. If the address does not corresponds exactly to the start address of the Key Panel, or even lies outside the defined address area, data is written in an uncontrolled manner. This may even cause unpredictable reactions at the machine or plant. The consequences are personal damage, damages at the plant, destruction of devices and maloperations. During the configuration process and the entire operation, do check the Address base address at the FC block. Compare the address with that stored in HW Config. 4.1.3 Address assignment Address assignment of the Key Panel keys Figure 4-2 Entry ID: 63482149, V3.1, 06/2015 11
4 Description of the Function Blocks 4.2 FB301 Address assignment of the Key Panel outputs Base start address using the example of a KP32F: Figure 4-3 Figure 4-4 4.2 FB301 Validity Symbol This section describes the function of FB301 (controlling all key LEDs as LED test): Figure 4-5 Entry ID: 63482149, V3.1, 06/2015 12
4 Description of the Function Blocks 4.2 FB301 4.2.1 Parameter Table 4-2 Name Data type Memory area Description Range of values EN Bool I, Q, M, D, L, T, Z Enable input 0..1 Start Bool I, Q, M, D, L, T, Z Control input 0..n Type Int I, Q, M, D, L, const Number of keys of the Key Panel type Address Int I, Q, M, D, L, T, Z Base address of the Key Panel ENO Bool I, Q, M, D, L Enable output 0..1 8 or 32 0..n 4.2.2 Description The FB301 block must be called once for each Key Panel whose LEDs shall be tested. The FB must always be called at the cycle end of OB1, since otherwise the output signals are overwritten by other blocks. Operands EN and ENO have been described in the system manual At operand Start, the event used for switching on the LED test is configured. The LED test runs until a 1 signal is pending. All key LEDs are cyclically controlled in all colors. The number of keys of the Key Panel type is default at operand Type. It is use merely for internal monitoring of all pending signals. The base address of the Key Panel assigned in HW Config is specified at operand Address. Personal and material damage due to false addressing WARNING The FB block writes the calculated color coding back to the base address of the Key Panel. If the address does not corresponds exactly to the start address of the Key Panel, or even lies outside the defined address area, data is written in an uncontrolled manner. This may even cause unpredictable reactions at the machine or plant. The consequences are personal damage, damages at the plant, destruction of devices and maloperations. During the configuration process and the entire operation, do check the Address base address at the FB block. Compare the address with that stored in HW Config. Entry ID: 63482149, V3.1, 06/2015 13
4 Description of the Function Blocks 4.2 FB301 4.2.3 Address assignment Address assignment of the Key Panel keys Figure 4-6 Address assignment of the Key Panel outputs Base start address using the example of a KP8F: Figure 4-7 Figure 4-8 Entry ID: 63482149, V3.1, 06/2015 14
5 Links & Literature 5 Links & Literature Table 5-1 Topic \1\ Siemens Industry Online Support \2\ Download page of the entry Title https://support.industry.siemens.com https://support.industry.siemens.com/cs/ww/en/63482149 6 History The following outputs were published so far: Table 6-1 Version Date Modifications V1.0 09/2012 First edition V2.0 09/2012 Issue 02 V3.0 03/2015 Updating to Version TIA Portal V13 SP1, Corrections V3.1 06/2015 Updating all of the links Entry ID: 63482149, V3.1, 06/2015 15