Option Star-Hub
Software Interface
(c) Spectrum GmbH
143
The slaves can only run with a sampling rate divided from the master clock using a divider up to 8190 in
steps of two. Values that are not matching will be calculated to the nearest matching value on start of the
synchronization.
Setup of Trigger
Setting up the trigger does not need any further steps of synchronization setup. Simply all trigger settings of all cards that have been enabled
for synchronization are connected together. All trigger sources and all trigger modes can be used on synchronization as well.
Having positive edge of external trigger on card 0 to be the trigger source for the complete system needs the following setup:
Assuming that the 4 cards are analog data acquisition cards with 4 channels each we can simply setup a synchronous system with all channels
of all cards being trigger source. The following setup will show how to set up all trigger events of all channels to be OR connected. If any of
the channels will now have a signal above the programmed trigger level the complete system will do an acquisition:
Trigger Delay on synchronized cards
Please note that the trigger delay setting is not used when synchronizing cards. If you need a trigger delay
on synchronized systems it is necessary to program posttrigger, segmentsize and memsize to fulfill this task.
Run the synchronized cards
Running of the cards is very simple. The star-hub acts as one big card containing all synchronized cards. All card commands have to be
omitted directly to the star-hub which will check the setup, do the synchronization and distribute the commands in the correct order to all
synchronized cards. The same card commands can be used that are also possible for single cards:
All other commands and settings need to be send directly to the card that it refers to.
spcm_dwSetParam_i32 (hCard[0], SPC_TRIG_ORMASK, SPC_TMASK_EXT0);
spcm_dwSetParam_i32 (hCard[0], SPC_TRIG_EXT0_MODE, SPC_TM_POS);
spcm_dwSetParam_i32 (hCard[1], SPC_TRIG_ORMASK, SPC_TM_NONE);
spcm_dwSetParam_i32 (hCard[2], SPC_TRIG_ORMASK, SPC_TM_NONE);
spcm_dwSetParam_i32 (hCard[3], SPC_TRIG_ORMASK, SPC_TM_NONE);
for (i = 0; i < lSyncCount; i++)
{
int32 lAllChannels = (SPC_TMASK0_CH0 | SPC_TMASK0_CH1 | SPC_TMASK_CH2 | SPC_TMASK_CH3);
spcm_dwSetParam_i32 (hCard[i], SPC_TRIG_CH_ORMASK0, lAllChannels);
for (j = 0; j < 2; j++)
{
// set all channels to trigger on positive edge crossing trigger level 100
spcm_dwSetParam_i32 (hCard[i], SPC_TRIG_CH j, SPC_TM_POS);
spcm_dwSetParam_i32 (hCard[i], SPC_TRIG_CH0_ j, 100);
}
}
Register
Value
Direction
Description
SPC_M2CMD
100
write only
Executes a command for the card or data transfer
M2CMD_CARD_RESET
1h
Performs a hard and software reset of the card as explained further above
M2CMD_CARD_WRITESETUP
2h
Writes the current setup to the card without starting the hardware. This command may be useful if changing some
internal settings like clock frequency and enabling outputs.
M2CMD_CARD_START
4h
Starts the card with all selected settings. This command automatically writes all settings to the card if any of the set-
tings has been changed since the last one was written. After card has been started none of the settings can be
changed while the card is running.
M2CMD_CARD_ENABLETRIGGER
8h
The trigger detection is enabled. This command can be either send together with the start command to enable trigger
immediately or in a second call after some external hardware has been started.
M2CMD_CARD_FORCETRIGGER
10h
This command forces a trigger even if none has been detected so far. Sending this command together with the start
command is similar to using the software trigger.
M2CMD_CARD_DISABLETRIGGER
20h
The trigger detection is disabled. All further trigger events are ignored until the trigger detection is again enabled.
When starting the card the trigger detection is started disabled.
M2CMD_CARD_STOP
40h
Stops the current run of the card. If the card is not running this command has no effect.