MotoHawk Frequency Input Get

This MotoHawk™ block allows the frequency of a digital input defined by Frequency Input Definition block to be read.

Block ID

motohawk_frequency_in_read

Library

MotoHawk_lib/Advanced Digital I/O

Description

Basic Operation

The output signal is in units of 0.01 Hz, and is based on the last sample period from edge to edge, with a data type of uint32.

Dutycycle Reporting Considerations

If Get Duty Cycle Measurement is selected then the referenced Frequency Input Definition block must set up the resource to read duty cycle.

Newness Status Output

The optional newness status output that can be requested via the Show Newness Status allows the reported frequency to indicate whether it is a new or stale (old) report.

Newness is measured relative to the last time the frequency input was accessed. A report is new if at least one new edge was observed by the input since it was last accessed and is stale otherwise. Consider, for example, that this block was being executed periodically at (say) a rate of once every 5ms and that it is monitoring an input that happens to have a constant frequency of 100Hz (10ms period). (Say) the first time it is accessed the input had just observed an edge. The newness status output port would report that the observed frequency of 100Hz is new. Then in 5ms time, when the block executes again, it will still report that the frequency is 100Hz, but it will also report a newness status of stale since there have been no new edges observed since it was last accessed.

Note that the newness status will be corrupted if there are multiple accesses being made to the same input, whether it be from multiple instances of this block accessing the same input, or in combination with the Frequency Input Definition block that this block is referencing.

Only some resources are capable of detecting whether a report is new or not. Those resources that do not support the function will report unsupported. The motohawk_freqin_newness_status_enum script will allow this status to be enumerated. Its definition is as follows:
    0 = Unsupported
    1 = Stale Report (Old)
    2 = New Report

Block Parameters

Parameter Field Values Comments/Description
Reference Name Alpha-numeric text, single quote enclosed Enter reference to 'Name' specified in the Frequency Input Definition block.
Get Duty Cycle Measurement Select whether or not to set up duty cycle measurement.
  No Duty Cycle Measurement Disable duty cycle measurement.
  Get Duty Cycle Measurement With this option selected, the Frequency In block must set up the resource to read duty cycle.  Note: Using the duty cycle option may consume additional CPU.
Show Newness Status Checkbox Check to expose the Newness Status output.