Skip to content

Dataset

PLC code and ladder logic datasets for AI training

A PLC code dataset is a collection of industrial controller programs, written as ladder diagram, structured text, function block diagram and sequential function chart, exported from vendor project files together with the tag list, I/O map, HMI screens and the design documents that say what the machine must do. SourceX sources these projects to a buyer's spec from established manufacturers, machine builders and systems integrators, and reviews who owns each program. Each dataset is de-identified and licensed for an agreed permitted use, and the buyer confirms how safety logic and plant network details were handled.

Dataset manifest

Sourced to your spec
What it is
Controller programs in ladder, structured text and function blocks with tag lists, I/O maps, HMI screens and design documents
Typical systems
Studio 5000 Logix Designer, TIA Portal, CODESYS, TwinCAT 3, RSLogix 500, EcoStruxure Control Expert, FactoryTalk View
Typical history
Specified by the buyer; depends on how many dated versions of each machine's program the holder kept
Modality
Code as exported text and XML; tag and I/O tables; specifications and drawings as documents
Delivery formats
Agreed per order; L5X, SCL, PLCopen XML or TwinCAT XML, CSV tag and I/O lists, PDF specifications and drawings
Preparation
Personal and plant names removed; specify removal of IP addresses, node names and passwords; safety logic as the owner allows
Licensing
Ownership reviewed per project between plant owner, machine builder and integrator; permitted use set in the license
Availability
Sourced to your spec from owners that agree to license; supply is not guaranteed
CodeIllustrative

What a delivery contains

Fields vary by source system and are fixed per order. A typical delivery includes:

FieldTypeWhat it holds
project_idstringPseudonymous ID for one controller project, shared by its units, tags, screens and documents.
controllerobjectVendor family, controller class and whether it is a safety controller, without network identity.
program_unitobjectOne routine, function block, organization block or program with its type and language.
task_configobjectThe task that runs the unit, cyclic, periodic or event-driven, which fixes scan order and timing.
logic_exportobjectExport route, the project version it came from, and whether the source was the offline project or a controller upload.
rungsarrayEach rung or network with its number, its comment and its logic as instruction text or XML.
tagsarrayTag or symbol names with data type, scope, description and the address or alias each one points to.
io_maparrayEach I/O channel with module type, field device tag, wiring convention, scaling and drawing reference.
types_and_blocksarrayUser-defined types, add-on instructions and library blocks, with a flag where the source is protected.
hmi_bindingsarrayOperator screens, the tags their objects use, and alarm messages with their trigger tags.
spec_refsarrayThe functional specification section or cause-and-effect cell each unit or rung implements.
commissioning_changesarrayChanges between versions with date, test phase, before and after logic and the stated reason.
safety_scopeobjectWhether safety logic is included, withheld or generalized, as decided by the owner.
provenanceobjectOwning party, authoring party, third-party library content and the categories of detail removed.
Sample recordIllustrative

Field names from the table above; values are masked placeholders.

Example record

{
  "project_id": "prj_4be210",
  "controller": {
    "vendor_family": "Rockwell Logix",
    "safety_controller": false
  },
  "program_unit": {
    "name": "Conv2_Infeed",
    "type": "routine",
    "language": "ladder"
  },
  "task_config": {
    "type": "periodic",
    "period_ms": 20
  },
  "logic_export": {
    "route": "L5X",
    "version": "as_commissioned",
    "from": "offline_project"
  },
  "rungs": [
    {
      "n": 4,
      "comment": "Infeed run. Stops on E-stop, jam or downstream not ready.",
      "text": "[XIC(Conv2_Start_PB),XIC(Conv2_Run)]XIC(EStop_OK)XIO(Conv2_Jam_Flt)XIC(Conv3_Ready)OTE(Conv2_Run);"
    },
    {
      "n": 5,
      "comment": "Jam: photoeye blocked longer than preset.",
      "text": "XIC(Conv2_Run)XIC(PE201_Blocked)TON(Conv2_Jam_Tmr,?,?);"
    }
  ],
  "tags": [
    {
      "name": "EStop_OK",
      "type": "BOOL",
      "alias_for": "Local:2:I.Data.0",
      "description": "E-stop relay healthy"
    }
  ],
  "io_map": [
    {
      "address": "Local:2:I.Data.0",
      "device_tag": "ES-200",
      "wiring": "NC chain, on when healthy",
      "drawing": "E-104"
    }
  ],
  "types_and_blocks": [
    {
      "name": "AOI_MotorStarter",
      "kind": "add_on_instruction",
      "source_protected": true
    }
  ],
  "hmi_bindings": [
    {
      "alarm": "Conveyor 2 infeed jam",
      "tag": "Conv2_Jam_Flt"
    }
  ],
  "spec_refs": [
    {
      "doc": "FDS rev C",
      "section": "4.2.3",
      "text": "Conveyor 2 stops on a jam at PE-201."
    }
  ],
  "commissioning_changes": [
    {
      "date": "2023-06-14",
      "phase": "site_acceptance",
      "rung": 5,
      "before": "preset 2000 ms",
      "after": "preset 3500 ms",
      "reason": "Long cartons tripped the jam fault"
    }
  ],
  "safety_scope": {
    "standard_logic": "included",
    "safety_program": "withheld by owner"
  },
  "provenance": {
    "owner": "plant_owner",
    "authored_by": "systems_integrator"
  }
}

Synthetic record for illustration. Field names, structure and format are agreed per order.

What AI teams use it for

Generate control logic from a specification

Specification sections paired with the rungs that implement them train models to write ladder or structured text for a described sequence.

Explain and troubleshoot existing programs

Comments, tag descriptions and I/O maps teach a model to say why a motor will not start by tracing permissives to field devices.

Translate between vendors and languages

Similar machines programmed on different platforms support migration work, such as moving a legacy controller's ladder to a current one.

Check logic against a cause-and-effect matrix

Matrix cells linked to code make examples for finding a missing interlock or one that trips the wrong output.

Evaluate automation coding agents

A held-out machine with its specification and as-commissioned program tests whether generated logic matches what worked.

Use-case guides: Coding agents, Private evaluation sets, Robotics and embodied AI

What makes this data valuable

Text exports, not printouts

Rungs as instruction text or XML can be parsed and compared, which a PDF listing cannot.

Comments and descriptions present

Rung comments and tag descriptions from the offline project carry the programmer's intent.

I/O map tied to drawings

Channels linked to device tags and drawing lines make each address mean something physical.

Traceable specification

Units linked to specification sections or matrix cells give each piece of logic a requirement.

Dated versions through commissioning

Factory-tested and as-left versions of one project expose the corrections made on site.

Completeness stated

A list of protected blocks, missing libraries and withheld safety logic shows what is absent.

System export

PLC code dataset

This page covers PLC and ladder logic programs.Illustrative

Why exported logic needs its tag list and I/O map

A PLC program is not kept as text. Studio 5000 saves a controller as a binary project file, TIA Portal as a project folder and CODESYS as a single project file, and each opens only in its vendor's editor at a compatible version. Text has to be exported: L5K or L5X from Studio 5000, SCL sources or block XML from TIA Portal, depending on version and installed options, PLCopen XML from CODESYS, and the XML files in which TwinCAT stores each program unit. Ladder survives this well. In a Rockwell export a rung is one line of instruction text, such as XIC(Start_PB)XIO(Fault)OTE(Motor_Run), while XML exports write a network as graphical elements and the connections between them. A printout of the same rung is a weaker asset.

The exported logic still says little by itself. Every rung refers to a tag or an address, and what that address is wired to is recorded elsewhere. Older controllers use bare addresses such as I:1/0 or N7:10, and Siemens programs can use absolute addresses such as %I0.0, whose meaning sits in a symbol or tag table. On many controllers comments and descriptions live only in the offline project, so a program uploaded from a running controller can arrive with its logic intact and every explanation gone.

The I/O map closes the gap between code and machine. It lists each module, slot and channel with the field device on it, the instrument tag used on the drawings and the scaling to engineering units. It also carries wiring conventions that invert how code reads. Stop buttons and safety contacts are normally wired closed so that a broken wire stops the machine, which means a healthy stop circuit reads true and the rung examines it for on. A model that sees only the rung learns the opposite of what the electrician built.

Specification, program and site corrections in one set

In control work the intended behavior is written down before the code. The functional design specification describes sequences, modes, permissives, interlocks and alarms. In process plants a cause-and-effect matrix goes further: each row is an initiating condition, such as a high-high level switch, each column an action, such as closing a valve or tripping a pump, and each marked cell is an interlock the program must contain. A rung or function block can be traced to the cell it implements.

Then the program meets the equipment. During factory acceptance, I/O checkout and site acceptance, engineers change what the specification got wrong: a timer lengthened because a valve travels slower than its datasheet said, a debounce added to a chattering sensor, a permissive relaxed after operators could not start the line. Each change is a correction with a physical reason, visible as a difference between the version tested at the factory and the version left running.

Requirement, implementation and correction together are what a model needs in order to write logic that works on a machine and not only on paper. The link is fragile. Plants often keep dated copies in folders in place of a version history, forced I/O and temporary bypasses can be left in the as-left program, and the specification is rarely updated to match. Ask which version each file is and whether the reason for each change was recorded in a punch list or commissioning log.

What to check before licensing

  • Establish who owns each program among the plant owner, the machine builder and the systems integrator, and ask for the contract terms that decide it.
  • Ask how safety-system logic and the network details of operating plants were handled under the owner's security rules, and confirm that IP addresses, node names and passwords are absent from the sample.
  • Open sample files and confirm the logic is exported text or XML, not a PDF listing, and that rung comments and tag descriptions survived.
  • Count the share of tags and addresses that have a description and an I/O map entry.
  • Ask which blocks are source-protected and therefore empty in the export, and which libraries are referenced but not included.
  • Ask which version each file is: as designed, factory tested, as commissioned or running now, and whether it came from the offline project or an upload.
  • Check that each specification or cause-and-effect revision matches the program version it is paired with.

Delivery No files move before a signed license. A listing or a request grants no files by itself.

How licensing works through SourceX

  1. 1

    Define

    Send the domain, modality, volume, format, timeline and permitted use you need.

  2. 2

    Source

    SourceX identifies businesses that hold matching data and are open to licensing it.

  3. 3

    Qualify

    Fit, rights and quality are checked, and you review samples before committing.

  4. 4

    License

    Scope, permitted use, exclusivity, price and obligations are agreed in writing.

  5. 5

    Deliver

    Approved data is prepared, de-identified where required and transferred securely.

Questions Acquisition Partners ask

What file formats do PLC programs come in?

They come as vendor project files plus the text exports made from them. Typical exports are L5K and L5X from Studio 5000, SCL and statement list sources or block XML from TIA Portal, PLCopen XML from CODESYS-based tools, and TwinCAT's XML file per program unit. Tag lists and I/O maps arrive as CSV or spreadsheet exports. Specify project files, exports or both.

Is ladder logic delivered as images or as text?

As text wherever the project file can be opened and exported. Ladder is stored as instructions and connections, not as a picture, so each rung can be written as instruction text or XML with its comment and tags. PDF printouts are sometimes all that remains for older machines. Ask for those to be labeled print-only so you can exclude them.

Which vendors and languages can be covered?

Coverage depends on the holders found for your spec. IEC 61131-3 defines ladder diagram, function block diagram, structured text and sequential function chart, and many plants mix them. Each vendor has its own dialect, instruction set and addressing, so a Rockwell rung and a Siemens network are not interchangeable. State the vendors, controller families and languages you need.

Who owns a PLC program?

It depends on the contract and has to be checked for each project. A plant owner may own the program outright, a machine builder may keep its standard machine code and license it with the machine, and a systems integrator may reuse its own library across clients. Rights review looks at the agreement behind each program. Blocks protected against viewing can be a sign that another party claims them, so ask who set the protection.

Is safety system logic included?

Only where the owner releases it under its own security rules. Safety programs for emergency stops, light curtains, burner management and process shutdown are often handled apart from standard logic, and an owner may withhold them or provide only their specification. Require in your spec that network addresses, node names and passwords of operating plants are removed, and ask that the manifest state which safety content is included.

Can the programs be compiled or simulated?

Sometimes, with the vendor's software. Opening, compiling or emulating a project needs the vendor's editor at a compatible version, a license and, for emulation, tools such as Studio 5000 Logix Emulate, S7-PLCSIM or a CODESYS or TwinCAT soft controller. Missing protected blocks and hardware configuration are the usual reasons a project will not compile. If you need verifiable builds, ask for the software version each project was saved in.

Evaluating this data for procurement?

Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.

Request dataset diligence

Tell us what your models need

Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.

Updated 25 November 2026.

See if your company qualifies