IMDHMIControls LibraryShop main store

Explainer

Why you cannot import a PLC project into another platform

PLC programming Published 6 min read

Short answer

No CODESYS import command reads a Logix project file: the documented XML import paths carry objects between CODESYS projects only. Port by hand instead — freeze the source, map tags and data types to CODESYS variables, rebuild complete functional slices with their interlocks, and test each slice against the original before adding the next.

On this page
  1. What CODESYS can and cannot import
  2. Why the gap is semantic, not just a file problem
  3. Porting a 5000 ms on-delay timer from RSLogix 5000 to CODESYS
  4. Rebuilding in complete functional slices
  5. Testing each slice against the original
  6. Keep the simulation out of the cabinet
  7. Questions asked

No, there is no import that carries a working RSLogix 5000 project into CODESYS. CODESYS documents two import paths, a CODESYS XML format and PLCopen XML, and both of them carry objects between CODESYS-side projects; neither command parses a Logix project file, and no RSLogix 5000 export produces either format. Re-typing rungs one at a time is not the only option either. The reliable path is a controlled manual port: freeze the source project, map its tags and data types onto CODESYS variables, rebuild complete functional slices with their interlocks, and test each slice against the original before adding the next.

What CODESYS can and cannot import #

CODESYS provides commands that export objects from a project and import objects back into one, in two forms: a CODESYS XML format and the PLCopen XML interchange format. Both are built to move objects between CODESYS projects, or from tools that speak the same XML dialects. A Logix project file sits outside both: it is a proprietary controller format with its own instruction set, task model and data types, so the import commands have nothing to parse.

The reverse fails the same way, which is why a controller upload does not produce portable source either; this page on why cross-platform IEC 61131-3 code upload cannot carry a project covers the upload side in detail. Treat a readable import result, a clean compile or a rung that animates on screen as necessary but not sufficient: none of them proves the ported logic behaves like the original.

Why the gap is semantic, not just a file problem #

A controller application is more than ladder rungs. It includes program and routine organization, task scheduling and priority, tag scopes, user-defined data types, module and network configuration, and instructions whose data structures are defined per platform. A Logix timer is a structure with a preset, an accumulator and status bits; a CODESYS timer is a function block instance with its own TIME-typed inputs and outputs. The rung graphics can look identical while the data underneath is organized differently.

Stateful instructions make that difference practical rather than academic. Timers and counters depend on reset conditions, one-shots and latches depend on prior state, and shared tags can be read in one routine and written in another. Re-create only the visible rung and the slice can pass a simple bench test, then diverge the first time an interlock or fault path changes the conditions. That is why a port is planned around slices with their dependencies, not around a rung count.

Porting a 5000 ms on-delay timer from RSLogix 5000 to CODESYS #

The inputs come from the source project: a rung with an XIC on a start command feeding a TON named Delay1, preset 5000, whose done bit drives an output. On the Logix side the timer preset and accumulator are stored in milliseconds, so this delay is 5000 ms. The target is the standard CODESYS TON function block, whose PT input is of type TIME with a resolution of 1 ms.

The rule: both platforms measure the delay in milliseconds, so the preset transfers by unit conversion alone — divide by 1000 to write the CODESYS TIME literal, which reads in seconds directly.

The arithmetic: 5000 ms divided by 1000 ms per second gives 5 s, so PT takes the value T#5s. Check it backwards: 5 s times 1000 ms per second is 5000 ms, which matches the Logix preset exactly.

The result: the delay duration carries over with no scaling, and the surrounding structure maps one-for-one — the enable condition stays the rung state, the done bit becomes the function block's Q output, and the accumulator becomes the elapsed-time output.

The decision: a preset expressed in milliseconds ports one-to-one into a TIME literal, and both on-delay timers reset to zero when their input goes false, so this slice needs no timing rework. What still needs a test is who makes the rung false in your sequence. If a latched start command holds the rung on longer than the delay, the done bit arrives on schedule; if some interlock drops the rung early, both timers reset mid-count, and the port is only correct if you moved that interlock too.

Rebuilding in complete functional slices #

  1. Freeze the source. Work from a known copy of the project file itself, not from a controller upload; why uploading a PLC program is not full source recovery explains what an upload loses. Export or print the routine reports for everything in scope.
  2. Map the data. Create CODESYS variables and structures for every tag the slice reads or writes, and mark each one as a simulated input, an internal state or an output. Rebuild arrays and user-defined types deliberately rather than flattening them.
  3. Pick the language per slice. Which IEC 61131-3 PLC language to use for each control task is the short guide: ladder moves rung-for-rung, and structured text suits math and sequences.
  4. Port one complete slice. A slice is a whole small sequence: its permissives, timers, counters, latches and the outputs it drives. Isolated rungs without their dependencies compile fine and fail later.
  5. Bind the interface. Connect each screen control to the mapped variable that owns the value, so the screen and the logic never both write the same state.
  6. Keep a difference list. Record every behavior that does not match the reference project and close it before the next slice.

Testing each slice against the original #

Judge the slice with repeatable cases, not by appearance. For each one, run the same inputs in the reference project and in the port: the initialization state, the normal sequence, each state transition, the reset path, and the conditions that should hold an output off. Record the input values and the expected outputs so a failing case can be replayed exactly.

While it runs, watch the variables live. Look for unintended writes, values that never reset, and state that survives a reset it should not survive. Compare timing-sensitive behavior against the original, and test the order of events rather than trusting matching rung graphics. A slice that compiles has only proven the syntax; equivalence is a test result, and it is earned per slice.

Keep the simulation out of the cabinet #

A port built for simulation validates the sequence and the interface, and it stops there. Do not wire a simulated result to real equipment as if it were validated control logic, and keep the simulation model and the deployed controller application clearly separated in the project archive. Safety-related logic is the hard boundary: a safety function is designed and validated on the target controller with its real I/O, against the machine's risk assessment, and a passing visualization test in simulation contributes nothing to that validation.

Questions asked

Does any utility convert an RSLogix 5000 project file into a CODESYS project?

No documented converter does this. CODESYS's own import commands accept CODESYS XML and PLCopen XML, formats produced on the CODESYS side; a Logix project file is a proprietary controller format none of those commands parses. Vendor export reports, CSV tag lists and printed routines help you inventory the source project, but they document it rather than convert it. Plan the port as manual re-entry in slices from the outset instead of hunting for a converter.

How do I animate a graphic interface while the port is still incomplete?

Build the visualization against the mapped CODESYS variables rather than waiting for the whole project. In simulation mode CODESYS executes the application on the engineering PC with no controller hardware attached, and screen elements bound to those variables behave as they will later. Port one functional slice, bind its inputs and outputs to the screen, and the interface grows slice by slice in step with the logic instead of ahead of it.

Do matching instruction names guarantee matching behavior after a port?

No. Names such as on-delay timer or counter hide different data models on each platform: a Logix timer is a structure with its own preset, accumulator and status bits, while a CODESYS timer is a function block instance with TIME-typed inputs and outputs. Assume nothing and test stateful, timing-dependent logic against defined input cases; a clean compile proves syntax, and equivalence is a per-slice test result you record.

Keep reading

  • Troubleshooting

    Why converted CompactLogix timer ACC values jump after SLC migration

    A 20 to 70 ms timer ACC spread after converting SLC 500 logic to a CompactLogix is expected, not a fault: Logix timers count in 1 ms while SLC timers counted in 10 ms steps, and every prox edge is quantized by the input module's RPI plus the task interval. Budget roughly 40 ms of wander on a period-pair difference, then fix one-shot mapping, input buffering and SCP limits carried over in the wrong units.

    PLC programming

  • Troubleshooting

    Import PLC Coder XML into TwinCAT 3 with PLCopen import

    The "cannot consume the specified XML" error in TwinCAT 3 means the file reached a generic project-tree XML import, not the PLCopen importer. Right-click the PLC project in the solution tree, choose Import PLCopenXML and select the generated file. The command and its destination decide success; the XML stays as generated.

    PLC programming

  • Explainer

    Which programming software each legacy PLC family needs

    No. RSLogix 5000 and Studio 5000 Logix Designer program only the Logix families: ControlLogix, CompactLogix and GuardLogix. A PLC-5 processor is programmed with RSLogix 5, and an SLC 500 (catalog series 1747) or MicroLogix (1763, 1764, 1766) processor is programmed with RSLogix 500; matching data types or shared instruction names does not change that.

    PLC programming

How ControlLogix and S7-400 PLC architectures differ