132 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 3 Timer and Counter Instructions (TON, TOF, RTO, TONR, TOFR, RTOR, CTU, CTD, CTUD, RES)
Example: Each scan that limit_switch1 is set, the TONR instruction increments the ACC
value by elapsed time until the ACC value reaches the PRE value. When
ACC ≥ PRE, the DN parameter is set, and timer_state is set.
Structured Text
TONR_01.Preset := 500;
TONR_01.Reset : = reset;
TONR_O1.TimerEnable := limit_switch1;
TONR(TONR_01);
timer_state := TONR_01.DN;
Function Block Example