
170
(c) Spectrum Instrumentation GmbH
Software Interface
Option Star-Hub
and so on. On such systems it is sufficient to read out the SPC_SYNC_READ_SYNCCOUNT register to check whether the star-hub has found
the expected number of cards to be connected.
In case of 4 cards in one system and all are connected with the star-hub this program excerpt 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 excerpt 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 register 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.
spcm_dwGetParam_i32 (hSync, SPC_SYNC_READ_SYNCCOUNT, &lSyncCount);
for (i = 0; i < lSyncCount; i++)
{
spcm_dwGetParam_i32 (hSync, SPC_SYNC_READ_CA i, &lCardIdx);
printf ("star-hub logical index %d is connected with card %d\n“, i, lCardIdx);
}
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
Summary of Contents for M2p.59 Series
Page 190: ......