Calling the Function Blocks¶
The time and frequency measurement functionality of the DC541-CM is provided by the block DC541_FREQ: DC541_FREQ
Function blocks for the most module functions of DC541-CM are contained in the library DC541_AC500_V11.lib. The library is automatically included into the project and is described in detail in the library documentation DC541_Library: DC541 Library
The Function Block DC541_FREQ is used to measure times, frequencies and rotational speeds with a resolution of 100 µs.
It is able to measure frequencies from 0 to 2000 Hz (2 kHz). In order to obtain a precise measurement of frequencies > 50 Hz, a correspondingly high accuracy setting has to be chosen. It is recommended to use an accuracy of PREC = 1000, i.e. 0.001.
This Function Block has to be called cyclically, one time per second at least.
The inputs EN_0, EN_1 and EN_FREQ are used to determine the edges to be measured. If input EN_FREQ = TRUE, the frequency and the rotational speed are calculated in addition to the time measurement.