
Option Star-Hub
Software Interface
(c) Spectrum Instrumentation GmbH
169
The Star-Hub initialization must be done AFTER initialization of all cards in the system. Otherwise the inter
-
connection won’t be received properly.
The Star-Hubs are accessed using a special device name „sync“ followed by the index of the star-hub to access. The Star-Hub is handled
completely like a physical card allowing all functions based on the handle like the card itself.
Example with 4 cards and one Star-Hub (no error checking to keep example simple)
Example for a digitizerNETBOX with two internal digitizer/generator modules, This example is also suitable for accessing a remote server
with two cards installed:
When opening the Star-Hub the cable interconnection is checked. The Star-Hub may return an error if it sees internal cabling problems or if
the connection between Star-Hub and the card that holds the Star-Hub is broken. It can’t identify broken connections between Star-Hub and
other cards as it doesn’t know that there has to be a connection.
The synchronization setup is done using bit masks where one bit stands for one recognized card. All cards that are connected with a Star-
Hub are internally numbered beginning with 0. The number of connected cards as well as the connections of the star-hub can be read out
after initialization. For each card that is connected to the star-hub one can read the index of that card:
In standard systems where all cards are connected to one star-hub reading the star-hub logical index will simply return the index of the card
again. This results in bit 0 of star-hub mask being 1 when doing the setup for card 0, bit 1 in star-hub mask being 1 when setting up card 1
drv_handle hSync;
drv_handle hCard[4];
for (i = 0; i < 4; i++)
{
sprintf (s, "/dev/spcm%d", i);
hCard[i] = spcm_hOpen (s);
}
hSync = spcm_hOpen ("sync0");
...
spcm_vClose (hSync);
for (i = 0; i < 4; i++)
spcm_vClose (hCard[i]);
drv_handle hSync;
drv_handle hCard[2];
for (i = 0; i < 2; i++)
{
sprintf (s, "TCPIP::192.168.169.14::INST%d::INSTR", i);
hCard[i] = spcm_hOpen (s);
}
hSync = spcm_hOpen ("sync0");
...
spcm_vClose (hSync);
for (i = 0; i < 2; i++)
spcm_vClose (hCard[i]);
Table 100: Spectrum API: star-hub related registers for reading detected connections
Register
Value
Direction
Description
SPC_SYNC_READ_NUMCONNECTORS
48991
read
Number of connectors that the Star-Hub offers at max. (available with driver V5.6 or newer)
SPC_SYNC_READ_SYNCCOUNT
48990
read
Number of cards that are connected to this Star-Hub
SPC_SYNC_READ_CARDIDX0
49000
read
Index of card that is connected to star-hub logical index 0 (mask 0x0001)
SPC_SYNC_READ_CARDIDX1
49001
read
Index of card that is connected to star-hub logical index 1 (mask 0x0002)
...
read
...
SPC_SYNC_READ_CARDIDX7
49007
read
Index of card that is connected to star-hub logical index 7 (mask 0x0080)
SPC_SYNC_READ_CARDIDX8
49008
read
M2i only: Index of card that is connected to star-hub logical index 8 (mask 0x0100)
...
read
...
SPC_SYNC_READ_CARDIDX15
49015
read
M2i only: Index of card that is connected to star-hub logical index 15 (mask 0x8000)
SPC_SYNC_READ_CABLECON0
read
Returns the index of the cable connection that is used for the logical connection 0. The cable connec
-
tions can be seen printed on the PCB of the star-hub. Use these cable connection information in case
that there are hardware failures with the star-hub cabeling.
...
49100
read
...
SPC_SYNC_READ_CABLECON15
49115
read
Returns the index of the cable connection that is used for the logical connection 15.
Содержание M2p.59 Series
Страница 190: ......