Download step 7 basic v10.5 torrent -
SIMATIC. TIA Portal STEP 7 Basic V TIA Portal Introduction 1. Simple example 2. Extended example 3. Example "PID control" 4. Example "Motion" 5
Transcription
1 SIMATIC TIA Portal SIMATIC TIA Portal TIA Portal Introduction 1 Simple example 2 Extended example 3 Example "PID control" 4 Example "Motion" 5 Getting Started 12/ A5E
2 Legal information Legal information Warning notice system This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger. DANGER indicates that death or severe personal injury will result if proper precautions are not taken. WARNING indicates that death or severe personal injury may result if proper precautions are not taken. CAUTION with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken. CAUTION without a safety alert symbol, indicates that property damage can result if proper precautions are not taken. NOTICE indicates that an unintended result or situation can occur if the corresponding information is not taken into account. If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage. Qualified Personnel The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation for the specific task, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems. Proper use of Siemens products Note the following: WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible ambient conditions must be adhered to. The information in the relevant documentation must be observed. Trademarks All names identified by are registered trademarks of the Siemens AG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner. Disclaimer of Liability We have reviewed the contents of this publication to ensure consistency with the hardware and software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions. Siemens AG Industry Sector Postfach NÜRNBERG GERMANY A5E P 12/ Copyright Siemens AG Technical data subject to change
3 Table of contents 1 TIA Portal Introduction Overview TIA Portal basics TIA Portal overview Engineering concept Data management Views in the TIA portal Navigation in the TIA portal Portal view Project view Example projects Overview Loading a project Simple example Introduction Create project Inserting and configuring a PLC Inserting a PLC Overview of device and network editor Configure PLC Create program What are organization blocks? Open organization block Overview of the program editor What are networks? Inserting LAD instructions What are tags? Defining and interconnecting PLC tags Test program Loading the program to the target system Test program with program status Create HMI screen Visualization in the TIA portal Create HMI device with HMI screen What are graphic objects? Creating and configuring graphic objects "Machine ON/OFF" button Graphic objects "LEDs" Graphic object "Conveyor" Graphic object "Bottle" with motion simulation Modify visibility of motion animation Testing HMI screen Load HMI screen to the HMI device Simulate runtime Getting Started, 12/, A5E
4
5 TIA Portal Introduction Overview Introduction Welcome to the "STEP7 Basic V Getting Started". Getting Started uses an example project to show you the easy operation of the TIA Portal. Example project The example project that is created in this Getting Started is a station for pasteurizing milk in a heating chamber. To illustrate this process in simple terms, the individual bottles are moved on a conveyor belt in the heating chamber and transported to the next stage after completion of the heating process. Getting Started, 12/, A5E
6 TIA Portal Introduction Overview Structure of the Getting Started The example project is expanded with each chapter. Starting from a simple project in which you use only the basic functions of the TIA Portal, you expand the project step by step using increasingly complex functions of the TIA Portal. Experienced users can skip certain chapters; the "Simple Example" chapter offers beginners additional background information on programming and visualization. 6 Getting Started, 12/, A5E
7 TIA Portal Introduction TIA Portal basics TIA Portal basics TIA Portal overview Introduction The Totally Integrated Automation Portal (TIA portal) integrates various SIMATIC products in a software application with which you can increase your productivity and efficiency. The TIA products work together within the TIA portal and support you in all areas required for the creation of an automation solution. A typical automation solution encompasses: A PLC that controls the process with the aid of the program. An HMI device with which you operate and visualize the process. Tasks The TIA portal supports you in creating an automation solution. The most important configuration steps are: Creating the project Configuring the hardware Networking the devices Programming the PLC Configuring the visualization Loading the configuration data Using the online and diagnostic functions Getting Started, 12/, A5E
8 TIA Portal Introduction TIA Portal basics Benefits The TIA portal offers the following advantages: Common data management Easy handling of programs, configuration data and visualization data Easy editing using drag-and-drop operation Easy loading of data to the devices Easy operation Graphic supported configured and diagnostics Engineering concept Engineering system You can use the TIA Portal to configure both the PLC and the visualization in a uniform engineering system. All data are stored in one project. The components for programming (STEP 7) and visualization (WinCC) are not separate programs, but rather editors of a system that accesses a common data base. All data are stored in a common project file. You use a common user interface for all tasks to access all programming and visualization functions at all times. 8 Getting Started, 12/, A5E
9 TIA Portal Introduction TIA Portal basics Data management Central data management In the TIA Portal, all data are stored in one project. Modified application data, such as tags, are automatically updated within the complete project even across several devices. Symbolic addressing across project parts If you use a process tag in several blocks of various PLCs and in HMI screens, the tag can be created or modified from any place in the program. In this case it is of no importance in which block of which device you make the modification. The TIA Portal offers the following options for defining PLC tags: Definition in the PLC tag table Definition in the program editor Definition by means of a link with the inputs and outputs of the PLC All defined PLC tags are listed in the PLC tag table and can be edited there. Modifications are performed centrally and updated continuously. The consistent data management eliminates the need for synchronization between the project participants within a project, for example, between the programmer and the HMI designer. Getting Started, 12/, A5E
10 TIA Portal Introduction TIA Portal basics Library concept Project parts can be used again via the library both within the project and also in other projects. Elements such as blocks, PLC tags, PLC tag tables, interrupts, HMI screens, individual modules or complete stations can be stored both in local and in global libraries. Devices and defined functions can be reused. The global library allows for an easy exchange of data between projects. 10 Getting Started, 12/, A5E
11 TIA Portal Introduction Views in the TIA portal Views in the TIA portal Navigation in the TIA portal Introduction You will use different views when you create projects. The following section provides you with a preliminary overview of the various views in the TIA portal. Views of the TIA portal For your automation projects, the TIA portal offers two different working views that provide fast access to the toolbox and the individual project components: Portal view: The portal view supports task-oriented configuration. Project view: The project view supports object-oriented configuration. Navigation You can use the link in the bottom left corner of the user interface to switch between the portal view and the project view at any time. During the configuration the view is also automatically switched depending on the type of task being executed. For example, if you want to edit an object listed in the portal view, the application switches automatically to the corresponding editor in the project view. When the object has been edited you can switch back to the portal view and continue your work there with the next object or the next activity. Global saving of project data When you save a project the complete project is always saved, regardless of which view or editor is open. Getting Started, 12/, A5E
12 TIA Portal Introduction Views in the TIA portal Portal view Portal view The portal view provides a task-oriented view of the toolbox. The goal of the portal view is to provide a simple navigation in the tasks and data of the project. This means the functions of the application can be reached via individual portals for the most important tasks. The following figure shows the structure of the portal view: Portals for the different tasks: The portals provide the basic functions for the individual task areas. The portals that are provided in the portal view depends on the products that have been installed. Actions for the selected portal: Here, you will find the actions available to you in the portal you have selected. You can call up the help function in every portal on a context-sensitive basis. Selection panel for the selected action: The selection panel is available in all portals. The content of the panel adapts to your current selection. Switch to project view: You can use the "Project view" link to switch to the project view. Display of the project that is currently open: Here, you can obtain information about which project is currently open. 12 Getting Started, 12/, A5E
13 TIA Portal Introduction Views in the TIA portal Project view Project view The project view is a structured view of all components of a project. In the project view the various editors are available that you can use to create and edit the corresponding project components. The following figure shows the structure of the project view: Menu bar: The menu bar contains all the commands that you require for your work. Toolbar: The toolbar provides you with buttons for commands you will use frequently. This gives you faster access to these commands than via the menus. Project tree: The project tree gives you access to all components and project data. You can perform, for example, the following tasks in the project tree: Add new components Edit existing components Scan and modify the properties of existing components Work area: The objects that you can open for editing purposes are displayed in the work area. Getting Started, 12/, A5E
14 TIA Portal Introduction Views in the TIA portal Task cards: Task cards are available depending on the edited or selected object. The task cards available can be found in a bar on the right-hand side of the screen. You can collapse and reopen them at any time. Details view: Certain contents of a selected object are shown in the details view. This might include text lists or tags. Inspector window: Additional information on an object selected or on actions executed are displayed in the Inspector window. Switching to portal view: You can use the "Portal view" link to switch to the portal view. Note You open and close individual windows of the project view with the key combination "<Ctrl> + ". You will find an overview of all key combinations in the information system of the TIA Portal. 14 Getting Started, 12/, A5E
15 TIA Portal Introduction Example projects Example projects Overview Introduction The Getting Started is divided into four chapters each of which is based on the one before it. The current status at the end of a chapter is saved in a project file. To skip a chapter, you can load the respective status of the preceding chapter. Contents of the example projects The following overview describes the target group of the respective chapter. The projects are saved as ZIP files and are available for download at the following address: Click on "Info" to see the ZIP files. Simple example These chapters are intended for beginners without prior knowledge. In the easy example you configure the PLC and one HMI device, create a short program and one HMI screen for visualization. At the end of the chapter the machine can be switched on and off using the HMI device. Extended example If you have prior knowledge you can load the easy example and continue from this point. In this extension of the easy example you create a complete program in LAD and the HMI elements required for visualization of the process. The project status after the "Simple Example" chapter is stored in the "Simple_diseinuak4web.net" file. Extended example PID controller In this chapter you add the technological object "PID controller" to the extended example. You use the PID controller to automatically control the temperature in the heating chamber. If you only want to use the function of the technological object "PID", you can load the project status after the "Extended Example" chapter from the "Extended_diseinuak4web.net" file. Extended Example Motion Control In this chapter you add the technological object "Axis" to the extended example. You use the technological object "Axis" to control a second conveyor. You use a motion control instruction to modify the position of the bottle on the conveyor. The project status before this chapter is stored in the "Extended_Example_diseinuak4web.net" file. Getting Started, 12/, A5E
16 TIA Portal Introduction Example projects The project status at the end of the complete Getting Started is stored in the "Extended_Example_diseinuak4web.net" file. WARNING Use the example projects only for test purposes The supplied examples and descriptions are only intended to provide you with an introduction to the basic functions of the TIA Portal. Use the examples only in a test environment and not in a machine that is operational. Loading the supplied example programs in a machine that is operational can cause malfunctions, program errors and serious property damage and personal injuries! 16 Getting Started, 12/, A5E
17 TIA Portal Introduction Example projects Loading a project Introduction The Getting Started starts with the chapter "Simple example (Page 21)". If you do not want to work your way through the Getting Started from the very beginning, the following steps will show you how to load a project status. Procedure Proceed as follows to load a project: 1. Use the portal view of the TIA Portal to open the corresponding project. Getting Started, 12/, A5E
18 TIA Portal Introduction Example projects The project is loaded. 2. Open the project view. 3. Select the language of the user interface. 18 Getting Started, 12/, A5E
19 TIA Portal Introduction Example projects 4. Open the window for project language setting. Use the project languages to select the language in which you want to display the project texts, such as text blocks or comments. 5. Select the language for the project texts. Use the project languages to select the language in which you want to display the project texts, such as text blocks or comments. 6. In the project view, enable the desired language in the runtime settings. Getting Started, 12/, A5E
20 TIA Portal Introduction Example projects Use the language setting to specify which languages will be loaded in the HMI device. The number of languages that can be loaded in the HMI device will depend on the HMI device that is used. The language with sequential number "0" will be shown first during the start process. Note Language switching Tag names are not affected by project language switching, because the tag name must be unique. 20 Getting Started, 12/, A5E
21 Simple example Introduction Steps In the first part of the Getting Started you program an electric pushbutton for switching a machine on and off. You start the machine by pressing the button once. If you press the button again the power supply is interrupted and the machine switched off. To do so, follow these steps: Create project Configure PLC Create program Load program in the PLC Test program Create HMI screen Create project Introduction The following steps show you how to create a new project. In the project, the data and programs that arise from the creation of an automation task are stored in an orderly manner. For this example, open the Totally Integrated Automation Portal in the portal view. The Start portal contains commands for creating a new project and for opening an existing project. Getting Started, 12/, A5E
22 Simple example Create project Procedure To create a new project, follow these steps: 1. Start the Totally Integrated Automation Portal. The Totally Integrated Automation Portal opens in portal view. 2. Create the project "Pasteurization_Station" under any path. Result You have created a new project. In the next section you will add a new PLC to the project and configure its properties. 22 Getting Started, 12/, A5E
23 Simple example Inserting and configuring a PLC Inserting and configuring a PLC Inserting a PLC Introduction The following steps show you how to insert a PLC in portal view and to open its configuration in the project view. The type of PLC that you create in the project must be compatible with the available hardware. Requirements You have created a project. Procedure To add a new device to the project, follow these steps: 1. Use the portal to add a new device. Getting Started, 12/, A5E
24 Simple example Inserting and configuring a PLC 2. Select the desired PLC. 3. Make sure that the "Open device view" option is enabled. If the option is not enabled, left-click in the option to enable it. 4. Click "Add". 24 Getting Started, 12/, A5E
25 Simple example Inserting and configuring a PLC Result You have created a new PLC in the project and have opened the PLC in the device view of the device and network editor. Getting Started, 12/, A5E
26 Simple example Inserting and configuring a PLC Overview of device and network editor Function of the device and network editor The device and network editor is the integrated development environment for configuring, networking and assigning parameters to devices and modules. It is made up of a network view and a device view. You can switch between these two editors at any time. Network view The network view is the work area of the device and network editor in which you can perform the following tasks: Configuring and assigning device parameters Connecting devices to each other The following figure shows the structure of the network view: 1 2 Tab for switching between device and network view Toolbar: The toolbar includes the tools for graphic networking of devices, the configuration of connections and the display of address information. Use the zoom function to change the representation in the graphic area. 26 Getting Started, 12/, A5E
27 Simple example Inserting and configuring a PLC Graphic area: The graphic area displays network-related devices, networks, connections and relations. In the graphic area you can insert devices from the hardware catalog (7) and connect these to each other by means of available interfaces. Overview navigation: The overview navigation provides an overview of the objects created in the graphics area. By holding down the mouse button, you can quickly navigate to the desired objects and display them in the graphic area. Table area: The table area provides an overview of the devices, connections and communication connections in use. Inspector window: The Inspector window shows information about the currently selected objects. You can edit the settings of the selected objects in the "Properties" tab of the Inspector window. "Hardware catalog" task card: The "Hardware catalog" task card gives you easy access to various hardware components. Drag the devices and modules you need for your automation task from the hardware catalog to the graphic area of the network view. Getting Started, 12/, A5E
28 Simple example Inserting and configuring a PLC Device view The device view is the work area of the device and network editor in which you can perform the following tasks: Configuring and assigning device parameters Configuring and assigning module parameters The following figure shows the structure of the device view: Tab for switching between device and network view Toolbar: You can use the toolbar to switch between the various devices and to show and hide certain information. Use the zoom function to change the representation in the graphic area. Graphic area: The graphic area of the device view displays devices and associated modules that are assigned to each other via one or more racks. In the graphic area you can drag additional hardware objects from the hardware catalog (7) into the slots on the racks and configure these. 28 Getting Started, 12/, A5E
29 Simple example Inserting and configuring a PLC Overview navigation: The overview navigation provides an overview of the objects created in the graphics area. By holding down the mouse button, you can quickly navigate to the desired objects and display them in the graphic area. Table area: The table area gives you an overview of the modules used and the most important technical and organizational data. Inspector window: The Inspector window shows information about the currently selected objects. You can edit the settings of the selected objects in the "Properties" tab of the Inspector window. "Hardware catalog" task card: The "Hardware catalog" task card gives you easy access to various hardware components. Drag the devices and modules you need for your automation task from the hardware catalog to the graphic area of the device view Configure PLC Introduction The following steps show you how to configure of the PROFINET interface of the inserted PLC. Requirements The project has been created. The PLC has been opened in the device view of the device and network editor. Getting Started, 12/, A5E
30 Simple example Inserting and configuring a PLC Procedure To configure the PLC, follow these steps: 1. Select the PROFINET interface in the graphic view. The properties of the PROFINET interface are displayed in the Inspector window. 2. Enter the IP address of your PLC under "Ethernet addresses" in the Inspector window. 3. Save the project by clicking on the "Save project" icon on the toolbar. 4. Close the device and network editor. Result You have configured the PLC by setting the properties of the PROFINET interface. 30 Getting Started, 12/, A5E
31 Simple example Create program Create program Introduction With the PLC, the organization block "Main [OB1]" is automatically created in the project. In the following section you create the user program in the organization block What are organization blocks? User program A user program can consist of one or several blocks. You will have to use at least one organization block. The blocks include all functions that are necessary for processing your specific automation task. The program tasks include: Processing process data, e.g. linking binary signals, reading in and evaluating analog values, defining binary signals for output, and outputting analog values Reaction to interrupts, for example, diagnostic error interrupt if the measuring range of an analog expansion module is overshot Error handling in normal program execution Organization blocks Organization blocks (OBs) form the interface between the operating system of the PLC and the user program. They are called by the operating system and control the following operations: Startup behavior of the automation system Cyclic program execution Interrupt-driven program execution Error handling At least one program cycle OB must be present in an automation project. The program that determines the behavior of the PLC is written in this program cycle OB. The operating system calls the OB once in each cycle and thereby starts the execution of the program contained in the OB. The cycle restarts after the end of each program execution. The program execution of an organization block can be interrupted by calling other organization blocks. During complex automatic tasks the program is structured and divided into several blocks that are called in the program cycle OB and executed one after the other. Getting Started, 12/, A5E
32 Simple example Create program The following figure shows the execution of a program cycle OB: A program cycle OB with the name "Main [OB1]" is automatically created when you insert a PLC into the project. In this organization block you create the program of the Getting Started project Open organization block Introduction The following steps show you how to open the organization block in the program editor. The program editor is the integrated development environment for creating the program. Requirements A PLC is present in the project. Procedure To open the organization block "Main [OB1]", follow these steps: 1. Open the "Program blocks" folder in the project tree. 32 Getting Started, 12/, A5E
33 Simple example Create program 2. Open the organization block "Main [OB1]". Result You have opened the organization block "Main [OB1]" in the program editor and you can create your program here. Getting Started, 12/, A5E
34 Simple example Create program Note Adjusting the work area You can move the window of the work area, dock off, and divide it horizontally or vertically. More information on this topic is available in the information system of the TIA Portal Overview of the program editor Function of the program editor You can use the program editor to create the blocks of the program. The program editor consists of several areas which, depending on function, support the execution of the various programming tasks. The following figure shows the structure of the program editor: 34 Getting Started, 12/, A5E
35 Simple example Create program Toolbar: The toolbar allows you access the principal functions of the program editor, such as: Insert, delete, open, and close networks Show and hide absolute operands Show and hide network comments Showing and hiding favorites Show and hide program status Block interface: The block interface allows local tags to be created and managed. "Favorites" pane in the "Instructions" task card and favorites in the program editor: The favorites provide quick access to the instructions that you use frequently. The "Favorites" pane can be individually extended with additional instructions. Instruction window: The instruction window is the work area of the program editor. You can perform the following tasks here: Creating and managing Networks (Page 35) Entering titles and comments for blocks and networks Inserting instructions and supplying them with tags. "Instructions" pane in the "Instructions" task card "Extended Instructions" pane in the "Instructions" task card "Instructions" task card The "Instructions" task card contains the instructions you use to create the contents of the program. "Testing" task card What are networks? Introduction The program of an organization block is divided into networks. The networks are used to structure programs. Each block can contain up to networks. A network is automatically created in the organization block "Main [OB1]". Networks in the LAD programming language The program of an organization block can be created with different programming languages. For the example project, the organization block "Main [OB1]" is edited with the graphic programming language LAD. Getting Started, 12/, A5E
36 Simple example Create program The representation of this programming language is based on circuit diagrams, i.e. each LAD program of a block is divided into networks, each of which consists of one power rail and at least one rung. A network can be extended by adding additional rungs. You can use branches to program parallel connections in the specific rungs. Rungs and networks are executed from top to bottom and from left to right. LAD instructions You create the actual contents of the program using the LAD instructions that are available in the "Instructions" task card of the user interface. There are three different types of LAD instructions: Contacts: You can use contacts to create or interrupt a current-carrying connection between two elements. In such cases the elements can be the LAD program elements or the edges of the power rail. The current is relayed from left to right. You can use contacts to query the signal state or the value of an operand and control it depending on the result of the current flow. Coils: You use the coils to modify binary operands. Coils can set or reset a binary operand depending on the signal state of the result of logic operation. Boxes: Boxes are LAD elements with complex functions. The empty box is an exception. You can use the empty box as a placeholder in which you can select the required operation. In the "Instructions" task card you can find various variations of contacts, coils and boxes that are sorted into various folders depending on their function. Most LAD instructions must be supplied with tags. The following figure shows an example of a programmed LAD network: Power rail Rung Branch Contact Coil Box 36 Getting Started, 12/, A5E
37 Simple example Create program Inserting LAD instructions Introduction The following steps show you how to create the program for switching on and off the example machine in the first network of the organization block "Main [OB1]". To do this, insert a branch and the following instructions: Normally open contact Output coil Negated coil In addition you use a branch to program a parallel connection in the "LAD" programming language. Normally open contact The following figure shows the icon of the normally open contact in the program: <Operand> The activation of the normally open contact depends on the signal state of the associated tag (<operand>). If the tag has signal state "1", the normally open contact is closed. Power flows from the left power rail through the normally open contact into the right power rail and the signal state at the output of the instruction is set to "1". If the tag has signal state "0", the normally open contact is not activated. The power flow to the right power rail is interrupted and the signal state at the output of the instruction is reset to "0". In the course of this project you will also use a normally closed contact (Page 95) which essentially has the same function as the normally open contact, but responds to the signal state of the tag in the opposite way. Output coil The following figure shows the icon of the "Output coil" instruction in the program: <Operand> ( ) You can use the "Output coil" operation to set the bit of a specified tag (<operand>). If the signal state is "1" at the coil input, the tag bit is set to "1". If the signal state is "0" at the coil input, the tag bit also supplies the signal state "0". Getting Started, 12/, A5E
38 Simple example Create program Negated coil The following figure shows the icon of the "Negated coil" instruction in the program: <Operand> ( / ) The "Negated coil" operation inverts the signal state and assigns the corresponding bit to the specified tag (<operand>). If the signal state is "1" at the coil input, the bit is reset to "0". If the signal state is "0" at the coil input, the bit of the tag is set to "1". Requirements The project has been created. The PLC is configured. The organization block "Main [OB1]" is open. Procedure To create the program for switching the example machine on and off, follow these steps: 1. Activate the symbolic representation of the tag. When the symbolic representation of the tags is activated, the addresses of the tags are not displayed in the network. 38 Getting Started, 12/, A5E
39 Simple example Create program 2. Insert a normally open contact into the first network of the block. 3. Open the "Instructions" task card. Getting Started, 12/, A5E
40 Simple example Create program 4. Insert the "Output coil" instruction at the end of the main rung. 5. Insert a branch. 40 Getting Started, 12/, A5E
41 Simple example Create program 6. Insert the "Negated coil" instruction at the end of the branch. Note Modifying an instruction If you have selected the wrong instruction type, you can modify it directly in the network by means of the instruction icon. You open the drop-down list for selection of an instruction icon by moving the mouse pointer across the yellow triangle in the upper righthand corner of the instruction. Result By inserting the LAD instructions in the first network of the organization block "Main [OB1]", you have created the first part of the program for switching the example machine on and off. In the next section, you interconnect the LAD instructions with PLC tags and thereby close the program. Getting Started, 12/, A5E
42 Simple example Create program What are tags? Introduction In the previous step you have inserted three LAD instructions into the first network of the organization block "Main [OB1]". In the next section you will interconnect these instructions with PLC tags. The PLC tags are used to supply the instructions with values and the instructions are executed depending on these values. In the following section you will learn more about the general function of tags in user programs. Tags A tag is a variable used in the program that can take on different values. Depending on the range of application, the tags are divided into the following categories: Local tags: Local tags apply only in the block in which they are defined. PLC tags: PLC tags apply throughout the entire PLC. Most instructions in the program operate with tags. When you assign a tag to an instruction, the instruction is executed with the values of the specified tag. The tags are managed centrally in the TIA Portal. It makes no difference if you create a PLC tag in the program editor or in the PLC tag table. If the tag is used at several points in the program or in the HMI screen, the changes to the tag are taken over immediately in all editors. Benefits of tags Tags have the advantage that they can centrally change an addressing used in the program. Without the symbolic addressing by tags, an addressing that is used again and again in the user program would have to be changed at several points in the program each time the configuration of the PLC inputs and outputs changes. PLC tags A PLC tag is made up of the following components: Name (e.g. CONVEYOR_ON): The name of a tag is valid for a PLC and may only occur once within the entire program and this particular PLC. Data type (e.g. BOOL): The data type defines the value representation and the permitted value range. By selecting the BOOL data type, for example, you specify that a tag can accept only the binary values "0" and "1". Address (e.g. M ): The address of a tag is absolute and defines the memory area from which the tag reads or writes a value. Examples of possible memory areas are inputs, outputs and bit memories. You can use the memory areas inputs (I) and outputs (Q) to address the process image. 42 Getting Started, 12/, A5E
43 Simple example Create program The process image contains the image of the inputs and outputs of a PLC module: The signal states of the inputs in the process image are refreshed in each program cycle (see What are organization blocks? (Page 31)) by the operating system of the PLC. The signal states of the outputs in the process image are written to the outputs of the respective output module in each program cycle by the operating system of the PLC. A machine or a process is generally controlled by means of the signal states of the outputs. The following figure shows how PLC tag table, tags in the user program, bit memories, and inputs and outputs of the PLC are linked to each other in principle. The bit memory area above all is used to save interim results. The values of the tags that are addressed in the bit memory area are stored in the system memory and not transferred to the modules. The data type of the tag determines how much memory a tag occupies in the memory. A tag of the BOOL data type, for example, occupies only one bit in the memory. A tag of the INT data type occupies 16 bits in the memory. Tags are not to overlap in a memory area. The address of a tag must be unique. Getting Started, 12/, A5E
44 Simple example Create program PLC tag table The PLC tag table contains the definition of the tags and constants that are valid for a PLC. A PLC tag table is created automatically for each PLC created in the project. The following table shows the meaning of the individual table columns of the "Tags" tab: Column Name Data type Address Retentivity Monitor value Comment Description Symbol you can click in order to move a tag into a network via a drag-and-drop operation for use as an operand. Unique name within the PLC that you assign to the tag. Data type that you specify for the tag. Tag address. The values of retentive tags are retained even after the power supply is switched off. Current data value in the PLC. This column only appears if an online connection is available and you select the "Monitoring" button. Comments to document the tags Defining and interconnecting PLC tags Introduction In the TIA Portal you have the options of directly creating tags when you create the user program in the networks. The following steps show you how to define PLC tags and interconnect the inserted LAD instructions with PLC tags. Depending on the tag values, the LAD instructions are executed and thereby control the switching on and off of the machine. Requirements The project has been created. The PLC is configured. The block "Main [OB1]" is open. The LAD instructions "Normally open contact", "Output coil" and "Negated coil" are inserted in the first network of the organization block "Main [OB1]". 44 Getting Started, 12/, A5E
45 Simple example Create program Procedure To interconnect the LAD instructions with PLC tags, follow these steps: 1. Open the first network of the organization block "Main [OB1]". 2. Enter the name "ON_OFF_Switch" in the operand placeholder of the normally open contact. 3. Confirm the entry with the Enter key. 4. Open the "Define tag" dialog box. Getting Started, 12/, A5E
46 Simple example Create program 5. Define the "ON_OFF_Switch" tag. 6. Enter the name "ON" in the operand placeholder of the "Output coil" instruction. 7. Confirm the entry with the Enter key. 8. Open the "Define tag" dialog box. 9. Define the "ON" tag. 46 Getting Started, 12/, A5E
47 Simple example Create program Enter the name "OFF" in the operand placeholder of the "Negated coil" instruction and define the corresponding tag. Click the "Save project" button on the toolbar to save the project. Result You have programmed a pushbutton switch for switching the example machine on and off. The actuation of the pushbutton switch has the following effects: When the pushbutton switch is pressed once, the "ON_OFF_Switch" tag is set to the signal state "1". The power is relayed and the "ON" tag is set to the signal state "1" by the "Output coil" instruction. The machine is switched on. The "OFF" tag supplies the signal state "0" and has no further effect. When the pushbutton switch is pressed a second time, the "ON_OFF_Switch" tag is set to the signal state "0". The current flow is interrupted and the "OFF" tag is set to the signal state "1" by the "Negated coil" instruction. The machine is switched off. The "ON" tag supplies the signal state "0" and has no further effect. Getting Started, 12/, A5E
48 Simple example Test program Test program Loading the program to the target system Introduction The following steps show you how to load the program to the PLC. An online connection is established during the loading process between your programming device (PG) or programming computer (PC) and the PLC. The program that is stored on the hard disk of your programming device (PG) or programming computer (PC) is written to the memory of the PLC during the loading step. The blocks contained in the program are compiled during the loading process so that they can be processed by the PLC. Once the program is compiled and loaded, it can be processed by the PLC. Note Online/offline comparison Changes made to the program on the programming device / PC after the loading process are not registered by the PLC. You can use the TIA Portal for an online/offline comparison of your project data and to display any deviations. In online mode you can determine with the help of the icons in the project tree if the "Offline" program components on your programming device / PC are identical with the "Online" programming elements on the PLC. To refresh the status of the program on the PLC, you have to re-load the program. Requirements A connection is established between the programming device / PC and the PLC (see "Additional Information"). 48 Getting Started, 12/, A5E
49 Simple example Test program Procedure To load the program to the PLC, follow these steps: 1. Start the load process. Getting Started, 12/, A5E
50 Simple example Test program 2. Select the interface you want to use to connect the device. Activate the check box "Show all accessible devices". All devices that can be accessed via the selected interface are displayed under "Accessible devices in target subnet". Select the PLC and load the user program. Note Check online connection If no device is displayed in the "Accessible devices in target subnet" list, it can have several reasons: There is a problem with the hardware connection of the PLC. There is a problem with the Ethernet interface on your programming device / PC. The IP address of the PLC must be in the same subnet as the IP address of the programming device / PC. 50 Getting Started, 12/, A5E
51 Simple example Test program 3. Acknowledge assignment of the correct IP address if it has not been assigned yet. 4. If the PLC is in "RUN" mode, set the PLC to "STOP" mode in the following window: The "Download preview" dialog opens. 5. If there are differences between the configured modules and the target modules, activate the corresponding check box to accept the differences. Click the "Load" button. Make sure that the "Continue" check box is selected. The program is loaded and the actions during the load process are displayed. The "Download results" dialog box opens after the download process has been completed. Getting Started, 12/, A5E
52 Simple example Test program 6. Start the module. 7. Activate the online connection. Note Correcting compilation errors If errors in the program are detected during the compilation, you can have these errors and notes displayed in the Inspector window under "Info > Compile" to correct them. 52 Getting Started, 12/, A5E
53 Simple example Test program Result You have loaded the program to the PLC. The status of the program components is shown in the project tree. The green icons indicate that the "offline" and "online" program elements are identical. You will find the meaning of the additional status icons in the respective tooltip. Note Downloading blocks Loading the blocks from the project tree is not the only way to transfer the blocks to the PLC. You can use drag-and-drop to store the blocks in the list of accessible devices in the project tree. If you use the button "Load to device" in the toolbar, you will load those blocks that are open in the editor or that you have selected in the project tree. Additional information Information on establishing and configuring the Ethernet connection is available in the following documentation: "SIMATIC S Automation System" system manual TIA Portal information system, "Setting parameters for the Ethernet interface" chapter TIA Portal information system, "Configuring Industrial Ethernet" chapter Information on establishing the Ethernet interface on the programming device / PC is available in the documentation of the operating system you are using and in the documentation of the network card. Getting Started, 12/, A5E
54 Simple example Test program Test program with program status Introduction The following steps show you how to test the created program with program status. If you display the program status, you can monitor the execution of the program. You can enable the status starting at a specific location in the program and you then obtain an overview of the values of the individual tags and the results of logic operations. This allows you to check whether or not the components of the automation system are being correctly controlled. The display of the program status is updated cyclically. It begins at the selected network. In the program status you can allocate values to the tags by performing one of the following actions using the "Modify" command of the shortcut menu: Modify to 1: Use this command to set the tags of the BOOL data type to the signal state "1". Modify to 0: With this command you set the tags of the BOOL data type to the signal state "0". Modify value: You can enter a modify value for tags that are not of the BOOL data type. Requirements The PLC is configured. There is no voltage at the inputs and outputs of the PLC, because the modified values are overwritten by the module in online mode. The organization block "Main [OB1]" is opened in the program editor. Procedure To test the created program with program status, follow these steps: 1. Enable monitoring. The program status is displayed. 54 Getting Started, 12/, A5E
0 thoughts to “Download step 7 basic v10.5 torrent”