88
M3i.48xx / M3i.48xx-exp Manual
Software trigger
Trigger modes and appendant registers
chosen. 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 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 inputs will be shown in the dedicated passage
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 starting the board. The only delay results from the time the
board needs for its setup.
For enabling the software trigger one simply has to include the
software event within the trigger OR mask, as the following table
is showing:
Example for setting up the software trigger:
Force- and Enable trigger
In addition to the software trigger (free run) it is also possible to force a trigger event by software while the board is waiting for an internal
or external trigger event. The forcetrigger command will only have any effect, when the board is waiting for a trigger event. The command
for forcing a trigger event is shown in the table below.
Issuing the forcetrigger command will every time only generate one trigger event. If for example using Multiple Recording that will result in
only one segment being acquired by forcetrigger. After execution of the forcetrigger command the trigger engine will fall back to the trigger
mode that was originally programmed and will again wait for a trigger event.
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
Register
Value
Direction
Description
SPC_TRIG_CH_AVAILANDASK0
40470
read
Bitmask, in which all bits of the below mentioned sources/channels (0…31) for the channel AND
mask are set, if available.
SPC_TRIG_CH_ANDMASK0
40480
read/write
Includes the analog or digital channels (0…31) 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_CH28
10000000h
Enables channel28 for recognition within the channel OR mask.
SPC_TMASK0_CH29
20000000h
Enables channel29 for recognition within the channel OR mask.
SPC_TMASK0_CH30
40000000h
Enables channel30 for recognition within the channel OR mask.
SPC_TMASK0_CH31
80000000h
Enables channel31 for recognition within the channel OR mask.
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH_ANDMASK0, SPC_TMASK_CH0); // Enable channel0 trigger within the 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
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.
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_SOFTWARE); // Internal software trigger mode is used
Register
Value
Direction
Description
SPC_M2CMD
100
write
Command register of the M2i/M3i/M4i series cards.
M2CMD_CARD_FORCETRIGGER
10h
Forces a trigger event if the hardware is still waiting for a trigger event.