# Measuring with external measuring hardware

Interface for external measuring hardware
Description | The CNC informs the PLC about the start or end of a measurement run via the external measuring interface so that the PLC can activate or deactivate an external measuring hardware accordingly. The measurement signal source must be set to PLC_EXT_LATCH_CTRL in order to activate this interface (see P-AXIS-00516 or [PROG//Extended programming])
Data type | LcControlExtLatchControl
Special features | This interface is only used to control the activation and deactivation of an external measuring hardware. The CNC receive information about the measurement value or the detected measuring position via the control units probing_signal or probing_position.
Access | PLC writes please_rw + done_w
ST path | gpAx[axis_idx]^.ext_latch_control
Job
ST element | .please_rw
Description | When please_rw is set, the CNC signals to the PLC to activate or deactivate the external measuring hardware since a measurement run was started to aborted.
Data type | BOOL
Value range | [TRUE, FALSE]
Special features | Consumption data item

Access | The CNC refreshes the data of the measuring interface only if this element is FALSE. After refreshment, the CNC sets this element to TRUE after the element done_w was set to FALSE. The PLC reads the data of the measuring interface if this element has the value TRUE. After the data is transferred, the PLC sets the value to FALSE.
Parameter
ST element | .ext_latch_order_r
Description | The CNC signals to the PLC in this datum the required measurement parameters such as activate/deactivate the measurement function or the number of the measurement input.
Data type | HLI_EXT_LATCH_ORDER
Access | PLC reads
Acknowledgement
ST element | .done_w
Description | By setting the element done_w to TRUE, the PLC signals to the CNC that the measuring command ExtLatchOrder was executed.
Data type | BOOL
Value range | [TRUE, FALSE]
Special features | Consumption data item
Access | The PLC sets the value to TRUE if the measuring command was executed. The CNC sets the value to a FALSE before a new command.

Measuring command data
Description | The CNC signals to the PLC in this parameter whether the measuring hardware must be activated or deactivated. In addition, the CNC informs the PLC of the measurement input to be used and the relevant measuring edge.
Data type | HLI_EXT_LATCH_ORDER
ST path | gpAx[axis_idx]^.ext_latch_control.ext_latch_order_r
Access | PLC reads
Measuring command identifier
Description | ID of measuring command to be executed.
ST element | .order_id
Data type | UDINT
Value range | Constant | Meaning
HLI_EXT_LATCH_ENABLE_PROBE | Start of measurement run, the measuring hardware must be activated.
HLI_EXT_LATCH_DISABLE_PROBE | The measurement run was ended or aborted by reset. The measuring hardware must be deactivated again.
Access | PLC reads

Number of probing input
Description | The CNC signals to the PLC in this datum the input to be used for measuring (see P-AXIS-00517)
ST element | .input
Data type | DINT
Value range | Measuring input 1 – 255
Access | PLC reads
Relevant measuring edge
Description | The CNC signals to the PLC in this datum the relevant measuring edge (raising/falling) to be used for measuring (see P-AXIS-00518)
ST element | .edge
Data type | UDINT
Value range | Constant | Meaning
HLI_MEAS_SIGNAL_LOW_ACTIVE | The measurement value is to be detected on the falling edge.
HLI_MEAS_SIGNAL_HIGH_ACTIVE | The measurement value is to be detected on the rising edge.
Access | PLC reads

The block diagram below shows an example of the signal profile of the control units ext_latch_control, probing_signal and probing_position during the measurement process with external hardware:

Example signal profile of measurement with external hardware

## Notice

When the external measuring interface is used, the measurement signal of the control unit probing_signal is not dependent on the relevant measuring edge P-AXIS-00518. A positive edge always signals the successful detection of a measurement value in the external measuring hardware.

## Notice

If the control unit probing_position is not enabled when the measurement event occurs, the CNC uses the actual position of the axis as measurement value at the time stamp of the probing signal occurrence.