This chapter covers the core requirements to get started with TIA Portal. This includes the physical layout of the environment and different viewpoints, available tools, adding/configuring devices, and library management. The differences between online and offline views are also covered.
After reading this chapter, programmers should feel comfortable with the basic navigation of TIA Portal and have enough knowledge to be confident about the following:
- Adding devices to a new project
- Knowing where instructions and other tools are located
- Using the project library
- Using a global library
- Viewing online and offline views of connected devices
The following topics will be covered in this chapter:
- Windows and panes – layout of the development environment
- Getting started with a new project in theProject view
- The Reference and Details views – tools to aid development
- Instructions and libraries
- Online testing environment
Windows and panes – layout of the development environment
Before jumping in and creating a project, let's get familiar with the development environment. In TIA Portal Version 17 (V17), there are two different ways to view and use the application, as outlined here:
- Portal view
- Project view
Depending on the view that TIA is running in, this changes the look and feel of the development environment and also where/how objects are interacted with.
When opening TIA Portal for the first time, the Portal view will be presented, as illustrated in the following screenshot:
The Portal view is TIA's default setting and will be the mode that is in use every time TIA Portal V17 is opened (unless changed in the settings).
When required, TIA will automatically switch from the Portal view to the Project view. The following screenshot shows the Project view:
The Project view is required in order to actually program information in program blocks.
Portal view – windows and panes
The windows in the Portal view can be split up into three different key areas, as illustrated in the following screenshot:
The three areas are described in more detail here:
- Main menu: These are the top-level areas of TIA Portal. Nearly all aspects of development fall into one of these categories.
- Submenu: These are the navigational items that relate to the main menu area. For example, switching between Start and PLC programming would change the options available in this menu.
- Activity area: This is the area in which interaction with selected processes occurs, such as creating a new project or navigating PLC programming blocks.
Be careful in the submenu area of the Portal view! In some locations (such as PLC programming), a device must also be selected. It's very easy to accidentally leave the last selected item when returning. Make sure to check which device is active when in these types of menus!
Project view – windows and panes
The Project views shown in Figure 1.4 are shown with the default layout. In TIA Portal, windows/panes can be moved around in the Project view to create a custom environment.
You can select the default layout by navigating to Window | Default Window Layout. The screen should then look like this:
The four key areas are outlined here:
- Project tree: This is the pane in which navigation of devices and associated objects (such as function blocks) is done. The addition of new devices and objects is also started here.
- Main activity area: This area is where activities such as PLC programming and network configuration are completed.
- Supportive tools: This pane contains a collection of tabs that offer tools relative to the activity that is being undertaken. The tabs that are offered also depend on the current activity.
- Properties, Info, and Diagnostics pane: This pane changes often and has a multi-tab approach to display information in different categories. During development, this pane will most often be displaying information such as Compilation Status and Properties, which allow the setup of different objects. Details view pane—mini-project tree that only shows details of the object currently selected in the main project tree.
- Details view: This area lists child objects when an object is selected in the project tree. It is also a useful method of exploring variables within a data block or tag list without having to open the object itself.
Getting started with a new project in the Project view
The Project view is the view that most programmers will spend their time in. While the Portal view has its advantages in simplicity, the Project view is a necessity and offers methods to do almost everything that the Portal view can do.
With this in mind, creating a brand-new project in the Project view may be easier for people new to TIA Portal as it follows similar steps to other development platforms.
Remember, on a clean install with default options, TIA Portal will open in the Portal view. In order to get into the Project view, click the text (Project view) in the bottom left of the screen to change modes.
This shows the view that will be switched to when clicked, not the current view.
Starting a new project
When in the Project view, TIA expects a project to be available in order to show anything project-related. At this point, though, no project is available, as none has been created.
Once the New project icon has been clicked, the following dialog box is presented:
This allows the setting of the project name, save path, and author, as well as some comments about the project.
Once the Create button has been clicked, TIA Portal will create (and save) the new project.
Changes to the project tree
These objects relate only to this project and may affect any devices or further objects that are added to the project (Security Settings, for example).
By double-clicking the Add new device option, a new dialog box will open, allowing the selection of supported devices. This is illustrated in the following screenshot:
Once a suitable device has been selected and a name assigned, the OK button can be clicked, and the new PLC (or other hardware) will appear in the project tree, as illustrated in the following screenshot:
This is a necessary step to complete before software programming takes place.
Configuration of devices
This can be accessed by right-clicking the new device in the project tree. The Properties item will be available at the bottom of the context menu.
The same configuration settings can also be accessed by opening the device configuration from the project tree. Once the Device view opens, the properties are displayed in the Properties, Info, and Diagnostics pane, as illustrated in the following screenshot:
The Reference and Details views – tools to aid development
TIA portal has some handy views that aren't immediately obvious as to their usefulness. Two views are particularly useful, as outlined here:
- Reference project view
- Details view
By default, TIA Portal has the Reference projects panel disabled. Both panels can be enabled (or disabled) by clicking View from the top menu and then checking the panels to be made visible.
Making use of a previous project as a template is a great way to maintain consistency between projects. Loading two instances of TIA Portal should be avoided if possible as TIA Portal can be resource-hungry; lighter development machines may lack the resources to maintain two or more instances of TIA Portal. You can see the Reference projects panel in the following screenshot:
With reference projects, multiple projects can be open at the same time in Read-Only mode.
Reference projects can be opened and closed via the buttons immediately below the title banner.
Once the project is expanded in the reference project view, it resembles exactly the same view as the project tree, with all objects available as they would be if the project were to be opened normally.
Once a reference project is open and expanded, items within it (such as program blocks) can be opened and read as normal; however, a gray hue will appear on the object icon to indicate it is a reference object, as illustrated in the following screenshot:
The difference is very subtle—ensure that the correct blocks are being worked with (although it is not possible to write to a reference block).
Uses of reference projects
There are many different reasons why a reference project may be used to aid development. In most cases, a reference project is used to serve as a guide; however, the following functionalities are also available:
- Copying information between the reference project and main project: Objects from the reference view can be copied and pasted into the main project tree or dragged and dropped. This is a useful way to move blocks quickly between two projects.
- Comparison of objects: Objects can be compared between the reference project and the main
project.mpfile. This is a useful feature that allows programmers to quickly check the differences between two offline projects.
To compare the reference project with the main project, right-click on an object and select Quick compare | Select as left object. Then, select the object to compare with and right-click, and then select Quick compare | Compare with <previously selected left object>.
TIA Portal will then compare the objects and display any differences.
This is particularly useful when programmers want to drag and drop objects into the main activity area, as in the following screenshot example:
Not all options are available for an object when selected in the Details view. For example, an object can be opened, but cannot be renamed from the Details view pane.
Right-click options are also unavailable.
Uses of the Details view
The Details view pane would typically be used to do the following:
- Preview child objects in a selected parent object.
- Directly open child objects in a selected parent object.
- Check basic details such as the block number or comments assigned to objects.
Overview view mode
The Overview view mode is similar to the Details view but uses the main activity area to display the results and shows all objects within the previously opened object.
The Overview view mode is entered by clicking the persistent Overview button at the bottom left of TIA Portal.
Users of SIMATIC Manager (Siemens older development software) may find the Overview mode familiar when in the Details view (using the tabs at the top of the view). This displays blocks in a familiar way to how SIMATIC Manager displays blocks in the Details view.
Instructions and libraries
- Contains instructions for use when developing code
- Contains selection methods for selecting different versions of groups of instructions
- Contains any optional package instructions that have been loaded into TIA Portal
There are a lot of items here that are organized into categories (folders).
Some categories contain a selectable version. This allows programmers to use previous versions of operations/instructions in a newer environment if required by the project. The default version will always be the most recent, and it is not advised to change it unless there is a specific reason to do so.
Adding instructions from the Instructions tab
Instructions are the objects that are used in the programming window—the building blocks of the logic. These are used together to build the logical part of the program. An example is shown in the following screenshot:
- Double-clicking on the instruction in the Instructions pane. This will add the instruction to the current location in the Program block window.
- Dragging the instruction from the Instructions pane and placing it in the desired location in the Program block window.
Adding favorite instructions
Instructions can be added to the Favorites bar by simply dragging and dropping them into place. There are some limitations to the Favorites bar, as outlined here:
- Only instructions from the basic instructions set can be added.
- Favorites cannot be re-organized once placed; however, they can be slotted between existing items. This means that if an instruction needs to be moved, it must be deleted and re-added.
Library management allows programmers to keep versions of program blocks so that they can be distributed throughout a project or shared between other projects. This offers the ability to use consistent and pre-tested code, wrapped up in a very well-controlled environment.
It's best to start using libraries right at the beginning of a project (and throughout its life cycle) when defining a project structure is easier.
The Libraries tab consists of the following two areas:
- Project library
- Global library
- This also contains Types and Masters that are used to update or populate the project library
- Can be updated via the project library
Types and Masters
Throughout the library system in TIA Portal, two common terms are used: Types and Masters (master copies). These refer to how objects placed inside the library behave.
Types: Program blocks placed in the
Typesfolder will be explicitly connected to the project library. This means that they cannot be edited without first confirming the requirement to be edited. If a type is edited, it must be saved as a new version; TIA Portal will manage this appropriately.
Masters: Any object placed in the master copies will be a copy of the object placed. Unlike Types, these serve as templates and can be edited at will in the project without updating the library. If more than one object is placed in the
Master copiesfolder at once, TIA Portal will group them together as a single object to ensure they are copied back together.
This library is used to help programmers ensure that the program blocks used throughout the project are strictly version-controlled, or to provide templates in order to get started with a program block quickly.
The Libraries tab is found on the right-hand side of the TIA Portal application, below the Instructions tab.
Blocks that are used in the project library can only be opened if they are instantiated in the project itself. This means that in order to edit or open a project library object, it must at least exist in the project tree.
Note – Master Copies
Master copies cannot be opened at all from the Libraries pane and must be copied (dragged) into the project tree before an object can be opened.
- In test
When a type is released, it has been added to the library, versioned, and is now available to be used in the project tree. At this point, it is protected and cannot be edited without creating a new version.
When a type is in test, it is available to be edited, versioned, and then committed back to the library. A type must be put into test to create a new version. The test version can be downloaded into the PLC via the project tree so that tests on the new version can be performed.
Editing Library Blocks (In Test)
The block to be edited must exist in the project tree before it can be edited. A block can be edited by right-clicking and choosing Edit type in the Libraries pane.
The project library should be used in order to release multiple in-test blocks at once. The status indication in the library will show the following symbols for different types of inconsistencies between the project library and project tree:
- Multiple inconsistencies: More than one object is in test (including dependents)
- Non-Default version instantiated: The project tree has an in-test version instantiated
- Default dependent not used: The default version of this block does not use the same default version of a dependent block (inconsistent versioning)
- Consistent: No inconsistencies detected
There is more than one method for releasing versions, as outlined here:
- Via the yellow information banner at the top of a typed block that is in test
- Via the right-click menu when clicking an object in test in the project library
When either is clicked, the following dialog box is presented:
In this dialog box, information about the type can be entered, including an author and a comment.
The version number will automatically increase the minor revision number; however, this can be overridden to make larger version increments.
Deleting unused types is a good way of keeping the project library clean and easy to use. Setting dependent types to edit mode will be pre-selected if the block being released has dependent types that are not in test yet (these dependent blocks will need to be updated to maintain library consistency).
Be careful! Clicking Discard changes will immediately delete the test version, without confirmation!
Master copies work very differently from types. While master copies still reside in the library, they are not version-controlled, and modifying a master copy does not cause other blocks to need to adapt.
Master copies are also not restricted to just function blocks, functions, and UDTs. Other types—such as data blocks, tag lists, and even groups of objects and folders—can have master copies.
Editing Master Copies
Unlike types, master copies cannot be edited at all. In order to update a master copy, a new instance of the object must replace it. This can be done by simply deleting the existing version and dragging the new version (with the same name) into the
Master copies folder.
A master copy serves as a template and can simply be dragged from the Libraries pane into the project tree in the position required. If the object dragged into the project tree contains more than one object (is a group of objects), all of the objects will be unpacked into their single instances, retaining any structural layout.
- Standard singular objects: Objects retain their normal icons
- Group of data blocks: A folder containing only data blocks
- Group of function blocks: A folder containing only function blocks
- Group of mixed objects: A folder containing more than one type of object
- Empty folder: A folder/group with no content (useful for templating project-tree layouts)
The global library is a library that can be used by more than one project. The global library behaves slightly differently from the project library, but still maintains a familiar approach to updating and maintaining objects within it.
Just as with the project library, the global library is found on the left-hand side of TIA Portal in the Libraries pane.
Creating a new global library
A familiar dialog box will open that is similar to the one used to create a new project, as shown here:
By default, global libraries are saved in the
Automation folder; however, this can be changed to any location.
It's important to note the version number of the global library—the version of TIA Portal must match in order to use the library. If an older version library is opened in a newer version of TIA Portal, a conversion to the new version takes place. You cannot downgrade TIA Portal libraries to lower versions.
Opening a global library
A new dialog will open that allows a global library to be browsed for and opened, as illustrated in the following screenshot:
If a global library is to be edited, remember to uncheck the Open as read-only checkbox. If this is left checked, objects can be read from the global library but cannot be written to the global library.
A project doesn't have to be opened to open a global library; however, without a project, the use of a global library is limited!
Using a global library
Before any objects in the global library can actually be used, it is important to understand the differences between a global library and a project library. Almost all of the differences relate only to types, with master copies still behaving as templates.
If a type is required from a global library, it will automatically be added to the project library if dragged into the project tree, as will all of its required dependents.
Upgrading a global library
A global library is easily updated from a project library by right-clicking the object to be upgraded in the project tree and selecting Update types | Library. A new dialog will open, as illustrated in the following screenshot:
From the dropdown, the open (and writable) global library can be selected. When OK is clicked, the global library will be updated with all new versions.
This also works the other way around, for updating project library types from the global library.
The global library must be saved after updating by clicking the Save icon () in the Global library pane.
Checkbox options should only be selected if there is an explicit requirement to do so. It's good practice to keep previous versions available in the global library to support older projects as time and versions progress.
Periodically, very old versions may be removed once no projects are making use of them (the project library will still contain the relative version, though, if one in use is removed from the global library).
Online testing environment
The Go online function can be found on the top menu bar—it looks like this:
Once clicked, a connection dialog will open that allows CPUs and other devices to be searched for and connected to, as illustrated in the following screenshot:
In the Go online dialog (Figure 1.27), devices can be searched for and connected to. Different interfaces can be selected from drop-down lists, and different subnets can be specified if required. Once the desired device is found, highlight it and click GoOnline. This will then connect the development environment to the device.
CPU operator panel
These controls allow the CPU (PLC) to be stopped via the STOP button, memory reset via the MRES button, and placed back in to run via the RUN button.
The status of the CPU can also be read in this panel via the RUN/STOP, ERROR, and MAINT status LEDs. This is useful if the CPU is not local to the programming device running TIA Portal (connected via a virtual private network (VPN) connection, for example).
The call environment is an important part of viewing and monitoring online code. In TIA Portal, a program block may be called more than once and via a different call environment (called by a different parent or instance). The Call environment panel in the Testing tab allows the call path to be defined, as illustrated in the following screenshot:
Figure 1.29 demonstrates a call path to a program block. When the Change … button is pressed, a list of available call paths is displayed. A call path can be selected, and TIA Portal will then monitor the selected call path.
Note – SIMATIC Manager
Programmers who have worked with Siemens SIMATIC Manager may remember that multiple calls to the same function block on the same call path mean that only the first instance is available to be monitored. TIA Portal rectifies this behavior by also allowing instances to be selected.
Breakpoints are used to pause the execution of the CPU in order to help debug programming logic. They are only available in Structured Control Language (SCL) and Statement List (STL) languages and are not available on all CPUs.
Warning – Outputs
If a breakpoint halts the execution of the CPU, outputs may remain in their current state until the breakpoint is released! This could cause damage to assets or personnel. It is important to understand the risks associated with using breakpoints in a live equipment environment.
Breakpoints and their usage are advanced topics that relate only to textual languages. Using breakpoints effectively is covered in more detail in Chapter 5, Working with Languages in TIA Portal.
When in online mode with a CPU and actively monitoring a program block via the Monitor function , the Call hierarchy pane displays the relative call path to the block being monitored, as illustrated in the following screenshot:
This chapter has covered the required areas to start a project with a good understanding of TIA Portal's tools and layout, environment setup, and library management systems.
Understanding where and how to use the tools that TIA Portal offers is important. As a further learning exercise, it is recommended that users familiarize themselves with these tools. It is important to remember that TIA works best when all of the tools are utilized together.
The next chapter expands on the inner workings of TIA Portal , on how objects are created, and how these fit together to create a software structure of a program in a hierarchical manner.