My program declares a BOOL called ton0Q (not ton0.Q) and uses it to map the timer-expired state, just in case the Codesys timer functions work in the same (IMNSHO) poorly-designed fashion as Siemens timer functions i.e. evaluate the timer object's internal state at each reference to the object asynchronously with the TON instruction.