Appearance
Tasks, Programs & Routines
Last updated
License feature: Ladder LogicLadder logic is organized in three levels:
| Level | What it is |
|---|---|
| Task | One independent scan loop with its own scan mode and period. Holds programs and a set of Task Tags shared by all its programs |
| Program | A group of routines, e.g. one per machine or station. Has its own Program Tags. Can be switched off (unscheduled) without deleting it |
| Routine | A ladder routine (rungs) or an SFC chart. Each program has exactly one Main routine, which runs every scan; the others run only when a JSR calls them |
The Ladder Logic page
Open Ladder Logic in the Visualize section of the sidebar. The page shows the safety notice, then Ladder Logic Tasks — one card per task, sorted by priority and then name.
Each card shows the task name, a Running or Stopped badge, the scan mode (Continuous or the period, e.g. 100ms) and, while running, Scan: … ms avg / … total. The buttons:
| Button | What it does |
|---|---|
| Play (Start) / Square (Stop) | Starts or stops scanning (admins and editors; operators only when Operators can run this is ticked for the task) |
| Calendar (Schedule start/stop) | Opens Schedules with a Start Ladder Task schedule filled in |
| Gear (Open Editor) | Opens the editor |
| Trash (Delete) | Asks Delete task "…"?, stops the task and deletes it with its programs, routines and SFC step tags. Shown to administrators only |
Click the arrow at the left of a card to expand it: it lists Programs with a green (scheduled) or gray (off) dot and the routine count, Add Program and Edit, and the task's Event log — the 20 most recent starts, stops, resets, write errors, faults and recoveries, newest first, refreshed every 5 seconds.
Creating a task
- Click New Task.
- Task Name — e.g. Main Control Task.
- Scan Mode — Periodic (default) or Continuous.
- Period (ms) — for Periodic; default 100, minimum 10.
- Click Create. The editor opens.
- A new task has no programs. In the Routines panel click Add Program, type a name (e.g. Press1) and press OK. The program is created with a Main routine.
- Click Main, build your rungs, click Save, then Run.
Tip: Use Periodic at 100–500 ms for almost everything. The appliance reads most device tags every few hundred milliseconds anyway, so scanning faster gains nothing and costs CPU. See The Scan Cycle.
Task Settings
Click the gear next to the task name in the editor toolbar (Task Settings):
| Field | Default | Effect |
|---|---|---|
| Task Name | — | Renaming changes the SFC step tag paths (see SFC) |
| Description | — | Shown when the task card is expanded |
| Scan Mode | Periodic | Periodic or Continuous. Applied at once, even while running |
| Period (ms) | 100 | Periodic only; values below 10 become 10 |
| When the task is stopped | Leave outputs as they are | Leave outputs as they are keeps every output at its last value, as a PLC does in program mode. Switch outputs off turns off every device output driven by an OTE or OTL coil, and everything an SFC chart drives, when someone stops the task. Saving a routine never triggers it. Make sure switching off is safe for the machine |
| Operators can run this | Off | Lets operators start and stop this task, from a dashboard button or the API. Off to begin with: starting a task drives real outputs. Admins and editors can always start and stop it |
| On a fault | Keep scanning (alarm only) | What a runtime fault does. Keep scanning retries on the next scan and raises a critical alarm; Stop the task halts it on the first fault. The scan watchdog, and losing the driver service on a task that uses real device I/O, stop the task either way — see Starting, Stopping and Faults |
| Enabled | off | When ticked, the task starts automatically when the Scada.Ink service starts. It does not start or stop the task now |
Click Save in the panel. Saving reloads the task (see Starting, Stopping and Faults).
Warning: A new task is created with Enabled off. A task you started with Run stays stopped after the appliance restarts unless Enabled is ticked.
Programs
In the editor's Routines panel, hover a program name to see:
- the toggle — Disable scheduling / Enable scheduling. An unscheduled program shows (off) and is skipped entirely: its Main routine doesn't run and its tags aren't read. Its coils keep their last values;
- the pencil — Rename program (type, then the tick or Enter);
- the trash — Delete program (Delete program "…" and all its routines?; admin only).
Programs run in the order they were created, one after another in the same scan. There is no way to reorder them in the editor.
Routines
Under each program:
- Add Routine — asks for a name (Routine name:) and adds an empty ladder routine.
- Add SFC Chart — only with the Sequential Function Charts feature. See SFC.
- Click a routine to open it. Main shows (Main); charts show SFC.
- Hover a routine: pencil Rename routine; star Make Main routine (only when the open routine has no unsaved changes — Save this routine first); trash Delete routine (Delete routine "…"?, admin only). The Main routine cannot be deleted; make another routine Main first.
Warning: Renaming a routine does not update JSR elements that call it by name. The JSR shows "…" is not a routine in this program — the jump will do nothing. until you pick the new name.
Subroutines
- Only a program's Main routine runs by itself.
- A JSR element calls another routine in the same program when the rung has power at that point. The called routine runs completely, then the scan continues with the rung after the JSR.
- RET ends a routine early when its rung has power.
- SBR is just a marker; it does nothing.
- Calls can nest up to 32 deep; deeper fails the scan with Call stack overflow (max 32).
- A routine that isn't called in a scan isn't scanned at all: its coils keep their last values and its timers pause (see the timer notes in the Element Reference).
Starting and stopping from elsewhere
| From | How |
|---|---|
| A dashboard | Button widget, action Ladder Task, Do What: Start scanning or Stop scanning |
| A workflow | Start Ladder Task, Stop Ladder Task, Ladder Task Status nodes — see Input / Output Nodes |
| A script | ladder.start('Main Control Task'), ladder.stop(...), ladder.isRunning(...), ladder.status(...) |
| A time of day | Schedules: Start Ladder Task / Stop Ladder Task |
Details and permissions are in Starting, Stopping and Faults.