DioSetupTriggerMode

Applies To

GC5050, GX5050, GX5150, GX5280, GX5290, GX52902, GX5295, File

Purpose

Sets the external event lines trigger mode.

Syntax

DioSetupTriggerMode (nMasterHandle, nMode, pnStatus)

Parameters

Name

Type

Comments

nMasterHandle

SHORT

Master or File board handle.

nMode

SHORT

Specifies one of the following trigger modes:

  0       Conditional Trigger and Pause Disabled (default).

  1       Triggers on D events.

  2       Triggers on T events.

  3       Triggers first on D events, then on T events.

  4       Triggers first on T events, then on D events.

pnStatus

PSHORT

Returned status: 0 on success, negative number on failure.

Comments

The DioTrig function or the external trigger control line will force a trigger event overriding the conditional trigger mode set by this function.

Available Trigger modes are:

0         Conditional trigger and pause events disabled. Sequencer commands using D Register disabled.

1         Enables conditional trigger and pause events. DIO creates trigger events when external event input lines ANDed with D mask register equals the D event register.

2         Enables conditional trigger and pause events. DIO creates trigger events when external event input lines ANDed with T mask register equals the T event register.

3         Enables conditional trigger and pause events. This is a two-condition trigger. The first condition is the external event input lines ANDed with the D mask register equals the D event register. The second condition is the external event input lines ANDed with T mask register equal the T event register. These are sequential conditions; the D trigger event must occur before the T Trigger event will cause a sequencer trigger event.

4         Enables conditional trigger and pause events. This is a two-condition trigger. The first condition is the external event input lines ANDed with the T mask register equals the T event register The second condition is the external event input lines ANDed with D mask register equal the D event register. Those are sequential conditions. The T trigger event must take place before the D Trigger event will cause a sequencer trigger event.

 

Pause event control:

The Pause event control is enabled whenever the trigger mode is not in disabler mode the user need to follow the following guide lines in order to prevent conflicting conditions of trigger and pause. The PEvent value needs to be different then <>X Register (or the actual External Events lines if they are used) AND PEvent value needs to be different then the trigger event itself to prevent conflicting conditions. E.g. if the Trigger Mode was set to D, then the DEvent value need to be different then <> PEvent value.

Note: The board must be in the PAUSE state to enable triggering.

Example

The following example sets the trigger mode to trigger when external event lines ANDed with D mask register equals the D event register:

 

SHORT nStatus;

DioSetupTriggerMode (nMasterHandle, 1, &nStatus);

 

See Also

DioGetTriggerMode, DioSetupTriggerDEvent, DioSetupTriggerPEvent, DioSetupTriggerTEvent, DioArm, DioTrig