Loading local progress…
Practise in
Level 1, 0 XP · your progress
Free · Rockwell, Siemens and TwinCAT · Nothing to install

Ladder logic to structured text converterand Rockwell to Siemens, both ways

Paste a Studio 5000, TIA Portal or TwinCAT program and get it back in another maker's code, or as ladder. Then PLC Gym runs both versions side by side to show they do the same thing.

  • Every line mapped Hover a rung or line to see where it came from
  • Proved, not guessed Both programs run on the same inputs, scan by scan
  • Stays in your browser Your code is never uploaded

Rockwell, Siemens and TwinCAT: the same instruction, three names

The converter maps each of these for you. It's also a handy cheat sheet when you move between plants.

What it doesRockwell Studio 5000Siemens TIA PortalBeckhoff TwinCAT 3
Normally open and closed contactsXIC, XIONO and NC contactsWritten as logic: A AND NOT B
Coil, latch and unlatchOTE, OTL, OTUCoil, S, Rx := …, IF … THEN x := TRUE
On-delay timerTON on a TIMER (.PRE .ACC .DN); TONR on an FBD_TIMER in STTON_TIME (PT, ET, Q)TON (PT, ET, Q)
Off-delay timerTOF; TOFR in STTOF_TIMETOF
Up counterCTU on a COUNTER, reset with RES; CTUD in STCTU on an IEC_COUNTER (PV, CV, Q, R)CTU (PV, CV, Q, RESET)
Rising edgeONS, OSR; OSRI in STP contact, P_TRIG, R_TRIGR_TRIG
Move a valueMOVE (MOV before v36)MOVEx := y
CompareEQ, NE, LT, GT, LE, GE (EQU, NEQ, LES, GRT, LEQ, GEQ before)CMP ==, <>, <, >, <=, >==, <>, <, >, <=, >=
MathsADD, SUB, MUL, DIV, CPTADD, SUB, MUL, DIV, CALCULATE+, -, *, /
Scale an analogue inputSCPNORM_X then SCALE_XWritten out as a formula
Whole numbersDINT (INT exists, DINT is native)Int, DIntINT, DINT
TimesDINT milliseconds: 2000Time: T#2sTIME: T#2S
Tags inside a blockProgram tags, no prefix#Name (block interface)No prefix (VAR sections)

What it converts, and what it doesn't

It converts the logic. Anything it can't carry across is listed with the line and what to do, never left out quietly.

Converts

  • Ladder logic to Structured Text, every time
  • Structured Text to ladder, where the logic fits ladder: contacts, coils, set and reset, timers, counters, edges, compares, moves and maths
  • Rockwell to Siemens and back, in Structured Text or ladder, and TwinCAT both ways
  • Timer and counter members (IN/PT/Q/ET to TimerEnable/PRE/DN/ACC), # locals, data types, edges, MOVE and MOV, compares and maths
  • Tag declarations with their comments, and the comments in your code

Doesn't convert

  • Hardware configuration, I/O addresses, networks and communications (MSG, PUT/GET, EtherNet/IP, PROFINET)
  • HMI tags, alarms and screens
  • Vendor library blocks such as PID, motion and drives
  • Your own function blocks, AOIs and UDTs (not yet)
  • FOR loops into ladder: they're flagged with the line and a suggestion
  • STL, IL, FBD, SFC and GRAPH

How the proof works

1. Convert

Your code is read into a neutral form, then written out the way the target maker writes it: member writes and TONR in Logix, one TON_TIME call in SCL, T#2s or 2000.

2. Run both

PLC Gym's simulator runs the original and the converted program for 3,000 scans (60 simulated seconds). Inputs are pressed, held and released, and numbers cross every limit your code compares against.

3. Compare every scan

Every output is compared on every scan. Where makers truly differ (a one-shot on the first scan, a counter reset), the converter writes the code so the behaviour still matches, and says so.

It's a strong check, not a guarantee: test on the real machine as your site requires. Want to see it run? Press Run it to open the converted program on the online PLC simulator's control panel, or test your PLC code on a 3D machine.

Questions engineers ask

Can you convert ladder logic to Structured Text?

Yes, always. Each rung becomes one or two lines of Structured Text: contacts become AND and OR, coils become assignments, OTL and OTU become IF … THEN, and timers, counters and one-shots become calls in the target maker's own style. The rung comments come across as comments.

Can any Structured Text be turned into ladder?

Most control logic can: contacts, coils, set and reset, timers, counters, edges, compares, moves and maths. FOR loops can't, because ladder runs each rung once per scan, so the converter flags the line and suggests writing one rung per element or keeping that part in Structured Text.

Does it convert Rockwell Studio 5000 code to Siemens TIA Portal?

Yes. Paste or open an L5X export (a Structured Text or ladder routine) and choose Siemens SCL or LAD. TONR timers become TON_TIME, CTUD counters become CTU, OSRI one-shots become R_TRIG, DN becomes Q and ACC becomes ET or CV, and every local tag gets its # in SCL. It works the other way too.

How do I know the converted code does the same thing?

PLC Gym runs your original and the converted program side by side in its simulator for thousands of scans, driving both with the same inputs, and compares every output on every scan. You see the result as a logic analyser trace. Press Run it to open the converted program on PLC Gym's control panel, with buttons, switches and lamps made from its tags, and try it yourself. Always test on the real machine as your site requires.

Is my code uploaded anywhere?

No. The converter runs entirely in your browser tab. Your code is never sent to PLC Gym's servers, and it is hidden from the session recordings we use to improve the site.

Can I import the result into TIA Portal, Studio 5000 or TwinCAT?

Yes. Download an .scl source and use Generate blocks from source in TIA Portal, an .L5X to import into Studio 5000, or a .TcPOU to add to a TwinCAT 3 project. TIA Portal has no text format for ladder, so for Siemens LAD you redraw the networks shown, or use the SCL file.

What doesn't it convert?

Logic only: not hardware configuration, communications, HMI tags or vendor library blocks such as PID and motion. Your own function blocks, AOIs and UDTs aren't converted yet. Anything it can't carry across is listed with the line and what to do, never left out quietly.