
114
(c) Spectrum Instrumentation GmbH
Channel Trigger
Trigger modes and appendant registers
16bit trigger level representation depending on selected input range
The following example shows, how to set up a one channel board to trigger on channel 0 with rising edge. It is assumed, that the input range
of channel 0 is set to the the ±200 mV range. The decimal value for SPC_TRIG_CH0_LEVEL0 corresponds then with 5.004 mV, which is the
resulting trigger level.
Reading out the number of possible trigger levels
The Spectrum driver also contains a register that holds the value of the maximum possible different trigger levels considering the above men
-
tioned exclusion of the most negative possible value. This is useful, as new drivers can also be used with older hardware versions, because
you can check the trigger resolution during run time. The register is shown in the following table:
In case of a board that uses 8 bits for trigger detection the returned value would
be 127, as either the zero and 127 positive and negative values are possi
-
ble.The resulting trigger step width in mV can easily be calculated from the re
-
turned value. It is assumed that you know the actually selected input range.
To give you an example on how to use this formula we assume, that the
±1.0 V input range is selected and the board uses 8 bits for trigger detection.
The result would be 7.81 mV, which is the step width for your type of board
within the actually chosen input range.
Table 71: Spectrum API: standard input ranges and representation of trigger level settings in voltage
Input ranges
Triggerlevel
±200 mV
±500 mV
±1 V
±2 V
±5 V
±10 V
32767
+199.994 mV
+499.985 mV
+999.969 mV
+1999.939 mV
+4999.847 mV
+9999.695 mV
32766
+199.988 mV
+499.969 mV
+999.939 mV
+1999.878 mV
+4998.695 mV
+9999.390 mV
…
16384
+100.000 mV
+250.000 mV
+500.000 mV
+1000.000 mV
+2500.000 mV
+5000.000 mV
…
2
+0.012 mV
+0.031 mV
+0.061 mV
+0.122 mV
+0.305 mV
+0.610 mV
1
+0.006 mV
+0.015 mV
+0.031 mV
+0.061 mV
+0.153 mV
+0.305 mV
0
0 V
0 V
0 V
0 V
0 V
0 V
-1
-0.006 mV
-0.015 mV
-0.031 mV
-0.061 mV
-0.153 mV
-0.305 mV
-2
-0.012 mV
-0.031 mV
-0.061 mV
-0.122 mV
-0.305 mV
-0.610 mV
…
-16384
-100.000 mV
-250.000 mV
-500.000 mV
-1000.000 mV
-2500.000 mV
-5000.000 V
…
-32766
-199.988 mV
-499.969 mV
-999.939 mV
-1999.878 mV
-4998.695 mV
-9999.390 mV
-32767
-199.994 mV
-499.985 mV
-999.969 mV
-1999.939 mV
-4999.847 mV
-9999.695 mV
Step size
6.10 µV
15.26 µV
30.52 µV
61.04 µV
152.59 µV
305.18 µV
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_NONE); // disable default software trigger
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_MODE, SPC_TM_POS); // Setting up channel trig (rising edge)
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_LEVEL0, 819); // Sets 16bit triggerlevel to 5.004 mV
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH_ORMASK0, SPC_TMASK0_CH0); // and enable it within the OR mask
Register
Value
Direction
Description
SPC_READTRGLVLCOUNT
2500
r
Contains the number of different possible trigger levels meaning ± of the value.
Trigger step width
Input Range
m
ax
Number of trigger levels 1
+
---------------------------------------------------------------------------------------------------------------------
=
Trigger step width
+1000 mV
127 1
+
---------------------------------------------
=
Содержание M2p.59 Series
Страница 190: ......