Sysmac Studio · NJ/NX · the toolkit

Power tools

Every real machine leans on the same handful of building blocks: a timer that waits, a state machine that decides, and the IEC languages you'll write them in. Try the first two below and watch them run.

⏲️ TON / TOF / TP🚦 CASE state machine
01 · Timers

TON, the on-delay timer

A TON waits. Hold its input IN true and its elapsed time ET climbs toward the preset PT; when it gets there, the output Q goes true. Let go and the timer resets. Press and hold the button to see it.

Q
PT = T#3s
tmr : TON;
// call it every cycle
tmr(IN := btnHeld,
    PT := T#3s);

lampOn := tmr.Q;
elapsed := tmr.ET;

💡 TOF delays the turn-off; TP fires a fixed-length pulse. You call both the same way as TON; only the timing behaviour changes.

02 · State machines

CASE: one state at a time

A machine should always be in exactly one known state. A CASE on a state variable is the cleanest way to guarantee that. Step through this small start/run/stop cycle one state at a time.

IDLE STARTING RUNNING STOPPING
CASE state OF
  0: // IDLE
     IF startCmd THEN state := 1; END_IF;
  1: // STARTING
     motor := TRUE; state := 2;
  2: // RUNNING
     IF stopCmd THEN state := 3; END_IF;
  3: // STOPPING
     motor := FALSE; state := 0;
END_CASE;
03 · Check yourself

One quick question

A TON with PT := T#3s has had IN true for 1.2 s. What is Q?