SetTrigger

Configures a trigger.

Syntax

KsError SetTrigger(
     int Index,
     McTriggerSource Source
);

Parameters

Index: a trigger index. Indexes are zero based. You can have up to 16 triggers. For example, index 0 uses triggerTime, index 1 uses triggerIoOutput, and index 2 uses triggerMotion.

Source: the structure that contains the trigger details. See the McTriggerSource structure.

Return value

If the function succeeds, it returns errNoError, otherwise an error code. For more information about the error code, see the KsError list.

Remarks

When modulo axis is enabled, the modulo value is applied to the triggerActualPosition and triggerInterpolationPosition variables, meaning the trigger compares the set value to the modulo position. Users are responsible for converting the trigger value to modulo value to ensure correct comparison with the modulo position calculated at Runtime. For example, if the current trigger value is -210 and the modulo axis has a modulo value of 360, the trigger value should be set to 150 (-210 % 360 = 150).

Usable EtherCAT states

ecatOP

Example

N/A

Requirements

  RT Win32
Minimum supported version 4.3 4.3
Header ksmotion.h ksmotion.h
Library KsApi_Rtss.lib KsApi.lib

See also

AxisWaitForTrigger

GetTrigger