94
M2i.60xx / M2i.60xx-exp Manual
Software trigger
Trigger modes and appendant registers
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:
Due to the fact that the software trigger is an internal trigger mode, you can optionally enable the external trigger output to generate a high
active trigger signal, which indicates when the data acquisition or replay begins. This can be useful to synchronize external equipment with
your Spectrum board.
Example for setting up the software trigger:
Force- and Enable trigger
In addition to the softwaretrigger (free run) it is also possible to force a triggerevent 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 force trigger. 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.
The example shows, how to use the forcetrigger command:
It is also possible to enable (arm) or disable (disarm) the card’s whole triggerengine by software. By default the trigger engine is disabled.
The example shows, how to arm and disarm the card’s trigger engine properly:
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.
Register
Value
Direction
Description
SPC_TRIG_OUTPUT
40100
read/write
Defines the data direction of the external trigger connector.
0
The trigger connector is not used and the line driver is disabled.
1
The trigger connector is used as an output that indicates a detected internal trigger event.
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_SOFTWARE); // Internal software trigger mode is used
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_OUTPUT, 1 ); // And the trigger output is enabled
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.
spcm_dwSetParam_i32 (hDrv, SPC_M2CMD, M2CMD_CARD_FORCETRIGGER); // Forcetrigger is used.
Register
Value
Direction
Description
SPC_M2CMD
100
write
Command register of the M2i/M3i/M4i series cards.
M2CMD_CARD_ENABLETRIGGER
8h
Enables the trigger engine. Any trigger event will now be recognized.
M2CMD_CARD_DISABLETRIGGER
20h
Disables the trigger engine. No trigger events will be recognized.
spcm_dwSetParam_i32 (hDrv, SPC_M2CMD, M2CMD_CARD_ENABLETRIGGER); // Trigger engine is armed.
...
spcm_dwSetParam_i32 (hDrv, SPC_M2CMD, M2CMD_CARD_DISABLETRIGGER); // Trigger engine is disarmed.