Skip to content
✦ Made with Docsie · generated from video

How to Add a Library in TIA Portal

This guide shows you how to add a library in TIA Portal by turning an existing function block into a reusable global library. You first create the library and store a master copy of the block in it. Then you open the library in a new project and insert the block. This lets you reuse the block in other projects without dragging and dropping between open projects.

TIA Portal 15 steps 14 screenshots 1208 words Source video 5:30 Generated cost $2.10

Video: Siemens TIA Portal PLC tutorial - Libraries (Create & Use) by JohnGvideo. All credit for the demonstration goes to the creator; watch the original on YouTube. The written guide below was generated from this video by Docsie. Creator? Request a change or removal.

This guide shows you how to add a library in TIA Portal by turning an existing function block into a reusable global library. You first create the library and store a master copy of the block in it. Then you open the library in a new project and insert the block. This lets you reuse the block in other projects without dragging and dropping between open projects.

The example uses a valve control function block, Valve [FB1].

Prerequisites

Before you start, make sure you have the following:

  • Siemens TIA Portal installed.
  • A project that contains the function block you want to export. In this example, Valve [FB1] is under Program blocks.
  • A project tree visible on the left, showing devices, program blocks, and function blocks.

Part 1: Create a global library from your function block

Step 1. Open the project that contains the function block

Launch Siemens TIA Portal and open the project with the function block you want to export. In the project tree, Valve [FB1] appears under Program blocks, along with DB2_Valve, DB3_Valve, and FB10_GraphGenerator. The main workspace shows the Valve block used in two networks.

TIA Portal project tree and program blocks, including Valve [FB1], DB2_Valve, DB3_Valve, and FB10_GraphGenerator, with the Valve block used in two networks in the workspace

Step 2. Review the function block

Open the function block and confirm it contains the logic you need. In this example, the block controls a B-stable pneumatic valve. Check that it has all the necessary inputs, outputs, and internal logic.

The ladder logic shows networks for control enabled, control A coil, and control B coil.

Ladder logic for the Valve function block, showing networks for control enabled, control A coil, and control B coil
Ladder logic for the Valve function block, showing networks for control enabled, control A coil, and control B coil

Step 3. Open the Libraries pane

Go to the right side of the TIA Portal interface and locate the Libraries pane. Under Global libraries, you can see existing libraries and the options for creating a new one.

Libraries pane open on the right side of TIA Portal, showing Global libraries and library options
Libraries pane open on the right side of TIA Portal, showing Global libraries and library options

Step 4. Create a new global library

Right-click Global libraries in the Libraries pane and select New library. In the Create new global library dialog, enter the following details:

  • Library name: Enter a descriptive name, for example Valve.
  • Path: Choose or confirm the save location, for example C:\Users\jangri\Documents\Automation.
  • Version: Confirm the version, for example V15.1.
  • Author: Enter your name or initials, for example jangr.
  • Comment: Optionally, add a description for the library or function block.
Create new global library dialog with fields for Library name, Path, Version, Author, and Comment, filled with the example values Valve, C:\Users\jangri\Documents\Automation, V15.1, and jangr
Create new global library dialog with fields for Library name, Path, Version, Author, and Comment, filled with the example values Valve, C:\Users\jangri\Documents\Automation, V15.1, and jangr

Click Create. The new global library appears under Global libraries in the Libraries pane.

Step 5. Add the function block to the library's master copies

In the project tree, find Valve [FB1] under Program blocks. Drag it into the Master copies folder of your new global library (for example, Valve) in the Libraries pane. Confirm that the function block now appears under Master copies.

The Valve function block being dragged into the Master copies folder of the Valve global library, with the Libraries pane showing the expanded library
The Valve function block being dragged into the Master copies folder of the Valve global library, with the Libraries pane showing the expanded library

After you drop the block, the Insert master copy dialog appears. Wait while the system creates the master copies.

Insert master copy dialog showing "Master copies are being created..." at 0%
Insert master copy dialog showing "Master copies are being created..." at 0%

Step 6. Save the global library

In the Libraries pane, right-click the Valve library and select Save library. This stores the function block permanently in the library for future use.

Context menu open on the Valve library in the Libraries pane, with the Save library option highlighted
Context menu open on the Valve library in the Libraries pane, with the Save library option highlighted

Part 2: Prepare a new project for import testing

Step 7. Create a new project

From the main menu, select the option to create a new project. In the Create a new project dialog, enter the following details:

  • Project name: TestProject
  • Path: C:\Users\jangri\Desktop\AUSYS\Temp_video\TestProject
  • Version: V15.1
  • Author: jangr
  • Comment: Optional

Click Create to generate the project.

Create a new project dialog with Project name TestProject, the example path, Version V15.1, and Author jangr
Create a new project dialog with Project name TestProject, the example path, Version V15.1, and Author jangr

Step 8. Add a PLC to the project

In the project tree, double-click Add new device under TestProject. In the Add new device dialog, select Controllers > SIMATIC S7-1200 > CPU > CPU 1214C DC/DC/DC. Use article number 6ES7 214-1AG40-0XB0 and version V4.3. Click OK to add the PLC.

Add new device dialog with CPU 1214C DC/DC/DC selected and the device details displayed
Add new device dialog with CPU 1214C DC/DC/DC selected and the device details displayed

Step 9. Open the main organization block (OB1)

In the project tree, expand the new PLC device and go to Program blocks. Double-click Main [OB1] to open the main program sweep (cycle) block. The ladder logic editor opens, ready for you to insert logic or blocks.

Ladder logic editor open to Main [OB1] in TestProject, ready for block insertion

Part 3: Add the library in TIA Portal and use the function block

Step 10. Open the Libraries pane and choose Open library

In the main workspace, find the Libraries pane on the right and click Libraries to expand it. Under Global libraries, you may see previously imported libraries, such as Valve. Your desired library is typically not listed yet.

Workspace with the Libraries pane open, showing the Global libraries section and the Valve library highlighted, with the main program sweep block open in the center
Workspace with the Libraries pane open, showing the Global libraries section and the Valve library highlighted, with the main program sweep block open in the center

Right-click in the Global libraries section and select Open library. A file browser dialog appears so you can navigate to your saved library.

Context menu in the Libraries pane showing options such as Save library as..., Close library, and Open library
Context menu in the Libraries pane showing options such as Save library as..., Close library, and Open library

Step 11. Select the library file to add a library in TIA Portal

In the file browser, go to the folder where your global library is stored. In this example, open the Automation directory and select the Valve folder.

Inside the Valve folder, select the Valve library file (type: Siemens TIA Portal Library). Click Open to import the library into your TIA Portal project.

File browser inside the Valve folder with the Valve library file of type Siemens TIA Portal Library selected
File browser inside the Valve folder with the Valve library file of type Siemens TIA Portal Library selected

Step 12. Expand the imported library

The Valve library now appears under Global libraries in the Libraries pane. Expand the Valve library node, then expand Master copies to see the available function blocks, such as Valve.

Libraries pane with the Valve library expanded, showing Master copies and the Valve function block
Libraries pane with the Valve library expanded, showing Master copies and the Valve function block

Step 13. Insert the function block into your program

Drag the Valve function block from Master copies into a network in your Main [OB1] program block. The function block is now available under Program blocks in your project tree.

Project tree showing Valve [FB1] under Program blocks, with the Valve function block visible in the network editor

A Call options dialog appears. In the Data block section, set Name to DB10_Valve1, select Manual for the number, and enter 10. Click OK. This creates a single instance data block (DB10) for the first valve.

Call options dialog with Name DB10_Valve1, Number 10, Manual selected, and the OK button highlighted
Call options dialog with Name DB10_Valve1, Number 10, Manual selected, and the OK button highlighted

Step 14. Add a second instance of the function block

Drag the Valve function block into another network to create a second instance. In the Call options dialog, set Name to DB11_Valve2, select Manual for the number, and enter 11. Click OK. This creates a second single instance data block (DB11) for the second valve.

Call options dialog with Name DB11_Valve2, Number 11, Manual selected, and the OK button highlighted
Call options dialog with Name DB11_Valve2, Number 11, Manual selected, and the OK button highlighted

Step 15. Verify both instances in the main program

In Main [OB1], confirm that both instances are present:

  • Network 1 contains the first instance, labeled DB10_Valve1, using the Valve function block.
  • Network 2 contains the second instance, labeled DB11_Valve2, using the Valve function block.

Each instance shows its input and output parameters, such as EN, Direction1, Direction2, Block_dir1, Block_dir2, Safety_OK, ENO, cmd_valve_a, and cmd_valve_b. The project tree lists both data blocks, DB10_Valve1 and DB11_Valve2, under Program blocks.

Main [OB1] program block with Network 1 for DB10_Valve1 and Network 2 for DB11_Valve2, both using the Valve function block, and both data blocks listed in the project tree

Summary

You created a global library from an existing function block, stored it as a master copy, and saved the library. You then opened it in a new project. By following these steps to add a library in TIA Portal, you inserted two instances of the function block, each with its own data block for independent operation.

What's next

You can repeat the Open library steps in any other TIA Portal project to reuse the same function block there.

Generation details: cost, quality tiers

Docsie billed 3,000 credits ($2.10) to analyze this 6-minute video at standard quality. The rewrite, template fill and Word/PDF exports were included. The same video at each quality tier:

QualityFrames sampledCreditsApprox. cost
Draftevery 16-30 s1,500$1.05
Standard (this guide)every 8-15 s3,000$2.10
Detailedevery 4-7 s6,000$4.20
Ultraevery 1-3 s12,000$8.40

Credits priced at $0.70 per 1,000; plans include a monthly allowance. Enterprise customers on on-premise or bring-your-own-model deployments run this on their own inference and pay no per-video credits.

Generated by Docsie Video-to-Docs on 2026-11-24 from a 5-minute video. Screenshots are frames from the source video and belong to their creator, JohnGvideo, whose original is embedded above. If you own this video and want the guide removed or credited differently, contact us and we will act within one business day.

Turn your own training videos into guidesJoin teams that save hours, reduce documentation work and scale training with Docsie.
See Docsie in action. No commitment.

Ready to Transform Your Documentation?

Start creating professional documentation that your users will love