使用mc_touchprobe指令时以下参数设置会影响是否正常采集到触发信号时间戳对应的轴位置。
1)采样信号来源
E_SignalSource
TYPE E_SignalSource :
(
SignalSource_Default, (* undefined or externally configured *)
SignalSource_Input1, (* digital drive input 1 *)
SignalSource_Input2, (* digital drive input 2 *)
SignalSource_Input3, (* digital drive input 3 *)
SignalSource_Input4, (* digital drive input 4 *)
SignalSource_ZeroPulse := 128, (* encoder zero pulse *)
SignalSource_DriveDefined (* defined by drive parameters - e. g. CAN object 0x60D0 *)
);
END_TYPE
参数需要选择: SignalSource_DriveDefined (* defined by drive parameters - e. g. CAN object 0x60D0 *) 但是AX5000使用默认设置就可以
2)连续模式下的采样结果
E_TouchProbeMode
Specifies the operation mode of the latch unit. In single mode only the first edge is recorded. In continuous mode each PLC cycle edge is signaled.
TYPE E_TouchProbeMode :
( TOUCHPROBEMODE_SINGLE_COMPATIBILITYMODE, (* for TwinCAT 2.10 and 2.11 before Build 2022 *)
TOUCHPROBEMODE_SINGLE, (* multi probe interface - from 2.11 Build 2022 *)
TOUCHPROBEMODE_CONTINUOUS (* multi probe interface - from 2.11 Build 2022 *)
);
END_TYPE
连续模式是可以用的,但是需要在指令下面的TouchProbeValue这个数组里找到连续触发的探针值。而且只在数组下标1里面获取。