Input Description

../_images/df7750b7e389aefa0a33139000eba54e

EN_TOUCH

The touch/catch operation is the way to acquire the counting position synchronously with hardware external signal removing all the latency time of I/O-Bus and network. This operation allows synchronization between 2 different encoder devices if the same hardware signal is used for touch/catch input.

On edge of the physical external signal, the current counter value (ACT) is stored in a dedicated integer (CNT_TOUCH). The touch/catch operation could be settled on rising or falling edge depending on parameter EDGE_TOUCH (see figure below).

../_images/d4e0e037e389ad450a33139000eba54e

Procedure and associated counting value with A signal

Touch/catch operation is enabled through control bit (EN_TOUCH). This resets the status flag (NTOUCH), when the pre-determined edge occurs; the current counter value is stored in the touch value double word. In the same time, the status NTOUCH is set to TRUE.

RPI Procedure

The RPI (Reference Point Initialization) is used to synchronize the counter value with the mechanical zero reference based on signal Z.

RPI procedure is enabled with control bit (EN_RPI). If this control bit is set, the module checks for the Z signal. When the signal appears, the set value is copied in the current counter value and RDY_RPI is set (see figure below).

../_images/b6184182e389ad930a33139000eba54e

RPI operation

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.

CNT_NUM

Data_Type Default_Value Range Unit
WORD - - -

CNT_NUM contains the counter number in the module:

  • CNT_NUM = 0 is related to input A0, B0, Z0
  • CNT_NUM = 1 is related to input A1, B1, Z1

EN_CNT

Data_Type Default_Value Range Unit
BOOL - - -

If EN_CNT = TRUE, pulse counting of counter is enabled. If EN_CNT = FALSE, no pulse counting is performed and the pulses are lost.

If counting has already started and if EN_CNT = FALSE, the pulse counting stops and counter value ACT is stored. If EN_CNT = TRUE again, the pulse counting will start again and counter value ACT will continue since previous value.

Input EN_CNT corresponds to bit 0 in “control byte”.

EN_TOUCH

Data_Type Default_Value Range Unit
BOOL - - -

Touch/catch operation is enabled through control bit (EN_TOUCH). This resets the status flag (NTOUCH), when the pre-determined edge occurs; the current counter value is stored in the touch value double word. In the same time, the status NTOUCH is set to TRUE.

A rising edge at input EN_TOUCH enables a catch/touch trigger measurement. If input EN_TOUCH = TRUE, a rising edge at input I3 (for counters 0-A and 0-B)) or I11 (for counters 1-A and 1-B) causes the Function Block to store the actual counter value ACT1 and ACT2 and to display this value at output CNT_TOUCH1 and CNT_TOUCH2.

../_images/67d7d8cfe389b4a50a33139000eba54e

The next measurement is again initiated by a rising edge at input EN_TOUCH.

If input EN_TOUCH is set to FALSE, the output RDY_TOUCH is set to FALSE.

Input EN_TOUCH corresponds to bit 6 in “control byte”.

Only one function may be enabled at a time, either the RPI (reference point indicator) or TOUCH (touch trigger measurement). If both functions are enabled simultaneously or if the execution of one function is not yet completed when enabling the other function, a RPI function will have a higher priority than TOUCH.

EDGE_TOUCH

Data_Type Default_Value Range Unit
BOOL - - -

If EDGE_TOUCH = FALSE, a catch/touch value will be operate on falling edge of input I3 (for counter 0) or I11 (for counter 1).

If EDGE_TOUCH = TRUE, a catch/touch value will be operate on rising edge of input I3 (for counter 0) or I11 (for counter 1).

Input EDGE_TOUCH corresponds to bit 7 in “control byte”.

EN_RPI

Data_Type Default_Value Range Unit
BOOL - - -

A rising edge at input EN_RPI enables a reference point initiator measurement. If input EN_RPI = TRUE, a rising edge at inputs I3, I4, I5, I6 or I7 (for counter 0) or I11, I12, I13 (for counter 1) validates the counter value capture and the counter reset during the capture.

../_images/b2826cbfe389b2060a33139000eba54e

Input EN_RPI corresponds to bit 4 in “control byte”.

Only one function may be enabled at a time, either the RPI (reference point indicator) or TOUCH (touch trigger measurement). If both functions are enabled simultaneously or if the execution of one function is not yet completed when enabling the other function, a RPI function will have a higher priority than TOUCH.

RESET

Data_Type Default_Value Range Unit
BOOL - - -

If set input RESET=TRUE, the counter takes the values 0 to transfer it to output ACT. As long as input RESET=TRUE, no pulses are counted because the counter is always overwritten by the value 0.

A rising edge at input I3, I4, I5, I6 or I7 (for counter 0) or I11, I12, I13, I14 or I15 (for counter 1) causes the Function Block to reset the value at output ACT.

../_images/0a933f8de389b1a90a33139000eba54e

Input EN_RESET corresponds to bit 2 in “control byte”.

SET_START

Data_Type Default_Value Range Unit
BOOL - - -

If set input SET=TRUE, the counter takes the values from input START_VALUE to transfer it to output ACT. As long as input SET=TRUE, no pulses are counted because the counter is always overwritten by the input START_VALUE.

A rising edge at input I3, I4, I5,I6 or I7 (for counter 0) or I11, I12, I13,I14 or I15 (for counter 1) causes the Function Block to store the START_VALUE value and to display this value at output ACT.

../_images/ddba9672e389b2640a33139000eba54e

Input EN_SET corresponds to bit 1 in “control byte”.

SET_END

Data_Type Default_Value Range Unit
BOOL - - -

If set input SET_END=TRUE, the counter is set to the value specified at input END_VALUE.

START_VALUE

Data_Type Default_Value Range Unit
DINT - - -

The counter can be set to a start value. This value must be applied to the input START_VALUE.

If input SET=TRUE, counter takes this value.

Input START_VALUE corresponds to counter settings (DWORD) of CD522.

END_VALUE

Data_Type Default_Value Range Unit
DINT - - -

If the counter reaches the planned input END_VALUE, the binary output CF is set to TRUE and the value is stored.

Input END_VALUE corresponds to counter settings (DWORD) of CD522.

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/88f652fee389abfe0a33139000eba54e

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/fb78a117e389ac5b0a33139000eba54e