108
M2i.30xx / M2i.30xx-exp Manual
Trigger Modes
Mode Multiple Recording
Trigger Modes
When using Multiple Recording all of the card’s trigger modes can be used except the software trigger. For detailed information on the avail-
able trigger modes, please take a look at the relating chapter earlier in this manual.
Trigger Counter
The number of acquired trigger events in Multiple Recording mode is counted in hardware and can be read out while the acquisition is running
or after the acquisition has finished. The trigger events are counted both in standard mode as well as in FIFO mode.
The trigger counter feature needs at least driver version V2.17 and firmware version V20 (M2i series), V10
(M3i series), V6 (M4i/M4x series) or V1 (M2p series). Please update the driver and the card firmware to these
versions to use this feature. Trying to use this feature without the proper firmware version will issue a driver
error.
Using the trigger counter information one can determine how many Multiple Recording segments have been acquired and can perform a
memory flush by issuing Force trigger commands to read out all data. This is helpful if the number of trigger events is not known at the start
of the acquisition. In that case one will do the following steps:
• Program the maximum number of segments that one expects or use the FIFO mode with unlimited segments
• Set a timeout to be sure that there are no more trigger events acquired. Alternatively one can manually proceed as soon as it is clear from
the application that all trigger events have been acquired
• Read out the number of acquired trigger segments
• Issue a number of Force Trigger commands to fill the complete memory (standard mode) or to transfer the last FIFO block that contains
valid data segments
• Use the trigger counter value to split the acquired data into valid data with a real trigger event and invalid data with a force trigger event.
Trigger Output
When using internal trigger recognition and enabling the trigger output there is a trigger pulse generated for each acquired segment. The
trigger output goes to high level after recoginition of the internal trigger event and goes back again to low level if the acquisition of this
segment has been finished. To give compatibility to older hardware and to give maxmimum flexibility there is a special register to change
that behaviour.
Programming examples
The following example shows how to set up the card for Multiple Recording in standard mode.
The following example shows how to set up the card for Multiple Recording in FIFO mode.
Register
Value
Direction
Description
SPC_TRIGGERCOUNTER
200905
read
Returns the number of trigger events that has been acquired since the acquisition start. The internal
trigger counter has 48 bits. It is therefore necessary to read out the trigger counter value with 64 bit
access or 2 x 32 bit access if the number of trigger events exceed the 32 bit range.
Register
Value
Direction
Description
SPC_LONGTRIG_OUTPUT
200830
read/write
Defines the trigger pulse output as explained below
0 (default)
The trigger pulse is generated on every trigger event and stays high until acquisition of segment has finished
1
The trigger pulse is generated on the first trigger event and stays high until the end of the complete acquisition
spcm_dwSetParam_i32 (hDrv, SPC_CARDMODE, SPC_REC_STD_MULTI); // Enables Standard Multiple Recording
spcm_dwSetParam_i32 (hDrv, SPC_SEGMENTSIZE, 1024); // Set the segment size to 1024 samples
spcm_dwSetParam_i32 (hDrv, SPC_POSTTRIGGER, 768); // Set the posttrigger to 768 samples and therefore
// the pretrigger will be 256 samples
spcm_dwSetParam_i32 (hDrv, SPC_MEMSIZE, 4096); // Set the total memsize for recording to 4096 samples
// so that actually four segments will be recorded
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_EXT0_MODE, SPC_TM_POS); // Set triggermode to ext. TTL mode (rising edge)
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_EXT0); // and enable it within the trigger OR-mask
spcm_dwSetParam_i32 (hDrv, SPC_CARDMODE, SPC_REC_FIFO_MULTI); // Enables FIFO Multiple Recording
spcm_dwSetParam_i32 (hDrv, SPC_SEGMENTSIZE, 2048); // Set the segment size to 2048 samples
spcm_dwSetParam_i32 (hDrv, SPC_POSTTRIGGER, 1920); // Set the posttrigger to 1920 samples and therefore
// the pretrigger will be 128 samples
spcm_dwSetParam_i32 (hDrv, SPC_LOOPS 256); // 256 segments will be recorded
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_EXT0_MODE, SPC_TM_NEG); // Set triggermode to ext. TTL mode (falling edge)
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_EXT0); // and enable it within the trigger OR-mask