Programming the Board
Gathering information from the card
(c) Spectrum GmbH
63
Miscellaneous Card Information
Some more detailed card information, that might be usefull for the application to know, can be read out with the following registers:
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 an universal program to know on which platform it is working.
Driver version
This register holds information about the currently installed driver library. As the drivers are permanently improved and maintained and new
features are added user programs that rely on a new feature are requested to check the driver version whether this feature is installed.
The resulting 32 bit value for the driver version consists of the three version number parts shown in the table below:
Kernel Driver version
This register informs about the actually used kernel driver. Windows users can also get this information from the device manager. Please refer
to the „Driver Installation“ chapter. On Linux systems this information is also shown in the kernel message log at driver start time.
The resulting 32 bit value for the driver version consists of the three version number parts shown in the table below:
The following example demonstrates how to read out the kernel and library version and how to print them.
This small program will generate an output like this:
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 inas a reference clock.
SPC_MIINST_MAXEXTREFCLOCK
1149
read
Maximum external clock that can be fed inas 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_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).
DRVTYP_WDM64
5
Windows WDM 64bit driver is used by 64bit application (XP64/Vista/Windows 7/Windows 8).
DRVTYP_WOW64
6
Windows WDM 64bit driver is used by 32bit application (XP64/Vista/Windows 7/Windows 8).
DRVTYP_LINUX64
7
Linux 64bit driver is used
Register
Value
Direction
Description
SPC_GETDRVVERSION
1200
read
Gives information about the driver library version
Driver Major Version
Driver Minor Version
Driver Build
8 Bit wide: bit 24 to bit 31
8 Bit wide, bit 16 to bit 23
16 Bit wide, bit 0 to bit 15
Register
Value
Direction
Description
SPC_GETKERNELVERSION
1210
read
Gives information about the kernel driver version.
Driver Major Version
Driver Minor Version
Driver Build
8 Bit wide: bit 24 to bit 31
8 Bit wide, bit 16 to bit 23
16 Bit wide, bit 0 to bit 15
spcm_dwGetParam_i32 (hDrv, SPC_GETDRVVERSION, &lLibVersion);
spcm_dwGetParam_i32 (hDrv, SPC_GETKERNELVERSION, &lKernelVersion);
printf("Kernel V %d.%d build %d\n”,lKernelVersion >> 24, (lKernelVersion >> 16) & 0xff, lKernelVersion & 0xffff);
printf("Library V %d.%d build %d\n”,lLibVersion >> 24, (lLibVersion >> 16) & 0xff, lLibVersion & 0xffff);
Kernel V 1.11 build 817
Library V 1.1 build 854