62
M2i.30xx / M2i.30xx-exp Manual
Gathering information from the card
Programming the Board
The following example demonstrates how to read out the information about one feature.
The following example demonstrates how to read out the custom modification code.
Installed extended Options and Features
Some cards (such as M4i/M4x/M2p cards) can optionally have advanced features installed. This can be read out with with the following
register:
Miscellaneous Card Information
Some more detailed card information, that might be useful for the application to know, can be read out with the following registers:
Function type of the card
This register register returns the basic type of the card:
Used type of driver
This register holds the information about the driver that is actually used to access the board. Although the driver interface doesn’t differ be-
tween Windows and Linux systems it may be of interest for a universal program to know on which platform it is working.
SPCM_FEAT_REMOTESERVER
10000h
Support for the Spectrum Remote Server option is installed on this card.
SPCM_FEAT_SCAPP
20000h
Support for the SCAPP option allowing CUDA RDMA access to supported graphics cards for GPU calculations
(M4i and M2p)
SPCM_FEAT_CUSTOMMOD_MASK
F0000000h
The upper 4 bit of the feature register is used to mark special custom modifications. This is only used if the card has
been specially customized. Please refer to the extra documentation for the meaning of the custom modification mark.
spcm_dwGetParam_i32 (hDrv, SPC_PCIFEATURES, &lFeatures);
if (lFeatures & SPCM_FEAT_DIGITAL)
printf("Option digital inputs/outputs is installed on your card");
spcm_dwGetParam_i32 (hDrv, SPC_PCIFEATURES, &lFeatures);
lCustomMod = (lFeatures >> 28) & 0xF;
if (lCustomMod != 0)
printf("Custom modification no. %d is installed.", lCustomMod);
Register
Value
Direction
Description
SPC_PCIEXTFEATURES
2121
read
PCI extended feature register. Holds the installed extended features and options as a bitfield. The
read value must be masked out with one of the masks below to get information about one certain fea-
ture.
SPCM_FEAT_EXTFW_SEGSTAT
1h
Is set if the firmware option „Block Statistics“ is installed on the board, which allows certain statistics to be on-board
calculated for data being recorded in segmented memory modes, such as Multiple Recording or ABA.
SPCM_FEAT_EXTFW_SEGAVERAGE
2h
Is set if the firmware option „Block Average“ is installed on the board, which allows on-board hardware averaging of
data being recorded in segmented memory modes, such as Multiple Recording or ABA.
Register
Value
Direction
Description
SPC_MIINST_MODULES
1100
read
Number of the installed front-end modules on the card.
SPC_MIINST_CHPERMODULE
1110
read
Number of channels installed on one front-end module.
SPC_MIINST_BYTESPERSAMPLE
1120
read
Number of bytes used in memory by one sample.
SPC_MIINST_BITSPERSAMPLE
1125
read
Resolution of the samples in bits.
SPC_MIINST_MAXADCVALUE
1126
read
Decimal code of the full scale value.
SPC_MIINST_MINEXTCLOCK
1145
read
Minimum external clock that can be fed in for direct external clock (if available for card model).
SPC_MIINST_MAXEXTCLOCK
1146
read
Maximum external clock that can be fed in for direct external clock (if available for card model).
SPC_MIINST_MINEXTREFCLOCK
1148
read
Minimum external clock that can be fed in as a reference clock.
SPC_MIINST_MAXEXTREFCLOCK
1149
read
Maximum external clock that can be fed in as a reference clock.
SPC_MIINST_ISDEMOCARD
1175
read
Returns a value other than zero, if the card is a demo card.
Register
Value
Direction
Description
SPC_FNCTYPE
2001
read
Gives information about what type of card it is.
SPCM_TYPE_AI
1h
Analog input card (analog acquisition; the M2i.4028 and M2i.4038 also return this value)
SPCM_TYPE_AO
2h
Analog output card (arbitrary waveform generators)
SPCM_TYPE_DI
4h
Digital input card (logic analyzer card)
SPCM_TYPE_DO
8h
Digital output card (pattern generators)
SPCM_TYPE_DIO
10h
Digital I/O (input/output) card, where the direction is software selectable.
Register
Value
Direction
Description
SPC_GETDRVTYPE
1220
read
Gives information about what type of driver is actually used
DRVTYP_LINUX32
1
Linux 32bit driver is used
DRVTYP_WDM32
4
Windows WDM 32bit driver is used (XP/Vista/Windows 7/Windows 8/Windows 10).
DRVTYP_WDM64
5
Windows WDM 64bit driver is used by 64bit application (XP64/Vista/Windows 7/Windows 8/Windows 10).