BLOG / PLC

A PLC Code Standard That Fits on One Page (and Gets Followed)

19 June 2025 StandardsProgram StructureTIA PortalTeams

Fifty-page coding standards die in drawers. What survives is one page, enforced. Ours, distilled:

Structure

  • Layers: I/O mapping → equipment control (typed FBs: motor, valve, axis) → coordination/sequences (GRAPH or state FBs per machine area) → machine-level (modes, alarms, comms). Calls flow downward only.
  • One FB, one job; instances per equipment via UDT-typed interfaces. No global-flag spaghetti between areas — interfaces are declared structs, period.
  • The map is in the project: a top-level group of commented “table of contents” blocks or the program structure doc — a stranger finds the infeed logic in three clicks.

Naming and comments

  • Names say role, not address: convInfeed.motor.cmdRun — searchable, pronounceable, HMI-friendly.
  • Comments state intent and units (“bar”, “mm/s”) — never restate the instruction. Every workaround gets why plus date.
  • English or Turkish — pick per project and stay consistent; mixed-language projects age worst.

Discipline

  • Compile clean: zero warnings tolerated by policy (warnings hide tomorrow’s fault).
  • Archive at milestones with meaningful names; the compare tool audits every external delivery.
  • Code review is a checklist pass (naming, layer violations, error handling, alarm texts) — thirty minutes per release, enforced by whoever owns the machine, not by goodwill.

FAQ

Adopt mid-project? New code follows the standard immediately; legacy converges opportunistically per touched block. Big-bang restyling of running machines is risk without revenue.

Which standard document do we hand customers? This page, plus the library. Customers who receive typed, layered, commented projects come back — that is the business case.


Zone Otomasyon delivers to this standard and audits third-party code against it. Request our full standard.