There is no "import ladder" button in TIA Portal. If your logic lives in another tool and needs to end up on an S7-1200 or S7-1500, the reliable route is SCL source files. Here's what works, what doesn't, and a checklist so the first compile isn't a wall of errors.
The four ways code gets into TIA Portal
| Route | Carries | From outside TIA? | Notes |
|---|---|---|---|
| External source files (.scl) | SCL (Structured Text) | Yes | Plain text. Import, then "Generate blocks from source". Supported for S7-1200/1500 since TIA Portal V13. |
| TIA Portal Openness (SimaticML XML) | All languages, including LAD | Possible, but hard | Needs the Openness option and a scripted application. The XML schema is version-specific and strict. |
| Global / project libraries | All languages | No | TIA-to-TIA only. Great for reuse, useless for migration from another vendor. |
| Reference project / drag-and-drop | All languages | No | Copy blocks between two TIA projects. |
So in practice, getting ladder logic from another platform into TIA Portal means one of two things: generate SimaticML XML for each version of TIA you support (fragile), or translate the logic to SCL and import it as a source file (robust). Almost every migration tool takes the SCL route.
Importing an SCL source file, step by step
- In the project tree, expand your PLC and open External source files.
- Choose Add new external file and select your
.sclfile. TIA Portal stores a copy in the project. - Right-click the file and choose Generate blocks from source. The FBs, FCs and DBs appear under Program blocks.
- Compile the PLC software. Errors show with block and line numbers — fix them in the source and generate again, or in the generated block directly.
- Create the PLC tag table for physical I/O (
%I,%Q) if it isn't in the source, and call your blocks fromOB1(Main).
What an SCL source file looks like
This is the same form TIA Portal uses itself when you right-click a block and choose Generate source from blocks. A valve with a feedback timeout:
FUNCTION_BLOCK "FB_Valve"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
OpenCmd : Bool; // command from sequence / HMI
FbOpen : Bool; // limit switch: valve open
FbClosed : Bool; // limit switch: valve closed
Reset : Bool;
Timeout : Time := T#5S;
END_VAR
VAR_OUTPUT
OutOpen : Bool; // solenoid output
Fault : Bool;
END_VAR
VAR
tOpen {InstructionName := 'TON_TIME'; LibVersion := '1.0'} : TON_TIME;
tClose {InstructionName := 'TON_TIME'; LibVersion := '1.0'} : TON_TIME;
END_VAR
BEGIN
#OutOpen := #OpenCmd AND NOT #Fault;
// Commanded open but no open feedback in time
#tOpen(IN := #OutOpen AND NOT #FbOpen, PT := #Timeout);
// Commanded closed but no closed feedback in time
#tClose(IN := NOT #OutOpen AND NOT #FbClosed, PT := #Timeout);
IF #tOpen.Q OR #tClose.Q THEN
#Fault := TRUE;
ELSIF #Reset THEN
#Fault := FALSE;
END_IF;
END_FUNCTION_BLOCK
A few things a plain IEC 61131-3 Structured Text file won't have, and that the translation must add:
- Block names in double quotes (
"FB_Valve") and global tags as"DB_Line".Speedor"Start_PB". - Local variables prefixed with
#in the code body. - The
BEGINkeyword between declarations and code. - Block attributes such as
S7_Optimized_Accessand aVERSION. - Timer instances declared as multi-instances (
TON_TIME) inside the FB rather than as global timers.
Checklist before you export
- Data types. In TIA,
Intis 16-bit andDIntis 32-bit;Realis 32-bit float. Make sure counters and totals that can exceed 32,767 areDInt. - Integer division.
7 / 2on integers gives3. Convert toRealfirst where it matters. - Timers and edges are instances. Every
TON,R_TRIGandCTUneeds its own instance and must be called every scan — don't call a timer only inside anIF. - Retentive data. Retentivity is set per DB / variable in TIA. Note which variables must survive power loss and set them after import.
- Physical I/O. Keep logic on symbolic names and map them to
%I/%Qin the PLC tag table once the hardware configuration exists. - Reserved words and name lengths. Rename anything that clashes with an SCL keyword or instruction name.
- Test before you export. Simulate the logic first; debugging a translation and a logic bug at the same time is painful.
How Logivyx exports to TIA Portal
In Logivyx, Ladder Diagram generates Structured Text, so ladder, ST and the logic behind sequences share one execution path. That same logic can be exported as SCL for TIA Portal — and as L5X for Rockwell Studio 5000.
A typical way OEMs use it:
- Build screens and logic together in Logivyx Studio and test them on the built-in simulator.
- Run the machine on Logivyx's embedded soft PLC — or, if a customer's plant standard requires Siemens, export the logic as SCL.
- Import it into TIA Portal with the steps above, compile, map the I/O and download to the S7-1200/1500.
- Keep Logivyx as the HMI on top of the S7, reading data blocks over S7 communication.
Your logic is never locked into one runtime. If you're writing ST from scratch, our Structured Text examples are a good starting point.
Try it on your own project.
Design screens, write Ladder or Structured Text, and run both on the built-in simulator — or connect to your own Siemens, Allen-Bradley or Mitsubishi PLC. No separate PLC needed.