Uncategorized

TIA Portal - First project

Share

we will focus on creating the first draft, going through the steps one by one. It is crucial to go through this stage step by step. I have highlighted the most important points, which I covered in detail earlier, while we have already examined the key aspects of the environment. The following tabs also offer additional options, which will be presented here.

What does the project involve?

0. Algorithm for machine/line operation (written on a piece of paper)

1. creation of the project in the development environment

2. Hardware configuration

a) Selecting a PLC (e.g. S7-1200)

(b) Assignment of an IP address (if applicable)

c) Address setting for digital inputs and outputs (if applicable)

(d) Other settings (if any)

3 Writing programme code

-Creation of symbolic names for digital inputs/outputs (according to point 2c)

-Input and output tests (IO test)

-Coding

4. PC-PLC connection configuration (when using the actual PLC)

5. download (uploading data to the controller)

6. tests and possible amendments

-

Before we create the first project, I have prepared a step-by-step breakdown, showing how the working procedure from the concept phase to the creation of the project should look like. The next steps are marked, and it is a good idea to start by preparing an algorithm that defines how the project should work. This algorithm can be general at the beginning, but will become more and more detailed over time. It is useful to have an idea at the outset of how we want the project to work.

We then proceed to the stage of putting the project down in the environment. This project consists of two main parts: the hardware configuration and the software part.

Here, in tab two, we focus on the hardware configuration. This configuration is divided into several smaller parts. The first step is to add a driver. We need to select the appropriate driver from the available options. In this lesson, we will focus on the 1200 controller. If you are working on an actual controller, you may need to give it an IP address, which is sometimes required by a customer project. If there are no specific IP address requirements, the controller usually has a default address of 192.168.0.1.

Another important point (2c) is the setting of addresses for inputs and outputs. This issue often causes difficulties for beginners because it requires an understanding of addressing. The addresses should match the design assumptions, which is crucial for the subsequent programming of the controller. For more advanced applications, point 2d involves additional settings in the PLC. These are advanced configurations that can be customised according to the needs of the project.

It is worth noting that more advanced settings can be configured later, with the initial focus on running and testing the basic functions. We can approach the configuration in stages, checking the operation of each functionality before moving on to the next. Such a step-by-step procedure makes it easier to identify possible problems and enables more effective correction.

Point 3 covers the creation of symbolic names, i.e. links between the address we have configured in the hardware part and a name to make it easier to understand. This is a preparation for easier programming. In the next step (3B), an important step is to test the inputs and outputs to check that all signals are correctly reaching the controller. It is worth verifying the correct operation of sensors, buttons and other actuators, especially when working on real hardware.

If you are working on real hardware, you will also need to ensure that the computer is properly prepared and the interfaces are set up to allow for a correct connection (point 4). If you are working on a virtual controller, this step is usually automatic, but it is worth making sure that all settings are correct. If necessary, you can adjust the settings in the control panel, under the pg-pc tab.

We then move on to step 5, which involves the download process, i.e. uploading the prepared programme from the PC to the controller, whether it is a real or virtual controller. This stage is important because it allows us to input our work into the controller so that it starts to perform according to our design intentions.

Point 6 covers the testing stage, where we check that our work works as designed. If we encounter errors, corrections need to be made. This process may require going back to the coding stage, but it is important to make corrections in small steps, testing each change. The key is to have an algorithm and to go through each task consciously.

When we start working with PLCs, it is important to have a list of next steps prepared. Throughout the course we will progress gradually through the steps, some of the more advanced ones appearing in later lessons.

LAD programming language (ladder)

During the first project, we will be using the LAD (ladder) language, which is dedicated to electricians.

03c TIA First Project image2

Although the S7 1200 controller allows programming in three languages (LAD, FBD, SCL), we will mainly focus on the graphical language, specifically Ladder. This language is the default for the OB1 file, which we will learn more about in the following sections of the course.

Project premise

Here we see the view of the development environment, i.e. the Project View. The easiest way to navigate this environment is to use the numbered points that mark out the key steps. We start with function number one, where we create a new project in the first step.

03c TIA First Project image4

To do this, we click on the card icon marked with a red rectangle. Once clicked, a new window will open where we can initiate the project creation process.

Name of the project

In the 'Create New Project' window, enter a name for the project (see 'Project Name' field), for example 'First Project'.

03c TIA First Project image5

The next field is the path where the project will be saved. By default, projects are saved in the 'My Documents/Automation Projects' folder. We can leave this path or create a new folder to organise the projects. The next fields include the TIA Portal version, the author and an optional comment.

We then click on the 'Create New Project' button, marked with the number two on the red background. We now move on to the hardware configuration, which is the next step after creating the project. It is worth noting that the process of creating a project can take a while, so we need a little patience, especially when some tasks in TIA Portal require more time. Once the project has been created, the TIA Portal view appears.

Stage - hardware configuration

During the presentation, we see the next task, namely adding a new device, which is the third step in the process. In the project tree, we already have our project created, which is usually expanded. Next to the project name, for example 'First Project', we see a black triangle. We can expand or collapse it, which also works for other folders such as devices. By clicking on the triangle, we can hide or expand the view of a particular object.

Adding a device

We now proceed to add a new device. In the project tree, we click on 'Add New Device'.

03c TIA First Project image7

It is worth noting that if you are working on a trial licence, a window associated with the automatic licence manager may appear, such as 'STEP 7 Basic'. Here we select the appropriate licence, for example 'STEP 7 Professional', which is highlighted in blue.

03c TIA First Project image8

Once selected, we click the 'Activate' button, which gives us 21 days to work in TIA Portal with the Trial licence.

CPU selection

We then move to the next window, 'Add New Device', by clicking on the red button, which marks the fourth step

03c TIA First Project image9

In the 'Controllers' folder, expand the appropriate folders and then select the CPU from the simatic S7 1200 family on which you will work. Remember to expand the CPU next to the CPU that contains the 1200 family subroutines.

Now we need to choose the model of controller on which we will work on the project. I have chosen a 1212 DC DC CPU, which is a slightly higher unit, but within the smaller units, and sufficient to run this course. We will be working on a virtual controller, so you can choose any controller to work through all the tasks in this course. However, if we have an actual controller available, we need to choose exactly the hardware we have physically.

To find out what equipment we have based on the order number, these numbers are visible in the equipment selection window. The order number, highlighted here, e.g. 6ES7 212, is located under the bottom flap on the right side of the controller. Expanding the CPU 1212 DC-DC-DC folder, we see three generations of controllers available for purchase. For the purposes of this course, I have chosen the third generation, which is the latest.

If we do not plan to buy a new controller, but only want to work on a virtual one, we can choose any generation. For the virtual controller, I will focus on the third generation. Once the controller is selected, the description box on the right provides key information about the controller, such as the number of built-in inputs/outputs (8 inputs and 6 outputs in this case) and working memory information (75 kilobytes).

This information is important especially at the initial programming stage, allowing us to adapt the hardware to our needs and see which CPU to choose depending on the type of project. Fifth point. I suggest that at the beginning you carefully choose the same model of controller that I will be presenting in this course, and also work on a virtual controller in PLC SIM. These items will be useful if you are testing your application, even if you plan to work on the actual controller. There is some functionality here that is very helpful when testing, which will also be covered in the course.

Device configuration

We now move on to the next step, where the hardware configuration view of the driver appears by default. This is set by default when adding a new driver, and I have highlighted the most important places to note in the TIA Portal hardware configuration view.

03c TIA First image10 project

As far as Point A is concerned, we have three tabs: Device, Network, and Topology. The Device tab is for settings relating to the PLC itself. The next tab, Network, allows us to configure network settings, which is important when we want to connect the controller to another network device. The last tab, Topology, is dedicated to the physical connection, specifying the cable locations, slots, and RJ45 ports on the device. In this course, we will mainly use the Device tab, which is necessary for setting up addresses. Although addresses can also be configured in other places, we will discuss this later. In general, the Device tab covers a summary of addressing at this level.

Point B shows a view of the virtual bus on which devices such as the PLC (CPU) and additional modules are mounted. Here there are virtual slots where modules can be mounted. The hardware configuration is built according to the actual layout, and everything must match. This hardware configuration is related to tab B, which I mentioned earlier, and in this phase we mainly focus on addressing.

It is worth noting that the items indicated only apply to the Device tab, which is key in the context of addressing at this level of hardware configuration.

Default I/O addressing

The most important aspect in this phase is addressing, which is a key starting point for many students, especially at the beginning of their automation-related learning. Addresses are essentially assigned to the signals connected to the controller's inputs and outputs, which we will discuss in more detail later.

03c TIA First Project image11

On the Device View, we can see where the inputs and outputs are located. The inputs are highlighted in green and their addresses are visible when we zoom into the workspace. If we mark the controller as Focus, the addresses associated with the outputs, highlighted in green, appear in the inspector window on the Properties tab. In the PLC, we have a compact unit, characterised by a TSO unit, as well as inputs and outputs. The addresses for the input signals are shown in green and those for the outputs in blue. A green arrow is visible in the project tree, symbolising the addresses needed for the PLC. We will focus on this later in the course. The PLC has inputs and outputs, which is typical of compact controllers. The addresses for the outputs are set to 0 by default, as are those for the inputs. However, these addresses can be adjusted, which we will discuss in the following sections.

Stage - Software

We now move on to the Software area, the software configuration stage. We have now completed the hardware configuration stage.

03c TIA First image project12

The first step is to run a simple programme. We leave the default addresses as they are. In the Software area, we see the link to Hardware and the addressing. It is crucial that the addresses are set correctly so that the hardware configuration is correct, allowing us to move on to the Software stage later.

03c TIA First image project13

In the figure we can see how this part (Network) is related to our hardware, indicated by the black box. The arrow illustrates the relationship between the hardware and the programme code.

Block OB1

We enter the programme code into the organisational block OB1, which we see on Programme Blocks. We click on Main OB1 to go to the place where the programme code can be entered.

03c TIA First Project image14

Next, we move to step six, where we click on Main OB1. In the work area, we see the programme code editor.

Editor

I have highlighted the most important elements of this editor. The icon bar contains shortcuts to the most frequently used functions, such as adding another line of code or adding another network. If we want to add a new network, we use the Network icon.

03c TIA First Project image15

In the interface area, depending on the block, parameters and variables can be opened. The Interface section is a bar of favourite instructions, and the Favorites Instructions section makes it easy to add frequently used instructions. Icons in the Instructions tab facilitate access to instructions. In the Function (F) tab, we have access to extended instructions. Point G is the Inspector window, where we see the properties of the block we have selected. This is the first project that has gone through the stages of hardware configuration and where to write the program code.

Share
Recommended course!
Until 20.09.2022 rebate -15% on:

SIMATIC S7 in action

Sign up for the newsletter!
Author of entries
Tomasz Gilewski

Hello, my name is Tomasz Gilewski. I am the author of books on the S7-1200 controller and HMI panels (i.e. Siemens hardware). I have been programming exclusively on Siemens hardware and engineering tools for several years.

Leave a Comment

Select currency
Scroll to Top

Search on