class TouchProbe
{
static void CaptureEachIndexPulseDuringMotion(MotionController controller)
{
const int TOUCH_PROBE_OUTPUT_INDEX = 3;
const int TOUCH_PROBE_STATUS_INDEX = 6;
const int TOUCH_PROBE_VALUE_INDEX = 7;
const ulong TOUCH_PROBE_ON_EACH_Z_PHASE_COMMAND = 0x17;
controller.NetworkOutputValueSet(TOUCH_PROBE_OUTPUT_INDEX, TOUCH_PROBE_ON_EACH_Z_PHASE_COMMAND);
ulong currentStatus = controller.NetworkInputValueGet(TOUCH_PROBE_STATUS_INDEX);
ulong lastZPhasePosition = controller.NetworkInputValueGet(TOUCH_PROBE_VALUE_INDEX);
}
static void CapturePositionOnFallingEdgeOfSI6(MotionController controller, Axis axis)
{
const int TOUCH_PROBE_OUTPUT_INDEX = 3;
const int TOUCH_PROBE_STATUS_INDEX = 6;
const int TOUCH_PROBE_2_FALLING_EDGE_VALUE_INDEX = 0x60BD;
const int TOUCH_PROBE_2_FALLING_EDGE_VALUE_SUB_INDEX = 0x0;
const int TOUCH_PROBE_2_FALLING_EDGE_VALUE_SIZE = 0x4;
const ulong TOUCH_PROBE_2_ON_FIRST_FALLING_EXT2_COMMAND = 0x2100;
controller.NetworkOutputValueSet(TOUCH_PROBE_OUTPUT_INDEX, TOUCH_PROBE_2_ON_FIRST_FALLING_EXT2_COMMAND);
ulong currentStatus = controller.NetworkInputValueGet(TOUCH_PROBE_STATUS_INDEX);
int fallingEdgeExt2 = axis.
NetworkNode.
ServiceChannelRead(TOUCH_PROBE_2_FALLING_EDGE_VALUE_INDEX, TOUCH_PROBE_2_FALLING_EDGE_VALUE_SUB_INDEX, TOUCH_PROBE_2_FALLING_EDGE_VALUE_SIZE);
}
static void Main(string[] args)
{
MotionController controller = MotionController.CreateFromSoftware();
Axis axis = controller.AxisGet(0);
CaptureEachIndexPulseDuringMotion(controller);
CapturePositionOnFallingEdgeOfSI6(controller, axis);
}
}