128
M3i.48xx / M3i.48xx-exp Manual
Software Interface
Option Star-Hub (M3i and M4i only)
In case of 4 cards in one system and all are connected with the star-hub this program except will return:
Let’s see a more complex example with two Star-Hubs and one independent card in one system. Star-Hub A connects card 2, card 4 and
card 5. Star-Hub B connects card 0 and card 3. Card 1 is running completely independent and is not synchronized at all:
Now the program has to check both star-hubs:
In case of the above mentioned cabling this program except will return:
For the following examples we will assume that 4 cards in one system are all connected to one star-hub to keep things easier.
Setup of Synchronization
The synchronization setup only requires one additional registers to enable the cards that are synchronized in the next run
The enable mask is based on the logical index explained above. It is possible to just select a couple of cards for the synchronization. All other
cards then will run independently. Please be sure to always enable the card on which the star-hub is located as this one is a must for the
synchronization.
In our example we synchronize all four cards. The star-hub is located on card #2 and is therefor the clock master
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.
star-hub logical index 0 is connected with card 0
star-hub logical index 1 is connected with card 1
star-hub logical index 2 is connected with card 2
star-hub logical index 3 is connected with card 3
card
Star-Hub connection
card handle
star-hub handle
card index in star-hub
mask for this card in
star-hub
card 0
-
/dev/spcm0
0 (of star-hub B)
0x0001
card 1
-
/dev/spcm1
-
card 2
star-hub A
/dev/spcm2
sync0
0 (of star-hub A)
0x0001
card 3
star-hub B
/dev/spcm3
sync1
1 (of star-hub B)
0x0002
card 4
-
/dev/spcm4
1 (of star-hub A)
0x0002
card 5
-
/dev/spcm5
2 (of star-hub A)
0x0004
for (j = 0; j < lStarhubCount; j++)
{
spcm_dwGetParam_i32 (hSync[j], SPC_SYNC_READ_SYNCCOUNT, &lSyncCount);
for (i = 0; i < lSyncCount; i++)
{
spcm_dwGetParam_i32 (hSync[j], SPC_SYNC_READ_CA i, &lCardIdx);
printf ("star-hub %c logical index %d is connected with card %d\n“, (!j ? ’A’ : ’B’), i, lCardIdx);
}
printf ("\n");
}
star-hub A logical index 0 is connected with card 2
star-hub A logical index 1 is connected with card 4
star-hub A logical index 2 is connected with card 5
star-hub B logical index 0 is connected with card 0
star-hub B logical index 1 is connected with card 3
Register
Value
Direction
Description
SPC_SYNC_ENABLEMASK
49200
read/write
Mask of all cards that are enabled for the synchronization
spcm_dwSetParam_i32 (hSync, SPC_SYNC_ENABLEMASK, 0x000F); // all 4 cards are masked
// set the clock master to 100 MS/s internal clock
spcm_dwSetParam_i32 (hCard[2], SPC_CLOCKMODE, SPC_CM_INTPLL);
spcm_dwSetParam_i32 (hCard[2], SPC_SAMPLEATE, MEGA(100));
// set all the slaves to run synchronously with 100 MS/s
spcm_dwSetParam_i32 (hCard[0], SPC_SAMPLEATE, MEGA(100));
spcm_dwSetParam_i32 (hCard[1], SPC_SAMPLEATE, MEGA(100));
spcm_dwSetParam_i32 (hCard[3], SPC_SAMPLEATE, MEGA(100));