Topic: DMD0023

Help File Version: 2.10.0.636

FREQTMR - Frequency Timer


The Frequency Timer (FREQTMR) instruction is used to convert the rate of a series of pulses to engineering units by measuring the time between the leading edges of successive pulses, normalizing that value to the desired time base, then scaling that value to the desired engineering units. This type of scaling is typically done for speed, flow rate, velocity, etc.. The Frequency Timer is always enabled, but the timeout period only begins after receiving the first input pulse. If a Timeout occurs, or the Reset is asserted, the timeout period again starts after an input pulse is received.

 

This instruction operates in a similar manner to the Interval Scaling operation in the CTRIO modules.

 

 


Parameters:

Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Timer Struct is the Timer structure that this instruction will use. This can be any of the system defined Timers (T Data Block), or any user defined Timer.

 

Timeout -is the maximum amount of time to wait between input pulses. If the Timeout value is reached, the current calculation is canceled and the output value is set to 0. The Timeout is specified using the Time format (HH : MM : SS : mmm). The maximum Timeout value in this form is 569 hours, 31 minutes, 23 seconds, and 647 milliseconds. If needed, the value entered for the Timeout will be normalized to its standard value. For example, if you entered a value of 97 Seconds, that value will be converted and displayed as 1 Minute and 37 Seconds.

 


Frequency Units specifies the output scaling factor:
 

  • Counts per Second will scale the input pulse count to Counts per Second.
     

  • Counts per Minute will scale the input pulse count to Counts per Minute.
     

  • Counts per Hour will scale the input pulse count to Counts per Hour.


Filter enables a filtering algorithm that is applied during the calculation that defines how much 'weight' the current-value is given versus the latest-calculated-value. Filtering acts as a data smoothing function, balancing stability versus the responsiveness of the calculated value as it responds to changes in the input pulse rate. A large filter value gives more weight to the latest-calculated-value (and hence less weight to the current-value), producing a more stable value that responds more slowly to changes in the input pulse rate. A small filter value gives less weight to the latest-calculated-value (and hence more weight to the current-value), producing a less stable value but it responds more quickly to changes in the input pulse rate.
 

  • None will disable the filtering algorithm.
     

  • 0.0 - 1.0 : Sliding Scale : sliding the slider to the right increases the filter constant. The sliding scale is a logarithmic (non-liner) scale, the mid point of the filter value is about 1/3 of the scale.

     

  • 0.0 : Constant Value can be any constant floating point value between 0.0 and 0.999999.


Scale Factor will optionally apply a scaling factor to the calculated value, for example, to convert counts per second to engineering units like gallons per seconds.

 

Output is a numeric memory location to store the scaled output value. This can be any writable REAL (floating point) location.

 


Termination Scan Behavior:

If the Frequency Timer instruction is contained within a Program, a Task, or a Stage, it will automatically be reset during the termination scan of that Program, Task, or Stage. Refer to the Help topic on Termination Behavior for detailed information on the programming elements that have termination logic.

 


Status Display:

 

The yellow triangle in the upper left corner indicates this is a Multi-Scan instruction.

 

The first input leg is the Pulse Input. The gray triangle at the right end of an input leg indicates the input is Edge Triggered.Closed Each time the input logic transitions from OFF to ON this instruction will execute. With each execution, this instruction will run to completion even if the input logic transitions to OFF before the instruction completes.

 

The second input leg is the Reset (RST). When this input logic is ON, the Frequency Timer's output value will be set to 0.0.

 


See Also:

FREQCNT - Frequency Counter

 

FREQTMR - Frequency Timer

 


Rung Example: