Basic Instructions
General — LAD / FBD
Master the fundamental building blocks of PLC programming in TIA Portal. These general instructions are the foundation of every Ladder Diagram (LAD) and Function Block Diagram (FBD) program.
What Are Basic Instructions in TIA Portal?
In TIA Portal, Basic Instructions are the essential programming elements available in the instruction tree under "Basic Instructions > General". They control the structural layout of your LAD/FBD networks — how logic branches, where inputs connect, and how you organize code into readable sections.
Unlike logic instructions (AND, OR, timers, counters), these general instructions don't perform automation logic themselves. Instead, they define the visual structure and wiring of your program. Understanding them is critical before writing any PLC code.
The 5 General Instructions
Each instruction explained with its shortcut, usage, and practical tips
Insert Network
What It Does
Inserts a new network into the current program block (OB, FB, FC). A network is the basic unit of organization in LAD and FBD — it's a horizontal section of logic with its own number and optional title/comment.
When to Use It
Every time you need to add a new piece of logic. Best practice is to keep one logical operation per network: one motor control, one valve sequence, one alarm condition. This makes your program readable and easy to debug.
Pro Tips
Give each network a descriptive title — e.g., "Motor M1 — Start/Stop Logic". This appears in cross-references and makes searching much faster.
You can also insert networks by right-clicking in the program editor and selecting "Insert network".
Networks can be reordered by drag-and-drop. Keep related logic grouped together.
Empty Box
What It Does
Places a generic empty instruction box in your network. The box appears with "???" and you then choose which instruction to assign — a comparison (CMP), math operation (ADD, MUL), move (MOVE), timer (TON), or any other instruction from the catalog.
When to Use It
When you know you need an instruction in your logic chain but want to quickly place the box first, then decide which one. It's the fastest way to build logic — press F8, type the instruction name, and it auto-completes.
Pro Tips
After placing the empty box, start typing the instruction name (e.g., "MOVE") and TIA Portal will show matching instructions. Press Enter to confirm.
You can also drag instructions directly from the instruction tree on the right — but F8 is faster for experienced programmers.
In FBD, the empty box works the same way. It's the universal placeholder for any block-type instruction.
Open Branch
What It Does
Creates a parallel branch in your LAD network. In Ladder Logic, this is equivalent to wiring two rungs in parallel — creating an OR condition. The branch starts from the point where you place it and runs alongside the main rung.
When to Use It
Whenever you need an OR condition in LAD. For example: a motor can be started by EITHER a local pushbutton OR an HMI command. You place the first condition on the main rung, then open a branch for the alternative condition.
Pro Tips
In LAD, parallel branches visually represent OR logic. The output energizes if ANY branch has a complete TRUE path.
You can nest branches (branch within a branch) for complex OR/AND combinations, but keep it readable — more than 2-3 levels of nesting usually means you should use SCL instead.
Click on the exact point in the rung where you want the branch to start. The placement point matters for the logic structure.
Close Branch
What It Does
Closes (reconnects) a parallel branch back to the main rung. Every Open Branch must eventually be closed — it merges the parallel path back into the main logic flow. Without closing, the branch remains dangling and the network is invalid.
When to Use It
After you have placed all the conditions in your parallel branch and want to merge it back. The close point determines where the OR logic ends and series (AND) logic resumes.
Pro Tips
If you see a red 'X' on your network, it often means an unclosed branch. Check that every Open Branch has a matching Close Branch.
You can close a branch at different points along the main rung to create complex logic structures. The merge point is significant.
In FBD, branches are handled differently using OR boxes. Close Branch is primarily a LAD concept.
Insert Input
What It Does
Adds an additional input pin to an instruction box. Many FBD/LAD instructions support variable numbers of inputs — for example, an AND box can have 2, 3, 4 or more inputs. Insert Input adds one more connection point.
When to Use It
When a standard instruction box doesn't have enough input pins. For example, if you need to AND five conditions together, the default AND box has only 2 inputs — use Insert Input three times to add pins 3, 4, and 5.
Pro Tips
Not all instruction boxes support additional inputs. Timers, counters, and MOVE blocks have fixed pin counts. AND, OR, ADD, and MUL typically support extra inputs.
In FBD, adding inputs to an AND/OR box is very common and keeps the diagram compact instead of chaining multiple boxes.
You can also right-click an instruction box and select "Insert input" from the context menu.
LAD vs FBD — Where Do These Instructions Apply?
These general instructions behave slightly differently depending on the programming language:
| Instruction | LAD (Ladder Diagram) | FBD (Function Block Diagram) |
|---|---|---|
| Insert Network | Adds a new horizontal rung section | Adds a new logic section |
| Empty Box | Places a box inline on the rung | Places a box in the logic flow |
| Open Branch | Creates parallel rung (OR logic) | Use OR box instead |
| Close Branch | Merges parallel rung back | Not needed (OR box handles it) |
| Insert Input | Adds pin to instruction box | Adds pin to instruction box |
Best Practices for Organizing Your Code
Tips from experienced TIA Portal programmers
One Function Per Network
Keep each network focused on a single logical function. "Network 1: Motor Start/Stop", "Network 2: Motor Overload Alarm". This makes debugging and cross-referencing much easier.
Use Network Titles
Always add a title and optionally a comment to each network. These titles appear in cross-references, the call structure, and when searching — they're invaluable for large projects.
Limit Branch Nesting
If you find yourself nesting more than 2-3 levels of branches, consider switching to SCL for that logic. Complex branch structures are hard to read and maintain.
Consistent Naming
Name your tags descriptively: "bMotor_M1_Start" not "I0.0". Use the tag table to assign symbolic names to all your I/O addresses before writing logic.
TIA Portal Instructions Series
Explore all TIA Portal instruction categories
Frequently Asked Questions
What is the difference between LAD and FBD in TIA Portal?
LAD (Ladder Diagram) uses a visual format resembling electrical relay circuits with contacts and coils arranged on horizontal rungs. FBD (Function Block Diagram) uses logic gates and function blocks connected by signal flows. Both compile to the same machine code — the choice is mainly about readability preference. LAD is popular in North America, FBD in Europe.
Can I mix LAD and FBD in the same program?
You can use different languages in different blocks (e.g., an FB in LAD calling an FC in FBD), but within a single block, you must choose one language. You can also use SCL blocks alongside LAD/FBD blocks in the same project.
What is the maximum number of networks in a block?
TIA Portal supports up to 999 networks per block for S7-1200/1500. However, best practice is to keep blocks under 50-100 networks. If you have more, consider splitting the logic into multiple FBs or FCs for better organization.
How can I speed up PLC programming with AI?
T-IA Connect lets you describe your automation logic in plain text and generates SCL code, Function Blocks, and Data Blocks directly in your TIA Portal project. It can generate entire networks of logic from a simple prompt — saving hours of manual programming.