How-to
Connect a TON output to a function block input in TwinCAT ladder
Short answer
In TwinCAT ladder, the rung's power flow always lands on a block's first input, so with NT_GetTime it lands on NETID instead of START. Right-click the rung and choose Box with EN to create an enable path, then right-click the short line before START and use Insert at Block... to place a box there, replacing the default AND with TON by typing the name or using Input Assistant with F2.
On this page
In TwinCAT ladder, a rung's power flow always lands on the first — top — input of a function block. NT_GetTime's first input is NETID, a target-system address rather than a Boolean, so the editor connects the rung there and gives you no way to pull it down to START. The fix is two moves: right-click the rung and insert a Box with EN so the rung drives the enable instead, then right-click the short line before START and use Insert at Block... to place a box there, replacing the default AND with TON by typing the name or opening Input Assistant with F2.
Why the rung lands on NETID and not START #
When you drop a function block straight onto a rung, the TwinCAT LD editor ties the logic to the block's first input — the one at the top of its pin list. That works cleanly for TON, whose first input IN is Boolean; the editor's own introduction example links a contact directly to IN of the TON and then asks for a time constant. NT_GetTime is built the other way round: NETID, the address of the system whose time you want, comes first, and START sits below it.
Power flow cannot serve as a value input, so the rung parks on NETID and the pin you want stays out of reach. Every ladder editor has its own placement rule — insert-versus-append rung placement in RSLogix 5000 decides where a new rung lands, for instance — but TwinCAT's rule decides which pin receives the rung. Nothing is wrong with the timer or the block; the wiring path is what needs a different construction.
The fix, step by step #
- Right-click the rung where NT_GetTime belongs and choose Box with EN from the Insert menu. This form accepts a function block, a function, an operator or a program, and it executes only while EN is TRUE.
- Double-click the question marks in the new box and type
NT_GetTime, or press F2 and pick it through Input Assistant. The block keeps all of its own inputs — NETID still first — but none of them sits in the rung's path anymore. - Give the instance the name the editor asks for. Every function block call keeps its state in an instance, and that name is what you will watch online.
- Right-click the short line immediately before START and choose Insert at Block..., then Box. A placeholder appears on that line, feeding START; it shows as an AND box by default.
- Replace the placeholder: double-click its question marks and type
TON, or use Input Assistant with F2. The output of whatever you place there lands on the pin whose line you clicked, and its first input picks up the logic to its left. - Put the trigger contacts to the left of the inserted TON — they now drive its IN — and enter PT as a time constant, for example
T#2s. - Leave NETID as its own input with its own value. It is not part of the Boolean path and never was.
Why this network gets built from the far end #
Insertion targets one named pin, so the destination block goes in first and the logic that feeds it is inserted at its input lines afterward. The finished network still executes left to right; only your construction runs from destination back to source.
Engineers arriving from Siemens or Omron ladder feel this the most, because those editors let you draw a wire between any two pins. TwinCAT shares its IEC 61131-3 roots with CODESYS, and timer behavior can differ by language even on one platform — the situation behind when a TON works in structured text but not ladder.
Check every landing point by pin name #
Read the pin labels, not the geometry. The top position of a pin and the pin's name are two different things: the rung takes the top position when a block sits directly on it, while insertion at a line takes the named pin.
| Element | What it carries | Where it must land |
|---|---|---|
| Rung contacts | Boolean power flow | EN of the wrapped box |
| TON instance | IN and PT in, Q and ET out | The box inserted on the line into START |
| TON.Q | Timed Boolean output | START |
| NETID | Target-system address | Its own pin, never the rung |
| ENO | TRUE after the box ran | Free, or chained to the next box's EN |
Verify it online #
Log in and run a timing check with round numbers: PT = T#2s (2000 ms) in a 10 ms task cycle. Raise the contact feeding IN at a known moment; Q — and therefore START — must go TRUE on the first cycle at or after 2000 ms, so between 2000 ms and 2010 ms: 2000 ms + one 10 ms cycle = 2010 ms worst case. The timer can never fire early and is at most one task cycle late. If you need tighter timing, shorten the task cycle, not the logic.
While online, confirm that START follows Q and that power reaches EN rather than NETID. If Q stays TRUE after the contact drops, the instance is being called somewhere else as well — the failure mode behind why a TON output stays on after its rung goes false.
The decision, case by case: first input Boolean — put the block straight on the rung; first input a value like NETID — wrap it with Box with EN; target pin below the first — Insert at Block... on that pin's line. That is the whole rule set, and with it TON.Q lands on START exactly as the manual's function block diagram shows.
Questions asked
Does Box with EN change how NT_GetTime executes?
Yes, in one way. The box is only called while EN is TRUE; when EN is FALSE the call is skipped and the block's outputs keep their last values. ENO reports the result and follows EN when the call runs. Keep the rung TRUE for as long as you want the block updating, and gate it with the same conditions you would have put in front of a plain box.
What should NETID be wired to?
Nothing on the Boolean side. NETID stays a normal value input on the block. For an NT_GetTime call that reads the local runtime, leave it the empty string, which addresses the system the code runs on. Fill it only when you deliberately query a different target, and then it takes that target's AMS Network Identifier as given in the block's documentation.
Can I insert something other than TON at the START line?
Yes. The Insert at Block command accepts any function block, function or operator, which is why the placeholder starts as a plain AND box: it is just an operator until you type over it. Type NOT if START must see the inverted timer output, or an edge block such as F_TRIG only when you actually want a transition instead of a level.
Can TON.Q drive more than one block input?
Yes. Each landing pin gets its own insertion: right-click the short line before each target input and place a box there. One TON instance has one Q, but that output can fan out to several pins in the same network, and the timer is still evaluated once per cycle because the instance is called once.