05 Timer and counter

Last modified by Leo Wei on 2024/12/24 22:38

Timer output instruction

OUT T/Timer output

 When the calculation result before the OUT instruction is ON, the coil of the timer/retentive timer specified in (d) will be ON and measurement will be performed until the set value is reached. If the time limit expires, the normally open contact will conduct and the normally closed contact will become non-conductive.

-[OUT (d) (value)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(d)Timer device number-CounterANY
(value)Timer setting value0 to 32767Unsigned BIN 16 bitANY16

Device used

InstructionParameterDevices

Offset modification

Pulse extension

KnXKnYKnMKnSTCDRSDKH[D]XXP
OUT TParameter 1            
Parameter 2   

Features

When the operation result before the OUT instruction is ON, the coil of the timer specified in (d) will be ON and measurement will be performed until the set value is reached. If the count reaches (current value ≥ set value), the normally open contact will be conductive, and the normally closed contact will become non-conductive.

When the operation result before the OUT instruction changes from ON to OFF, the situation is as follows.

Timer typeTimer coilThe current value of the timerBefore the time limitAfter the time limit
Normally open contactNormally closed contactNormally open contactNormally closed contact
TimerOFF0Non-conductiveConductionNon-conductiveConduction
Cumulative timerOFFKeep current valueNon-conductiveConductionConductionNon-conductive

• After the time limit expires, clear the current value of the accumulative timer and turn off the contact with the RST instruction.

• When the setting value is 0, the time limit will expire when the OUT instruction is executed.

• While the OUT T instruction is ON, if the OUT T instruction is skipped by the CJ instruction, etc., the current value update and contact ON/OFF will not be performed.

• If the same OUT T instruction is executed more than twice in the same scan, the current value will be updated according to the number of executions.

• Description of each timer:

Device numberTimer specificationsDevice numberTimer specifications
T0 to T191100ms timerT246 to T2491ms accumulative timer
T192 to T199100ms subroutine timer (used in the subroutine, even if the subroutine is not called, it will still be updated)T250 to T25510ms cumulative timer
T256 to T3831ms timer
T200 to T24510ms timerT384 to T5110.1ms timer

Error code

Error codeContent
4084HThe parameter setting in (value) is out of range

Example

Using timing, D0 increases by 1 after every 1S:

05_html_81eba51633ee6a8e.png

Counter output instructions

OUT C/Counter output

 16-bit counter instruction: When the operation result before the OUT instruction changes from OFF to ON, the current value of the counter specified in (d) will be +1. If the count reaches, the normally open contact will be turned on and the normally closed contact will become Non-conductive.

-[OUT (d) (value)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(d)Counter device number-CounterANY
(value)Counter setting value0 to 32767Unsigned BIN 16 bitANY_INT

Device used

InstructionParameterDevices

Offset

modification

Pulse

extension

KnXKnYKnMKnSTCDRSDKHE[D]XXP
OUT CParameter 1             
Parameter 2   

Features

• When the calculation result before the OUT instruction changes from OFF to ON, the current value (count value) of the counter specified in (d) will be +1. If the count reaches (current value ≥ set value), the normally open contact will be turned on , The normally closed contact becomes non-conductive.

• If the calculation result is ON, no counting is performed. (Counting input does not need to be pulsed.)

• After the count is reached, the count value and the state of the contact do not change before the RST instruction is executed.

• When the setting value is 0, the processing is the same as when it is 1.

Error code

Error codeContent
4084HThe parameter setting in (value) is out of range
4085HThe (value) parameter exceeds the device range

Example

05_html_a5fa2da1b83a5e88.png

Every time M0 changes from OFF→ON, C0 will increase by 1. When the value of C0 is added to K10, the normally open contact of C0 is closed and Y0 is output. At this time, M0 continues from OFF→ON, and the value of C0 will not change anymore.

The contact of C0 can only be turned OFF by RST/ZRST instruction and communication.

OUT LC instruction/Long counter output

32-bit counter instruction: When the operation result before the OUT instruction changes from OFF to ON, the current value of the long counter specified in (d) will be +1. If counted, the normally open contact will be turned on and the normally closed contact will change It is non-conductive.

-[OUT (d) (value)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(d)Long counter device number-CounterANY
(value)Long counter setting value0 to 4294967295Unsigned BIN 32 bitANY_INT

Device used

InstructionParameterDevices

Offset

modification

Pulse

extension

KnXKnYKnMKnSTDRSDLCKHE[D]XXP
OUT LCParameter 1             
Parameter 2   

Features

• When the calculation result before the OUT instruction changes from OFF to ON, the current value (count value) of the long counter specified in (d) will be +1. If the count reaches (current value ≥ set value), the normally open contact will turn on On, the normally closed contact becomes non-conductive.

• If the calculation result is ON, no counting is performed. (Counting input does not need to be pulsed.)

• After the count is reached, the count value and contact status will not change before the RST instruction or ZRST instruction is executed.

• When the setting value is 0, the processing is the same as when it is 1.

Error code

Error codeContent
4085HThe (value) parameter exceeds the device range

Example

05_html_e350b84628cab61a.png

Each time M0 changes from OFF to ON, LC0 will increase by 1. When the value of LC0 is added to K10, the normally open contact of LC0 is closed and Y0 is output. At this time, M0 continues from OFF→ON, and the value of LC0 will not change anymore.

The contact of LC0 can only be turned OFF by RST/ZRST instruction and communication.