Getting Started with Siemens S7-1200 and TIA Portal
Setting up your first S7-1200 project doesn’t have to be intimidating. In this tutorial, I’ll walk you through creating a complete working project from scratch – including hardware configuration, programming, and online testing.
What You’ll Need
- Computer with TIA Portal V16 or later installed
- S7-1200 CPU (any model – we’ll use CPU 1214C in this example)
- Programming cable (Ethernet cable or USB-PMI adapter)
- Power supply (24V DC or 120-240V AC depending on model)
Step 1: Create a New Project
Open TIA Portal and follow these steps:
- Click “Create new project” on the start page
- Enter a project name (e.g., “My_First_S7_Project”)
- Choose a storage location
- Click “Create”
Pro tip: Create a logical folder structure from the start. Future you will thank present you.
Step 2: Add Your Device
Now let’s add the S7-1200 CPU:
- Click “Add new device” in the project tree
- Select “PLC” → choose your CPU model
- Name it something meaningful (e.g., “Main_PLC”)
- Click “OK” – TIA Portal will open the device view
You’ll see the CPU with its built-in I/O. Click on the CPU to see its properties in the inspector window.
Step 3: Configure Hardware
Before programming, let’s set up the basics:
- PROFINET interface: Assign an IP address (e.g., 192.168.1.10)
- Protection: Set up password protection if needed
- Time: Configure the PLC’s time (synchronize with PC)
To add expansion modules, drag them from the hardware catalog to the “Add distributed I/O” section of the CPU.
Step 4: Create Your First Program
Now for the fun part – let’s write some actual PLC code!
Go to “Program blocks” and double-click “Main [OB1]” – this is where your main program will live.
Simple Toggle Logic Example
Let’s create a program that turns on an output when a button is pressed:
// Ladder Logic | I0.0 |----[ ]----( ) | | Start | Q0.0 | | | Motor |
In LAD (Ladder Diagram), this looks like a normally-open contact in series with a coil.
Creating the Logic in TIA Portal
- In OB1, drag a “normally open” contact from the instructions pane
- Assign it to address I0.0 (your start button)
- Drag a “coil” and assign it to Q0.0 (your motor)
- Name them: “Start_Button” and “Motor_Output”
Step 5: Save and Compile
Before going online, save your work:
- Click the “Save” icon or press Ctrl+S
- Click “Compile” (blue icon) – fix any errors that appear
Compilation errors are shown in the “Info” pane at the bottom. Common issues include missing addresses or syntax errors.
Step 6: Go Online and Test
Here’s the exciting part – let’s run it on the real PLC!
- Connect your computer to the S7-1200 via Ethernet
- Click the “Go online” button (green arrow)
- Accept the connection when prompted
- Switch the PLC to RUN mode if not already
Now you can:
- Monitor – Watch the program execute in real-time
- Force – Manually set inputs to test logic
- Modify – Change values without stopping the PLC
Troubleshooting Common Issues
What if things don’t work? Here’s our checklist:
- Can’t go online? Check IP addresses match on PLC and PC
- No connection? Verify Ethernet cable and switch settings
- Program not running? Ensure PLC is in RUN mode
- Outputs not working? Check wiring and power supply
Next Steps
You’ve just created your first working S7-1200 project! From here, you can:
- Add more complex logic (timers, counters, math operations)
- Expand with signal modules
- Connect an HMI for operator interface
- Add communication to other devices
Stay tuned for our next tutorial on using timers and counters in TIA Portal.
