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.
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.
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.

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.

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.

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.

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

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.

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.

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.

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.
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.

Right-click in the Global libraries section and select Open library. A file browser dialog appears so you can navigate to your saved 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.

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.

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.
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.

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.

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 theValvefunction block. - Network 2 contains the second instance, labeled
DB11_Valve2, using theValvefunction 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.
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:
| Quality | Frames sampled | Credits | Approx. cost |
|---|---|---|---|
| Draft | every 16-30 s | 1,500 | $1.05 |
| Standard (this guide) | every 8-15 s | 3,000 | $2.10 |
| Detailed | every 4-7 s | 6,000 | $4.20 |
| Ultra | every 1-3 s | 12,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.