PLC Simulator
Search-intent reference hub

PLC Codes: Instructions, Examples and Fault-Code Workflow

“PLC codes” can mean instruction mnemonics, complete control programs, controller diagnostics or device fault numbers. This field reference separates those intents, explains how each behaves during a scan and routes every code to either a runnable test or the exact primary manual needed to diagnose it safely.

Reference PLC students, maintenance technicians and programmers
Real PLC codes and examples footage

See this exact skill in the working simulator.

Watch the real browser product respond to the task on this page, then try the same practical workflow yourself. No slides, concept mockups, install, or credit card.

Try this in the browser
PLC Codes — See Instructions Become Working Machine Logic

Three meanings, one evidence path

Connect instruction codes, working patterns and fault evidence

Use the visual sequence to identify the code type first. Then open the matching reference, run the control pattern and preserve the exact diagnostic evidence before consulting the hardware manual.

PLC training bench connecting ladder instructions, a guarded machine, live I/O evidence, measurements and a technical manual
Use the evidence-first troubleshooting method
01Separate program syntax from machine behavior and hardware diagnostics; a useful answer preserves all three layers of evidence.
PLC timer and counter instruction path connected to observable machine events
Open the PLC instruction reference
02Read the instruction contract, including timing base, edge behavior and reset conditions, before reusing a mnemonic.
Ladder logic seal-in motor example with start, stop, holding contact and motor output behavior
Study tested ladder logic examples
03A complete pattern combines instructions with permissives, reset behavior and observable tests instead of presenting an isolated code fragment.
Industrial PLC instruction-family bench connecting contacts, coils, timing, counting, data movement and comparison to physical inputs and outputs
Compare instruction families and syntax
04Instruction families become memorable when each mnemonic is tied to its scan behavior, operands and observable machine result.
PLC scan-cycle evidence board linking field inputs, ladder evaluation, timer and edge state to motor, valve and stack-light outputs
Learn the PLC scan cycle
05Read inputs, solve logic, update outputs and repeat: rung order and retained state explain why correct-looking code can still behave unexpectedly.
Guarded conveyor and motor control pattern shown under normal start, interlock stop and fault-recovery test states
Run tested ladder logic patterns
06A reusable code pattern is not complete until normal operation, boundary conditions, interlocks and recovery all produce the intended physical outcome.
PLC diagnostic workflow separating controller, remote input output, industrial network, drive and motor evidence before consulting the manual
Practise evidence-first fault finding
07Preserve the layer, code, timestamp and active condition first; then use the exact controller, module, network or drive manual for the recovery procedure.

Follow the workflow

Learn one step, use the product, inspect the evidence.

01

Instruction codes

Rockwell-style mnemonic codes include XIC, XIO, OTE, OTL, OTU, ONS, CTU and MOV. IEC systems express similar behaviour with contacts, coils and standard function blocks such as TON, TOF and CTU.

Do this in the product

Open the PLC instruction hub for per-instruction truth tables, syntax notes, examples and runnable scenarios.

Open the exercise
02

Program examples

Useful examples combine instructions into patterns: seal-in motor control, start permissives, alarm latches, pump alternation, traffic-light sequences, counters and analog scaling. The pattern and its edge cases matter more than copying addresses.

Do this in the product

Use the ladder logic examples and PLC projects hubs to open a matching scenario in the simulator.

Open the exercise
03

Fault and diagnostic codes

CPU, I/O, drive and communication fault numbers are vendor-, family- and firmware-specific. Record the exact code, state and timestamp; preserve evidence; then use the manufacturer manual. Never clear a fault repeatedly without finding the cause.

Do this in the product

Practise the evidence workflow in electrical troubleshooting and commissioning scenarios without claiming a generic table replaces the manual.

Open the exercise
04

Portable Structured Text

IEC Structured Text uses statements such as IF, CASE, FOR and function blocks. Vendor environments add libraries and data types, so test portability rather than assuming source code will compile unchanged.

Do this in the product

Compare the same lesson across IEC, Allen-Bradley and Siemens dialect views in the product.

Open the exercise
05

Scan-state and recovery codes

A status bit is only meaningful in context: the input image that was sampled, the rung order, the current timer or counter state, the output update and the task that owns the code. Preserve that state before forcing, resetting or editing anything.

Do this in the product

Run a normal case, an edge case and a recovery case; compare the live I/O and test evidence before accepting the program.

Open the exercise

Field reference

Read the code, predict the scan, prove the result.

These tables separate instruction syntax, reusable control patterns and hardware diagnostics. Use them to choose the right reference before changing a running program.

First identify what “PLC code” means

Searches for PLC codes mix four different jobs. Start here so a ladder mnemonic is not confused with a CPU fault number or a complete control program.

Code typeExamplesUse it forCorrect next step
Instruction mnemonicXIC, XIO, OTE, TON, CTU, MOVBuilding one operation inside ladder or Structured TextCheck operands and scan behavior in the instruction manual, then run a focused test.
Program patternSeal-in, permissive chain, alarm latch, pump alternationCombining instructions into a reusable control behaviorTest normal, boundary, interlock and recovery cases against the machine brief.
Controller or I/O diagnosticMajor fault type/code, module status, channel diagnosticLocating a CPU, task, connection, module or channel problemPreserve the event record and open the manual for the exact controller and firmware.
Drive or field-device faultOvercurrent, undervoltage, encoder, network or thermal tripDiagnosing a VFD, servo, instrument or smart deviceRecord active conditions and use the exact device-family manual; do not substitute a generic list.

PLC instruction codes by scan behavior

Names vary by vendor. The transferable part is the state transition: what is read, what is retained, when an edge is recognized and what must reset.

FamilyCommon codesWhat changes during the scanMinimum proof test
ContactsXIC / XIO; NO / NC contactThe rung condition reads a Boolean tag; the symbol does not change the physical wiring.Toggle the source bit and verify both true and false paths.
OutputsOTE / coil; SET-RESET; OTL / OTUA non-retentive coil follows the solved rung; latch instructions retain state until an explicit reset.Prove de-energization on Stop, interlock and restart.
TimersTON, TOF, TP, RTOElapsed state advances with scan time while enabling conditions and reset rules differ.Test just below, at and just above the preset, then interrupt and restart.
CountersCTU, CTD, CTUD, RESCounts normally change on a qualifying edge, not on every scan that the input remains true.Hold the input true, pulse it repeatedly and verify reset and rollover assumptions.
EdgesONS, OSR, R_TRIG, F_TRIGThe output is true for one execution when the remembered previous state changes.Prove one pulse per transition and verify first-scan behavior.
Compare and limitEQU, NEQ, GRT, LES, LIM; EQ, GT, LTThe rung result depends on type, sign, scaling and boundary inclusion.Test both boundaries, one value outside each side and invalid or stale data.
Data and mathMOV, COP, ADD, SUB, MUL, DIV, SCALEValues change immediately for later rungs in the same task; type conversion can truncate or overflow.Check data types, zero division, range limits and downstream rung order.
Sequence and stateCASE, sequencer, step bits, state machineOnly permitted transitions should advance the process; recovery must return to a defined state.Test every transition, aborted step, power-up state and manual recovery path.

Fault-code evidence workflow

A numeric code without provenance is weak evidence. Capture the surrounding state before changing the plant, then consult the authoritative manual.

LayerCapture before resetLikely evidence sourceUnsafe shortcut to avoid
Controller and taskMode, major/minor class, type/code, task and timestampController fault log, diagnostic buffer and programming manualRepeatedly clearing a major fault without locating the triggering instruction.
Remote I/O and channelModule state, channel state, field power and last known valueModule status page, wiring diagram and module manualAssuming a logic fault when field power or a channel is unhealthy.
Industrial networkLink state, connection status, topology, device reachability and sequence of eventsManaged-switch diagnostics, controller connections and device manualReplacing a device before checking power, cabling, addressing and connection state.
Drive and motorDrive trip, DC bus, current, speed command, thermal state and run sourceExact VFD/servo manual plus measured electrical and mechanical evidenceResetting an overcurrent or thermal trip and immediately restarting the load.
Program behaviorInput image, rung state, retained bits, timer/counter values and commanded outputsOnline monitor, trend, event log and repeatable simulator testTreating an energized output command as proof that the actuator moved safely.

Core concepts

Know what the evidence means.

The simulator creates a repeatable result; these concepts make that result transferable to real vendor software and supervised practical work.

Mnemonic

A short instruction identifier such as XIC or OTE. Meaning and operand rules depend on the platform.

Pattern

A tested arrangement of instructions that solves a recurring control problem, including reset and fault behaviour.

Diagnostic evidence

Code, timestamp, active state, surrounding I/O and preceding event sequence make a fault number actionable.

Scan contract

The same code can produce a different result when rung order, retentive state, edge detection or task timing changes. Predict the scan before editing the pattern.

Common mistakes to avoid

  • × Treating all vendor mnemonics as interchangeable
  • × Copying a latch without a safe reset path
  • × Using a generic fault-code table for real hardware
  • × Publishing a code example without a runnable test
  • × Clearing a fault before preserving its timestamp and active state
  • × Assuming a green rung proves the machine completed the required behavior

Continue in the workspace

Turn this tutorial into retained training evidence.

Run the foundation exercise publicly, then use a subscription for advanced challenges, saved configurations, full attempt history, sharing, assigned paths and team reporting.

Technical reference questions

Questions before you continue.

Common Rockwell mnemonics include XIC, XIO, OTE, OTL, OTU, ONS, CTU, CTD, TON, TOF and MOV. IEC tools may display equivalent standard elements differently.

PLC code and example path

Move from one instruction to a tested control pattern

Read the instruction behavior, inspect a complete pattern, run its edge cases and then adapt it as a project.