
100
(c) Spectrum Instrumentation GmbH
Software trigger
Trigger modes and appendant registers
The table below shows the relating register for the general AND mask and the possible constants that can be written to it.
The following example shows, how to setup the AND mask, for an external trigger. As an example a simple high level detection has been
chosen. When multiple external triggers shall be combined by AND, both of the external sources must be included in the AND mask register,
similar to the OR mask example shown before. The explanation and a detailed description of the different trigger modes for the external
trigger inputs will be shown in the dedicated passage within this chapter.
The table below is showing the constants for the channel AND mask (A/D cards only) and all the constants for the different channels.
The following example shows, how to setup the AND mask for a channel trigger. As an example a simple level detection has been chosen.
The explanation and a detailed description of the different trigger modes for the channel trigger modes will be shown in the dedicated pas
-
sage within this chapter.
Software trigger
The software trigger is the easiest way of triggering any Spectrum
board. The acquisition or replay of data will start immediately af
-
ter the card is started and the trigger engine is armed. The result
-
ing delay upon start includes the time the board needs for its
setup and the time for recording the pre-trigger area (for acquisi
-
tion cards).
For enabling the software trigger one simply has to include the
software event within the trigger OR mask, as the following table is showing:
Table 56: Spectrum API: external trigger AND mask related software register and available settings
Register
Value
Direction
Description
SPC_TRIG_AVAILANDMASK
40420
read
Bitmask, in which all bits of the below mentioned sources for the AND mask are set, if available.
SPC_TRIG_ANDMASK
40430
read/write
Defines the events included within the trigger AND mask of the card.
SPC_TMASK_NONE
0
No trigger source selected
SPC_TMASK_EXT0
2h
Enables the external (analog) trigger 0 for the AND mask. The card will trigger if the programmed condition for this
input is valid.
SPC_TMASK_EXT1
4h
Enables the X1 (logic) trigger for the AND mask. The card will trigger if the programmed condition for this input is
valid.
SPC_TMASK_EXT2
8h
Enables the X2 (logic) trigger for the AND mask. The card will trigger if the programmed condition for this input is
valid.
SPC_TMASK_EXT3
10h
Enables the X3 (logic) trigger for the AND mask. The card will trigger if the programmed condition for this input is
valid.
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_NONE); // disable default software trigger
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ANDMASK, SPC_TMASK_EXT0); // Enable external trigger within the AND mask
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_EXT0_LEVEL0, 2000); // Trigger level is 2.0 V (2000 mV)
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_EXT0_MODE, SPC_TM_HIGH); // Setting up external trigger for HIGH level
Table 57: Spectrum API: channel trigger AND mask related software register and available settings
Register
Value
Direction
Description
SPC_TRIG_CH_AVAILANDASK0
40470
read
Bitmask, in which all bits of the below mentioned sources/channels (0…7) for the channel AND mask
are set, if available.
SPC_TRIG_CH_ANDMASK0
40480
read/write
Includes the analog or digital channels (0…7) within the channel trigger AND mask of the card.
SPC_TMASK0_CH0
00000001h
Enables channel0 for recognition within the channel OR mask.
SPC_TMASK0_CH1
00000002h
Enables channel1 for recognition within the channel OR mask.
SPC_TMASK0_CH2
00000004h
Enables channel2 for recognition within the channel OR mask.
SPC_TMASK0_CH3
00000008h
Enables channel3 for recognition within the channel OR mask.
SPC_TMASK0_CH4
00000010h
Enables channel4 for recognition within the channel OR mask.
SPC_TMASK0_CH5
00000020h
Enables channel5 for recognition within the channel OR mask.
SPC_TMASK0_CH6
00000040h
Enables channel6 for recognition within the channel OR mask.
SPC_TMASK0_CH7
00000080h
Enables channel7 for recognition within the channel OR mask.
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_NONE); // disable default software trigger
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH_ANDMASK0, SPC_TMASK_CH0);// Enable channel0 trigger within AND mask
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_LEVEL0, 0); // channel level to detect is zero level
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_MODE, SPC_TM_HIGH); // Setting up ch0 trigger for HIGH levels
Table 58: Spectrum API: software register and register setting for software trigger
Register
Value
Direction
Description
SPC_TRIG_ORMASK
40410
read/write
Defines the events included within the trigger OR mask of the card.
SPC_TMASK_SOFTWARE
1h
Sets the trigger mode to software, so that the recording/replay starts immediately.
Summary of Contents for M2p.59 Series
Page 190: ......