0% found this document useful (0 votes)
117 views5 pages

PLC Skill Tree

Uploaded by

Colin M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
117 views5 pages

PLC Skill Tree

Uploaded by

Colin M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 5

Hey there!

Thanks for downloading this free guide. Most PLC programmers out there focus on writing logic fast.
They’ll just start coding from the get-go without considering the structure of the program blocks or the
organization of the data used in the program. Big mistake.

The main focus throughout my highly successful career as a self-employed system integrator has
been on creating proper structures for my PLC applications. It’s the main reason why I never run out
of projects and why my clients keep coming back for more.

If you’re ready to level-up and start taking program structuring serious, then I’d like to share with you 5
simple steps to instantly improve the structure of your PLC applications in TIA Portal.

Happy reading!

STEP 1 - CREATE GROUPS

Benefit: By creating groups for your program blocks, PLC tags, and PLC data types, you’ll
transform your long and confusing lists of blocks, tags and user-defined data types into
a modular, clean looking application.

Please take a look at Fig.1 to the right.

Here we´ve added 2 groups to Program blocks - a


‘00 Machine’-group and a ‘01 Equipment’-group.
Furthermore, we´ve added a group for Global Data.

The Equipment group contains all logic/functionality


related to the equipment on the line like e.g., a
supply module consisting of a tank and valve, or a
process module consisting of a tank, a pump and a
valve.

The Machine group contains all logic/functionality


that is not directly related to the production process
but are default functions for any machine like e.g., a
state handler, recipe handling, networking, etc...

Finally, the Global Data group contains the data


(DBs) used globally for this application.

For PLC tags, and PLC data types, we have created


the same groups here for a consistent overall look.
Figure 1 - Creating groups

PLCSKILLTREE.COM

Email: hans@plcskilltree.com

Web: www.plcskilltree.com 5 SIMPLE STEPS TO DRASTICALLY IMPROVE YOUR PLC PROGRAM STRUCTURE IN TIA PORTAL | 1
STEP 2 - ADD MAIN FUNCTION CALLS

Benefit: By grouping function blocks together in main function calls, you’ll create a clear
distinction between the different main parts of your application.

Function blocks can be used for two purposes:


A. to create structure in your program
B. to group a (reusable) encapsulated block of functionality.

In our example here (Fig.2), we have added:

• an ‘FB - Machine Modules’ to our ‘00 Machine’ group


for grouping all functions related to our machine logic.
• an ‘FB - Equipment Modules’ to our ‘01 Equipment’
group for grouping all functions related to our
equipment modules.

The actual module functions are then created under a


separate ‘Functions’ group for each Machine/Equipment
group.

Figure 2 - Add function blocks

STEP 3 - USE MULTI-INSTANCES

Benefit: Using multi-instances reduces the number of DBs necessary for your application,
resulting in a more streamlined application.

When a function block (FB) is called in TIA Portal, an instance is created. This instance contains the
data of the block interface (Input, Output, InOut, Static, Temp, Constant) of the called function block.

If the instance is created as a single-instance -> the instance is created as a separate, new datablock
(DB) that will appear under your Program blocks.

If the instance is created as a multi-instance -> the instance is created in the Static area of the block
interface of the higher-level function (where the function with multi-instance is called). No new DB will
be created.

The advantage of using multi-instances over single-instances whenever


possible is that you minimize the number of DBs created in your user program.
By creating fewer DBs, your application will read more easy, and seem less
cluttered.

PLCSKILLTREE.COM

Email: hans@plcskilltree.com

Web: www.plcskilltree.com 5 SIMPLE STEPS TO DRASTICALLY IMPROVE YOUR PLC PROGRAM STRUCTURE IN TIA PORTAL | 2
In our example (Fig.3 below) we are calling the main function calls ‘FB - Machine Modules’ and ‘FB -
Equipment Modules’ in our OB1 with single-instances (OB1 does not have a Static area so the only
option here is single-instance).

The functions inside our main functions calls are then called using multi-instances. In our example
below, we are calling 3 functions inside the ‘FB - Equipment Modules’ - Supply, Refill process 1 and
refill process 2. All 3 of those calls are created with multi-instances.

Figure 3 - Multi-instances vs. single-instances

STEP 4 - BUILD USER-DEFINED TAG STRUCTURES

Benefit: This step will optimize your data communication and create modularity in your
application.

One way to create tags for your application is by using single datatypes like bool, int, real, ...
What if I told you there is a much more gracious way to organize your data in 2 easy steps?

Step 1: Create user-defined-types (UDT) for each module.


Step 2: Build tag-structures in global data-blocks (DB) using these UDTs.

In Fig.4.1 below, we have created UDTs for each module of our machine and equipment modules. If
we take UDT_Refill for example, you can see that a tag structure has been created using status tags
(Sts), command tags (Cmd), parameter tags (Par), configuration tags (Cfg) and fault tags (Flt).

PLCSKILLTREE.COM

Email: hans@plcskilltree.com

Web: www.plcskilltree.com 5 SIMPLE STEPS TO DRASTICALLY IMPROVE YOUR PLC PROGRAM STRUCTURE IN TIA PORTAL | 3
Going over to Fig.4.2, we have then used those UDTs to create tag data-structures in our global data-
blocks ‘DB - Equipment’ and ‘DB - Machine’.

The advantage of grouping single tag data-types together in a tag data-


structure is that all tags belonging to a certain module can be grouped logically
together depending on their function (Sts, Cmd, Par...). Adding more tags to
the structures afterwards is a very easy process in TIA Portal.

Figure 4.1 - Create user-defined data types (UDTs)

Figure 4.2 - Build coherent tag-structures

STEP 5 - CLARIFY YOUR LOGIC

Benefit: Other programmers will instantly understand your logic when you hand over your project
to them. Your application becomes much easier to read and troubleshoot.

So you´ve done all the previous steps, and your application is starting to look sleek, coherent, and
structured. Great work so far! But before we call it a day, there is one final step that we can take to
give our application that extra layer of polish - adding comments and descriptions.

PLCSKILLTREE.COM

Email: hans@plcskilltree.com

Web: www.plcskilltree.com 5 SIMPLE STEPS TO DRASTICALLY IMPROVE YOUR PLC PROGRAM STRUCTURE IN TIA PORTAL | 4
Clarifying your logic becomes extremely important if you´re not the only one working on an
application. If someone for example takes over your PLC application, why not give that person a
fighting chance by explaining what you´ve programmed? Now there’s an idea!

In Fig.5 below, we have clarified our ‘FB - Supply’ block by adding a block title and a description.
Furthermore, we have added a short description to each network title with a comment below each title
to share more details about the network.

Keep your titles short and to the point (less clutter) - use the comment section
below each title to write a more detailed description of the block or the
network.

Figure 5 - Add comments and descriptions

Want to learn even more about creating structured PLC applications


in TIA Portal? Then click the button below. Hope to see you on the
inside!

-Hans

PLCSKILLTREE.COM

Email: hans@plcskilltree.com

Web: www.plcskilltree.com 5 SIMPLE STEPS TO DRASTICALLY IMPROVE YOUR PLC PROGRAM STRUCTURE IN TIA PORTAL | 5

You might also like