Trigger modes and appendant registers
Channel Trigger
(c) Spectrum GmbH
97
either want only one channel to be the trigger source, or if you want to combine two or more channels to a logical OR or a logical AND
trigger.
For all channel trigger modes, the OR mask must contain the corresponding input channels (channel 0 taken as example here):.
The following table shows the according registers for the two general channel trigger modes. It lists the maximum of the available channel
mode registers for your card’s series. So it can be that you have less channels installed on your specific card and therefore have less valid
channel mode registers. If you try to set a channel, that is not installed on your specific card, a error message will be returned.
If you want to set up a two channel board to detect only a positive edge on channel 0, you would have to setup the board like the following
example. Both of the examples either for the single trigger source and the OR trigger mode do not include the necessary settings for the trigger
levels. These settings are detailed described in the following paragraphs.
If you want to set up a two channel board to detect a trigger event on either a positive edge on channel 0 or a negative edge on channel 1
you would have to set up your board as the following example shows.
Register
Value
Direction
Description
SPC_TRIG_CH_ORMASK0
40460
read/write
Defines the OR mask for the channel trigger sources.
SPC_TMASK0_CH0
1h
Enables channel0 input for the channel OR mask
Register
Value
Direction
Description
SPC_TRIG_CH_AVAILMODES
40600
read
Bitmask, in which all bits of the below mentioned modes for the channel trigger are set, if available.
SPC_TRIG_CH0_MODE
40610
read/write
Sets the trigger mode for channel 0. Channel 0 must be enabled in the channel OR/AND mask.
SPC_TRIG_CH1_MODE
40611
read/write
Sets the trigger mode for channel 1. Channel 1 must be enabled in the channel OR/AND mask.
SPC_TRIG_CH2_MODE
40612
read/write
Sets the trigger mode for channel 2. Channel 2 must be enabled in the channel OR/AND mask.
SPC_TRIG_CH3_MODE
40613
read/write
Sets the trigger mode for channel 3. Channel 3 must be enabled in the channel OR/AND mask.
SPC_TM_NONE
00000000h
Channel is not used for trigger detection. This is as with the trigger masks another possibility for disabling channels.
SPC_TM_POS
00000001h
Enables the trigger detection for positive edges
SPC_TM_NEG
00000002h
Enables the trigger detection for negative edges
SPC_TM_BOTH
00000004h
Enables the trigger detection for positive and negative edges
SPC_TM_HIGH
00000008h
Enables the trigger detection for HIGH levels
SPC_TM_LOW
00000010h
Enables the trigger detection for LOW levels
SPC_TM_POS | SPC_TM_REARM
01000001h
Trigger detection for positive edges on lebel 0. Trigger is armed when crossing level 1 to avoid false trigger on noise
SPC_TM_NEG | SPC_TM_REARM
01000002h
Trigger detection for negative edges on lebel 1. Trigger is armed when crossing level 0 to avoid false trigger on noise
SPC_TM_POS | SPC_TM_PW_GREATER
04000001h
Enables the pulsewidth trigger detection for long positive pulses
SPC_TM_NEG | SPC_TM_PW_GREATER
04000002h
Enables the pulsewidth trigger detection for long negative pulses
SPC_TM_POS | SPC_TM_PW_SMALLER
02000001h
Enables the pulsewidth trigger detection for short positive pulses
SPC_TM_NEG | SPC_TM_PW_SMALLER
02000002h
Enables the pulsewidth trigger detection for short negative pulses
SPC_TM_STEEPPOS |
SPC_TM_PW_GREATER
04000800h
Enables the steepness trigger detection for flat positive pulses
SPC_TM_STEEPNEG |
SPC_TM_PW_GREATER
04001000h
Enables the steepness trigger detection for flat negative pulses
SPC_TM_STEEPPOS |
SPC_TM_PW_SMALLER
02000800h
Enables the steepness trigger detection for steep positive pulses
SPC_TM_STEEPNEG |
SPC_TM_PW_SMALLER
02000800h
Enables the steepness trigger detection for steep negative pulses
SPC_TM_WINENTER
00000020h
Enables the window trigger for entering signals
SPC_TM_WINLEAVE
00000040h
Enables the window trigger for leaving signals
SPC_TM_INWIN
00000080h
Enables the window trigger for inner signals
SPC_TM_OUTSIDEWIN
00000100h
Enables the window trigger for outer signals
SPC_TM_SPIKE
00000200h
Enables the spike trigger mode. This mode is not availavle on all M2i boards.
SPC_TM_WINENTER |
SPC_TM_PW_GREATER
04000020h
Enables the window trigger for long inner signals
SPC_TM_WINLEAVE |
SPC_TM_PW_GREATER
04000040h
Enables the window trigger for long outer signals
SPC_TM_WINENTER |
SPC_TM_PW_SMALLER
02000020h
Enables the window trigger for short inner signals
SPC_TM_WINLEAVE |
SPC_TM_PW_SMALLER
02000040h
Enables the window trigger for short outer signals
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_NONE); // disable software trigger
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH_ORMASK0, SPC_TMASK0_CH0); // Enable channel 0 in the OR mask
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_MODE, SPC_TM_POS ); // Set triggermode of channel 0 to positive edge
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_NONE); // disable software trigger
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH_ORMASK0, SPC_TMASK0_CH0 | SPC_TMASK0_CH1); // Enable channel 0 + 1
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_MODE, SPC_TM_POS ); // Set triggermode of channel 0 to positive edge
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH1_MODE, SPC_TM_NEG ); // Set triggermode of channel 1 to negative edge