Input Description

../_images/474ec335e389ade10a33139000eba54e1

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

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.

EN

Data_Type Default_Value Range Unit
BOOL FALSE TRUE/FALSE -

The input EN has to be driven in edge triggered mode.

The execution of the Function Block is started with a positive edge on the input EN.

In the first call it evaluates its inputs and creates a local copy of them. Afterwards it starts its internal algorithm. It may take several PLC task cycles until it is executed.

Once the execution is completed DONE and its other outputs are set. To start the Function Block again a new positive edge on the input EN has to be applied.

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/67d7d8cfe389b4a50a33139000eba54e1

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”.

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 counters 0-A and 0-B) or I11 (for counters 1-A and 1-B).

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

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

UD1

Data_Type Default_Value Range Unit
BOOL - - -

At input UD1, the counting selection is set for up/down counting mode for counter A:

UD1=FALSE: count up

UD1=TRUE: count down

Input UD1 corresponds to output bit 3 in control byte.

UD2

Data_Type Default_Value Range Unit
BOOL - - -

At input UD2, the counting selection is set for up/down counting mode for counter B:

UD2=FALSE: count up

UD2=TRUE: count down

Input UD2 corresponds to output bit 5 in control byte.

RESET1

Data_Type Default_Value Range Unit
BOOL - - -

If set input RESET1=TRUE, the counter A takes the values 0 to transfer it to output ACT1. As long as input RESET1=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-A) or I11, I12, I13, I14 or I15 (for counter 1-A) causes the Function Block to reset the value at output ACT1.

../_images/0a933f8de389b1a90a33139000eba54e1

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

RESET2

Data_Type Default_Value Range Unit
BOOL - - -

If set input RESET2=TRUE, the counter takes B the values 0 to transfer it to output ACT2. As long as input RESET2=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-B) or I11, I12, I13, I14 or I15 (for counter 1-B) causes the Function Block to reset the value at output ACT2.

../_images/a8d9a99be389b15b0a33139000eba54e1

Input EN_RESET2 corresponds to bit 3 in “control byte”.

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