Code Generation · Module

I/O Code

Generate a Studio 5000 routine from an I/O list. Upload a spreadsheet, paste from one, or add rows by hand. Output is an importable L5X with tags, UDTs, and AOIs bundled in.

Free tier Updated May 11, 2026 5 min read
7
Supported device types
~2 min
First generation, end to end
CSV
Import your devices
L5X
Imports into Studio 5000
The 2-minute path

These four steps produce an L5X ready for Studio 5000 import. The full guide below covers every option in detail.

  1. 1 Add devices · Upload a file, load a saved session, or add rows by hand.
  2. 2 Configure · Pick the device type, point at the UDT, set the IO address.
  3. 3 Generate · Get a self-contained routine L5X plus the supporting files.
  4. 4 Import · Into Studio 5000 and verify your new logic.

Overview

The I/O Code module generates a Studio 5000 routine from a list of physical devices (digital and analog I/O, motors, valves, VFDs). The output is a single importable L5X containing tags, UDTs, AOIs, and ladder logic.

Use it when starting a greenfield project that needs a consistent code baseline from rung 1, when adding a new line or zone with familiar device types, or any time the I/O list is the input and a structured routine is the desired output.

Not suitable for safety logic, complex sequencing, or anything that needs hand-tuned logic per device. The module covers the templated portion of repetitive I/O work; per-device engineering judgment still belongs in Studio 5000.

Before you start. A populated Tag Database lets you pull existing devices in with one click instead of typing them. A populated UDT Library lets you pick custom UDTs per device. Neither is required. PLCflow ships default UDTs and AOIs for every supported device type.

Step 1. Add your devices

Open I/O Code from the dashboard. On the empty page you have three ways in:

  • File Upload. Drop in a .xlsx, .xls, or .csv. The template (download from the upload panel) is a multi-sheet Excel with one sheet per device type. Single-sheet CSVs with a Type column also work.
  • Load Saved. Pick a previously saved session, or select the Default Set under Load Saved on the right side of the shell to load a sample set of devices into the editor. Loaded sessions come back with every row, every UDT pick, and every parameter you set.
  • Add Row. Type devices directly into the table. Good for small lists, quick edits, or starting from a blank slate.

A fourth option, Import from DB, appears once any row is on the table. It allows you to pull existing I/O devices from your Tag Database into the current run.

You can paste directly too. Once a row exists, you can paste directly from your spreadsheet into the table and PLCflow creates one row per pasted line. No file save needed.

Columns on each row

ColumnRequiredNotes
NameYesThe PLC tag base name
TypeYesOne of DI, DO, VALVE, AI, AO, MOTOR, VFD_MOTOR
IO AddressYesPhysical address (e.g.Local:1:I.Data.0)
UDTNoUDT for this device. Empty falls back to the built-in default. Disabled for DI and DO
DescriptionNoUsed in tag descriptions and generated comments
AOINoOverride AOI name. Used for analog outputs (AO)
IO Speed RefNoSpeed reference tag for VFD_MOTOR only

Beyond the columns above, each device type exposes a set of UDT-specific configurable parameters via a per-row Details button (motors, valves, analog devices, and VFDs). The dialog reads the device’s UDT structure and surfaces the configurable members for that type: feedback tags and run-mode flags for motors and valves, raw-to-engineering scaling and per-channel alarm setpoints for analog devices, speed-reference and acceleration parameters for VFDs, and interlock references for every type. These values map directly into the corresponding UDT members on the generated tag and into the AOI call on the generated rung. If you pick a custom UDT in the row, the Details dialog surfaces whatever configurable members your UDT defines instead of the defaults.

Step 2. Pick device types

The type column drives everything else. The seven types and their default library components:

TypeWhat it isDefault UDTDefault AOI
DIDigital input (limit switch, push button, prox sensor)nonenone
DODigital output (solenoid, indicator)nonenone
VALVEOn/off valve with optional position feedbackUDT_ValveDiscreteAOI_ValveDiscrete
MOTORFixed-speed motor controlled by a digital outputUDT_MotorSimpleAOI_MotorSimple
VFD_MOTORVariable-speed motor controlled via a VFDUDT_MotorVFDAOI_MotorVFD
AIAnalog input (pressure, temperature, level, flow)UDT_SensorAnalogAOI_SensorAnalog
AOAnalog output (control valve, drive reference)UDT_ValveAnalogAOI_ValveAnalog

The UDT and AOI files for each type in use are offered as separate downloads after generation, so you can import them once into your project and reuse them across runs. These are system components, available on every tier.

Bringing your own UDTs

If you already maintain custom UDTs for these device classes, upload them into the UDT Library and they appear in the UDT column dropdown automatically. The generator emits AOI calls and tag members keyed off whichever UDT you pick.

Custom UDT uploads require Pro or higher. Free-tier accounts can use the built-in system UDTs (UDT_MotorSimple, UDT_ValveDiscrete, and the rest) but can’t upload their own. Upgrade to Pro to point I/O Code at your shop’s UDT definitions. AOIs ship as system files for everyone. There’s no separate AOI upload step.

Saving and reloading your configurations

Above the table, Save stores the current rows under a name and version. Load pulls any saved configuration back in. Saved Configs include every row’s parameters from the Details dialog. Use this for projects you come back to, an ever-changing project I/O list, or for sharing a configured run with a teammate by name.

Save to DB is the other side of the import path: it pushes the rows you’ve built up into the Tag Database, so the next module (Alarm Code, Parameter Code) can reference them by name.

Step 3. Generate

Click Generate Code. The output console streams progress, and once the run finishes you get three panels:

File Preview. A two-column pane on the left lists every generated text file; the right side shows its contents with a per-file Copy button. Good for grabbing one routine’s logic without downloading anything.

Generated Files. Card with one row per file. Click any row to download that file. The Download ZIP button bundles everything into one archive.

Required Components. A separate card listing the UDT and AOI L5X files for whichever device types are in your run. These are already bundled inside the routine L5X and resolved on routine import, so you don’t need to import them separately. They’re surfaced here as standalone downloads if you want to import the UDTs or AOIs independently for reuse in other routines, or inspect them in isolation.

What’s in the bundle

FilePurpose
io_routine.L5XThe main deliverable. Self-contained routine: tags, UDT instances, AOI references, and ladder logic in one importable file
device_tag.csvTag definitions for every device. Useful for HMI tag imports
device_input.txtInput logic mapping physical inputs to controller tags
device_output.txtOutput logic mapping controller tags to physical outputs
device_cfg.txtDevice initialization and parameter setup
device_aoi.txtAOI calls for the analog and motor/valve devices
device_reset.txtReset and fault-clearing logic
device_simulation.txtSimulation logic for bench testing without physical I/O

For most projects the L5X is what you import. The .txt files are there if you want to paste a single section into an existing routine, or read the generated logic in plain text before committing.

Step 4. Import into Studio 5000

In your Studio 5000 project:

  1. Right-click the program you want the routine in, then Import then Import Routine.
  2. Select io_routine.L5X.
  3. Set the routine name in the import dialog. Confirm any tag-collision behavior (usually merge for repeat imports).
  4. Click OK.
  5. Review the imported routine before deployment. Walk the rungs, confirm tag references, and check that the AOI calls match your equipment’s signal map.

Review before commissioning. PLCflow output is draft control logic. Read it, test it against simulation, and run it through Code Analyzer before going online. The module produces a structured starting point; review and validation remain the engineer’s responsibility.

Common pitfalls

Common pitfalls

  • io_address looks right but Studio 5000 errors on import. PLCflow does not validate the address against your hardware tree. Typos in slot/channel notation pass through and surface during the Studio 5000 import. Confirm the address matches your I/O configuration.
  • The UDT column is empty for DI / DO. That’s intentional. Discrete I/O does not use a UDT in the default generator. If you want UDT-wrapped discretes, change the type to VALVE or add a custom UDT and use the matching device type.
  • Custom UDT picked but the generated AOI calls don’t reference the new members. The generator emits members keyed off the UDT structure. If your custom UDT renames or omits members the default AOI expects, you’ll need a custom AOI too. Drop both into your library and pick them together per device.
  • VFD speed reference left blank. VFD_MOTOR rows need an IO Speed Ref value for the analog output AOI to wire up. Validation flags it before generation runs.
  • Saved session won’t load. Saved sessions are tied to your account. If you switched accounts or your session expired, log back in and the Load list repopulates.

FAQ

Does I/O Code support GuardLogix safety I/O?

Not currently. Safety I/O involves SIL-rated logic patterns and hardware that PLCflow is not certified to generate. Standard I/O on a GuardLogix processor works fine; safety-rated I/O does not.

Can I bring my own UDTs and AOIs?

Yes. Upload them into the UDT Library and they appear in the UDT column dropdown automatically. Defaults only fire when nothing matches.

What happens if I re-import the same routine into Studio 5000?

Studio 5000’s import dialog asks how to handle name collisions (merge, rename, or skip per element). PLCflow does not touch your project until you confirm inside Studio 5000.

Does it handle multi-sheet Excel?

Yes. The downloaded template is multi-sheet, one sheet per device type. PLCflow infers the device type from the sheet name and applies the right column schema per sheet. Single-sheet CSVs with a Type column also work.

Can I save my work and come back to it later?

Use Save at the top of the table. Saved sessions appear under Load Saved on the empty page and behind the Load button once you have rows. Saves include every row’s parameter values from the Details dialog.

  • Tag Database. Foundation for naming consistency. Set this up first and every I/O Code run can pull devices straight from it.
  • Alarm Code. Richer alarm configurations than what the device-level Details dialog produces. Delays, enable conditions, multiple trigger types.
  • Code Analyzer. Run the generated routine through this before commissioning. Catches unconditional outputs, naming inconsistencies, and structural issues.
What's next

Related modules

Was this helpful?

Honest feedback. We read all of it.

Try I/O Code on real data

Free tier, no credit card. Bring a real spreadsheet, see what comes out.