
Acquisition modes
Commands
(c) Spectrum Instrumentation GmbH
81
Example for card control:
Card Status
In addition to the wait for an interrupt mechanism or completely instead of it one may also read out the current card status by reading the
SPC_M2STATUS register. The status register is organized as a bitmap, so that multiple bits can be set, showing the status of the card and
also of the different data transfers.
Acquisition cards status overview
The following drawing gives you an overview of the card commands and card status information. After start of card with M2CMD_
-
CARD_START the card is acquiring pretrigger data until one time complete pretrigger data has been acquired. Then the status bit M2STAT_
-
CARD_PRETRIGGER is set. Either the trigger has been enabled together with the start command or the card now waits for trigger enable
command M2CMD_CARD_ENABLETRIGGER. After receiving this command the trigger engine is enabled and card checks for a trigger event.
As soon as the trigger event is received the status bit M2STAT_CARD_TRIGGER is set and the card acquires the programmed posttrigger
data. After all post trigger data has been acquired the status bit M2STAT_CARD_READY is set and data can be read out:
Generation card status overview
This drawing gives an overview of the card commands and status information for a simple generation mode. After start of card with the
M2CMD_CARD_START the card is armed and waiting. Either the trigger has been enabled together with the start command or the card now
waits for trigger enable command M2CMD_CARD_ENABLETRIGGER. After receiving this command the trigger engine is enabled and card
checks for a trigger event. As soon as the trigger event is received the status bit M2STAT_CARD_TRIGGER is set and the card starts with the
// card is started and trigger detection is enabled immediately
spcm_dwSetParam_i32 (hDrv, SPC_M2CMD, M2CMD_CARD_START | M2CMD_CARD_ENABLETRIGGER);
// we wait a maximum of 1 second for a trigger detection. In case of timeout we force the trigger
spcm_dwSetParam_i32 (hDrv, SPC_TIMEOUT, 1000);
if (spcm_dwSetParam_i32 (hDrv, SPC_M2CMD, M2CMD_CARD_WAITTRIGGER) == ERR_TIMEOUT)
{
printf (“No trigger detected so far, we force a trigger now!\n”);
spcm_dwSetParam (hdrv, SPC_M2CMD, M2CMD_CARD_FORCETRIGGER);
}
// we disable the timeout and wait for the end of the run
spcm_dwSetParam_i32 (hDrv, SPC_TIMEOUT, 0);
spcm_dwSetParam_i32 (hDrv, SPC_M2CMD, M2CMD_CARD_WAITREADY);
printf (“Card has stopped now!\n”);
Table 36: Spectrum API: card status register and possible status values with descriptions of the status
Register
Value
Direction
Description
SPC_M2STATUS
110
read only
Reads out the current status information
M2STAT_CARD_PRETRIGGER
1h
Acquisition modes only: the first pretrigger area has been filled. In Multi/ABA/Gated acquisition this status is set only
for the first segment and will be cleared at the end of the acquisition.
M2STAT_CARD_TRIGGER
2h
The first trigger has been detected.
M2STAT_CARD_READY
4h
The card has finished its run and is ready.
M2STAT_CARD_SEGMENT_PRETRG
8h
This flag will be set for each completed pretrigger area including the first one of a Single acquisition.
Additionally for a Multi/ABA/Gated acquisition of M4i/M4x/M2p only, this flag will be set when the pretrigger
area of a segment has been filled and will be cleared in between segments.
Image 48: Acquisition cards: graphical overview of acquisition status and card command interaction
Содержание M2p.59 Series
Страница 190: ......