Timers and counters functions

In the following descriptions, P1, P2, P3, etc. are used to indicate positional parameters or arguments that must be specified when using a function. Each parameter or argument given to a function must be separated by a single space.

Timer/Counter - Start

Timer/Counter is a value incrementing or decrementing at one second intervals. It is housed on a numeric input or numeric output. If it is in an output it is non-volatile and if it is in an input it is volatile. If it is in an output, the output can still be linked to an input. In either case the thresholds of an input can then be used to make decisions based on the counter value or the value can just be used to accumulate things like engine hours.

P1 Destination pin type

Numeric [i]nput or [o]utput

P2 Destination Numeric pin number: location where the timer resides

Numeric <pin number>

P3 Counter type

[0]: Count up from current value

[1]: Count up from user/pin defined value

[2]: Count down from current value

[3]: Count down from user/pin defined value

P4 Start value source type

[i]nput or [o]utput or [u]ser defined

P5 Start value source pin number or user defined value

<pin number> or <value>

P6 Limit type

[0]: No limit value

[1]: stop at user-defined limit value

[2]: Roll over to start value at user-defined value and continue counting

P7 Limit value

[0]: No limit value

<user-defined value>

P8 Update value: the amount to add/subtract each second.

<user-defined value>

P9 Write rate in 1 second increments; update frequency of timer value to P2.

<user-defined value>

Example: Create a counter on output pin 14 that counts up from 0 in seconds with no limit and updates the display every 15 seconds

 

Timer/Watchdog - Start

A watchdog timer is a value decrementing at a one second rate. The value is NOT directly housed in an input or output pin. When the value decrements to zero the defined digital output or input pin will turn on. If you keep setting the watchdog timer, it will never get to zero.

P1 Destination Digital pin type

Digital [i]nput or [o]utput

P2 Destination Digital pin number: pin that goes high when the watchdog expires

Digital <pin number>

P3 Start value source type

[i]nput or [o]utput or [u]ser defined

P4 Start value source pin number or user defined value

<pin number> or <value>

P5 Update value: the amount to add/subtract each second.

<user-defined value>

Example: Set output pin 4 when a 60 second timer reaches 0

 

Timer/Clock - Start

A clock is a square wave signal generated on an input or output. It can be continuous or of a pre-defined pulse length. The clock frequency is generated by a decrementing counter. Each time the counter decrements to zero, the defined digital input or output will toggle state.

P1 Destination Digital pin type

Digital [i]nput or [o]utput

P2 Destination Digital pin number: location where the clock is generated

Digital <pin number>

P3 Clock rate source type

[i]nput or [o]utput or [u]ser defined

P4 Clock rate value source pin number or user defined value

<pin number> or <value>

P5 Update rate: decrement frequency in [Update rate] * 0.1 sec. increments

<Update rate>

P6 Update value: amount to subtract from P4 each update period

<user-defined value>

P7 Stop pulse value: Stop at defined number of pulses

[0]: Continuous

<user-defined value>

Example: Clock output pin 1 at a rate of once every 1 second (1 second ON followed by 1 second OFF) for 400 iterations

 

Timer/Counter/Ext/Clk - Start

Note Use of this function is tied to the Z45 Controller’s Discrete or Relay Input (pin 17).

Timer/Counter/Ext/Clk is a value incrementing or decrementing at the rate of the Discrete Input (DI) pin on the Z45 Controller, also known as the relay input (pin 17). The Timer/Counter is assigned to a numeric input or numeric output. If it is in an output it is non-volatile and if it is in an input it is volatile. If it is in an output, the output can still be connected to an input. In either case the thresholds of an input can then be used to make decisions based on the counter value or the value can be used to accumulate things like engine hours.

P1 Destination Numeric pin type

Numeric [i]nput or [o]utput

P2 Destination Numeric pin number: location where the timer resides

Numeric <pin number>

P3 Counter type

[0]: Count up from current value

[1]: Count up from user/pin defined value

[2]: Count down from current value

[3]: Count down from user/pin defined value

P4 Start value source type

[i]nput or [o]utput or [u]ser defined

P5 Start value source pin number or user defined value

<pin number> or <value>

P6 Limit type

[0]: No limit value

[1]: stop at user-defined limit value

[2]: Roll over to start value at user-defined value and continue counting

P7 Limit value

[0]: No limit value

<user-defined value>

P8 Update value: the amount to add/subtract each second.

<user-defined value>

P9 Write rate in 1 second increments; update frequency of timer value to P2.

<user-defined value>

P10 Sample type

[0]: Count transitions going negative

[1]: Count transitions going positive

Example: Count negative going transitions of the Discrete Input and place the count on output pin 17. The counter should count up from zero and has no limits. For each transition of the Discrete Input add 15 to the value of pin 17. Pin 17 will be updated every 30 seconds.

 

Timer/Alarm Override - Start

Timer/Alarm Override – Start provides a mechanism to override (disable) all alarms for a specified period of time (in minutes). P1 and P2 define the pin that will represent the state of override, and P3 and P4 define the period of time for which alarms will be disabled. As with all timers Timer/Alarm Override is stopped with Timer/Any – Stop.

P1 Destination Numeric pin type

Numeric [i]nput or [o]utput

P2 Destination Numeric pin number: pin that goes high when the watchdog expires

Numeric <pin number>

P3 Override Duration (min.) source type

[i]nput or [o]utput or [u]ser defined

P4 Override Duration (min.) value source pin number or user defined value

<pin number> or <value>

Example: Disable alarms for the number of minutes specified by input pin 11 and show override status on output pin 18

 

Timer/Counter/Any - Stop

Timer/Counter/Any – Stop will stop any of the counters/timers defined in this section.

P1 Destination pin type

[i]nput or [o]utput

P2 Destination pin number: location where timer/counter is defined

<pin number>

Example: Stop a time previously started on output pin 5

 

Output Shutoff Timer - Set

Allows the user to change the shutoff timer value for a digital output.

In-line Parameters