Console.WriteLine("📜 Touch Probe: Panasonic");
try
{
if (controller.NetworkStateGet() !=
RSINetworkState.RSINetworkStateOPERATIONAL)
{
Console.WriteLine("Network not started. Please start it before running this app.");
return;
}
Console.WriteLine("\n--- Method 1: Capture Each Index Pulse During Motion ---");
CaptureEachIndexPulseDuringMotion(controller);
Console.WriteLine("\n--- Method 2: Capture Position on Falling Edge of SI6 ---");
CapturePositionOnFallingEdgeOfSI6(controller, axis);
Console.WriteLine("\nTouch probe examples complete.");
}
finally
{
controller.Delete();
}
{
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;
ulong currentStatus = controller.NetworkInputValueGet(TOUCH_PROBE_STATUS_INDEX);
Console.WriteLine($"Touch Probe Status: 0x{currentStatus:X}");
ulong lastZPhasePosition = controller.NetworkInputValueGet(TOUCH_PROBE_VALUE_INDEX);
Console.WriteLine($"Last Z-Phase Position: {lastZPhasePosition}");
}
{
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);
Console.WriteLine($"Touch Probe 2 Status: 0x{currentStatus:X}");
TOUCH_PROBE_2_FALLING_EDGE_VALUE_INDEX,
TOUCH_PROBE_2_FALLING_EDGE_VALUE_SUB_INDEX,
TOUCH_PROBE_2_FALLING_EDGE_VALUE_SIZE);
Console.WriteLine($"Falling Edge EXT2 Position: {fallingEdgeExt2}");
}
Constants used in the C# sample apps.
const int AXIS_0_INDEX
Default: 0.
NetworkNode * NetworkNode
Gets the associated NetworkNode object.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
static MotionController * Get()
Get an already running RMP EtherCAT controller.
void NetworkOutputValueSet(int32_t index, uint64_t outputValue)
Sets a PDO output directly.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
int32_t ServiceChannelRead(int32_t index, int32_t subIndex, int32_t byteCount)
Read a 32-bit integer value from the SDO.
RSINetworkState
State of network.
Helpers namespace provides utility functions for common tasks in RMP applications.