148
M2i.30xx / M2i.30xx-exp Manual
Programming
Option System Star-Hub
Programming
Necessary setup steps
For setting up multiple systems (with likely multiple cards per system) to be synchronized via system Star-Hub, the following steps must be
followed:
• 1. Configure all cards in all systems
• Clock setup
• Trigger setup
• Channel setup
• ...
• 2. Configure all Star-Hubs (in all systems)
• One card connected to system Star-Hub master must be set as clock master
• One or multiple cards connected to system Star-Hub master must be setup to generate trigger events
• Star-Hubs must be set to desired synchronization mode to take only clock or clock and trigger from system Star-Hub distribution
• 3. Transfer setup to system master Star-Hub card to have sampling clocks active before starting the slaves (M2CMD_CARD_WRITESETUP)
• 4. Start all system slave Star-Hubs (preferably in a non-blocking manner, so without M2CMD_CARD_WAITREADY)
• 5. Finally start master Star-Hub (preferably in a blocking manner with M2CMD_CARD_WAITREADY)
• 6. Make sure that also all slaves are ready by proper status polling (waiting for M2STAT_CARD_READY)
• 7. Read out and process/store data from all cards in all systems
• 8. Do another acquisition
• No change in setup: go to step 4
• Change of setup: go to step 1
The programming examples and steps shown in this chapter only deal with the programming of each of the
systems on each own. No techniques are shown for any inter-system software communication. Synchronizing
the software threads on the different systems is solely the users responsibility.
Select synchronization mode
Using the system Star-Hub requires to set the synchronization mode for each participating Star-Hub to either use clock information only or to
use clock and trigger information:
Because the synchronization mode affects all cards connected to a Star-Hub, this register is written to the Star-Hub handle itself, instead to
the single cards:
The system Star-Hub distribution consists of two 1to17 low jitter, low skew buffers to generate the copies routed to all slave systems and the
master itself. These buffers generate a certain delay caused by the propagation delay of the buffers. Additionally also all cables involved add
a certain delay. When not only using clock synchronization but also wanting the triggers on all slaves also to be synchronized the user must
define the clock edge used to sample the received trigger event.
The best matching clock edge depends on the selected sample rate and the total delay. The below mentioned sample rate values assume
external cables of 2 m length to be used to connect the systems to the distribution card. If your setup differs please contact Spectrum for further
information:
Register
Value
Direction
Description
SPC_AVAILSYNC_MODES
49231
read only
Read out the available synchronization modes for the Star-Hub
SPC_SYNC_MODE
49230
read/write
Defines the synchronization mode for the Star-Hub
SPC_SYNC_STANDARD
1h
Addressed Star-Hub uses its own clock and trigger sources and does not participate in system wide synchroniza-
tion (default).
SPC_SYNC_SYSTEMCLOCK
2h
Addressed Star-Hub uses its own trigger sources but takes the clock from the system distribution card.
SPC_SYNC_SYSTEMCLOCKTRIG
4h
Addressed Star-Hub takes clock and trigger from the system Star-Hub distribution. The returned trigger signal will
be sampled on the rising clock edge.
SPC_SYNC_SYSTEMCLOCKTRIGN
8h
Addressed Star-Hub takes clock and trigger from the system Star-Hub distribution. The returned trigger signal will
be sampled on the falling clock edge, to avoid timing issues with certain sampling rates.
drv_handle hSync;
hSync = spcm_hOpen ("sync0");
...
spcm_dwSetParam_i32 (hSync, SPC_SYNC_MODE, SPC_SYNC_SYSTEMCLOCKTRIG); // system clock and trigger used
...
spcm_vClose (hSync);
Lower/higher range of chosen sample rate
SPC_SYNC_MODE
DC
40.0 MHz
SPC_SYNC_SYSTEMCLOCKTRIG
40.0 MHz
60.0 MHz
SPC_SYNC_SYSTEMCLOCKTRIGN
60.0 MHz
80.0 MHz
SPC_SYNC_SYSTEMCLOCKTRIG
80.0 MHz
100.0 MHz
SPC_SYNC_SYSTEMCLOCKTRIGN
100.0 MHz
125.0 MHz
SPC_SYNC_SYSTEMCLOCKTRIG