Input Description

../_images/012fa6dbe389af580a33139000eba54e1

EN

Data_Type Default_Value Range Unit
BOOL - - -

In order to enable the Function Block processing, input EN has to be continuously set to TRUE. The Function Block is not processed if input EN = FALSE.

When calling the Function Block the first time, the inputs are checked for validity and plausibility. If this is not the case, processing is aborted and corresponding error is displayed at output ERR/ERNO.

CHN_NUM

Data_Type Default_Value Range Unit
WORD - - -

CHN_NUM contains the channel number managed by the Function Block:

  • CHN_NUM = 0: the output O0 is managed
  • CHN_NUM = 1: the output O1 is managed

EN_FREQ

Data_Type Default_Value Range Unit
BOOL - - -

If EN_FREQ=TRUE, the frequency output is enabled. If EN_FREQ = FALSE, no frequency output is performed.

Input EN_FREQ corresponds to output bit 7 in “control byte”.

FREQ

Data_Type Default_Value Range Unit
DWORD - 1 … 100 KHz

Input FREQ is used to specify the frequency of output. The frequency can be set from 1 to 100 KHz.

The duty cycle is fixed (50 %).

The frequency value is defined with a double word (DWORD), but the internal communication with CD522 is realized with WORD type. For frequencies greater than 65535 Hz (word limitation) an additional bit is internally used as multiplier. Thus, for such frequencies the resolution becomes 10 Hz.

The additional multiplier bit is the bit 0 of “control byte”. If bit 0 of “control byte”=TRUE, the frequency multiplier x10 is enabled.

ADR_IN   POINTER \ TO structCD522counterin

At this input, the address of the first input data from the structure of counter input of CD522 should be connected. The use of an ADR operator is needed. If input ADR_IN is not connected, then the outputs DONE=FALSE and ERR= TRUE.

Example (for counter 0):

../_images/88f652fee389abfe0a33139000eba54e1

ADR_OUT   POINTER \ TO structCD522counterout

At this input, the address of the first output data from the structure of counter output of CD522 should be connected. The use of an ADR operator is needed. If input ADR_OUT is not connected, then the outputs DONE=FALSE and ERR= TRUE.

Example (for counter 0):

../_images/fb78a117e389ac5b0a33139000eba54e1