APIs, concepts, guides, and more

◆ ServiceChannelRead() [1/2]

int32_t ServiceChannelRead ( int32_t index,
int32_t subIndex,
int32_t byteCount )
Description:
Read a 32-bit integer from the SDO. The index, subIndex, byteCount, and valid numeric values are drive specific. Refer to the drive manual to determine these values.
Parameters
indexThe memory address to write to
subIndexThe sub index to write to
byteCountThe number of bytes to write
Returns
(int32_t) The 32-bit integer value of the SDO

Axis: Touch Probe

// SDO Method
static void CapturePositionOnFallingEdgeOfSI6(MotionController controller, Axis axis)
{
// Here we are assuming that you still have Touch Probe Status as PDO entries. They can be set and read using SDO in similiar fashion if that isn't the case.
const int TOUCH_PROBE_OUTPUT_INDEX = 3; // NetworkOutput #3 - Touch Probe Function
const int TOUCH_PROBE_STATUS_INDEX = 6; // NetworkInput #6 - Touch Probe Status
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;
// We want to Enable the Touch Probe 2 (Bit 8 to 1), Set to First Event (Bit 9 to 0), Set to EXT2 (Bit 10 to 0), and Sample the negative Edge (Bit 13 to 1)
// Our Touch Probe Function should be binary xx1x x001 xxxx xxxx -or- 0x2100
// Note if you are making use of Touch Probe 1, some of the above bits will become significant
const ulong TOUCH_PROBE_2_ON_FIRST_FALLING_EXT2_COMMAND = 0x2100;
// Enable
controller.NetworkOutputValueSet(TOUCH_PROBE_OUTPUT_INDEX, TOUCH_PROBE_2_ON_FIRST_FALLING_EXT2_COMMAND);
// Evaluate
ulong currentStatus = controller.NetworkInputValueGet(TOUCH_PROBE_STATUS_INDEX);
// See above Touch Probe Status Section for details. Maybe be useful for your diagnostics and assurance that it is ok to use the next value.
// After you've observed currentStatus Bit 10 go high, you know the following value is useful.
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);
}
Examples
TouchProbe.cs.