Touch probe header

This page contains the complete code of the header file in this chapter.

In TouchProbe.h, your Touch Probe code should be as follows:

#pragma once

//There are two touch probes to use. ID can be 0 or 1.
#define TOUCH_PROBE_ID 0

//Decide whether to use software touch probe. 
//When it is TRUE, use Axis, Index and Offset for KINGSTAR to select a digital input; 
//When it is FALSE, use IndexPulse to tell the drive which signal to use.
#define TOUCH_PROBE_SOFTWARE FALSE

//Select rising or falling edge. Not all servo drives support falling edge.
//TRUE: rising edge (record when zero becomes one).
//FALSE: falling edge (record when one becomes zero).
#define TOUCH_PROBE_EDGE TRUE

/*Chooses what signal will trigger touch probe. This option is available
  only when Software is FALSE.*/
//TRUE: use the phase Z signal to trigger.
/*FALSE: use a digital input (DI) from a servo drive to trigger.
  Check the servo drive's manual to see which DI can be used.*/
#define TOUCH_PROBE_INDEXPULSE TRUE

//The digital input is from axis or I/O module. TRUE: Axis. FALSE: I/O module.
#define TOUCH_PROBE_AXIS FALSE

//The index of an axis or I/O module.
#define TOUCH_PROBE_INDEX 0

//The digital input's offset for an axis or I/O module.
#define TOUCH_PROBE_OFFSET 0

VOID RecordPosition(int Index);