
PCI.412 manual
31.03.2004
Page 19 of 26
Hints for programming the boards
Programming an ISA board is done in the following steps:
initialise and define boards with function
SpcInitBoard
(Windows NT: utility DRVCONFG.EXE)
set installation parameters like address, installed memory, version with function
SpcSetParam
set user specific parameters and start board (loop)
Programming an PCI board is done by the following steps:
initialise PCI boards automatically with function
SpcInitPCIBoards
read out installation parameters for all found PCI boards like version, installed memory
set user specific parameters and start board (loop)
If you are using ISA and PCI boards in one system at the same time, use the function
SpcInitPCIBoards
first and initialise the ISA
boards after this. The function
SpcInitPCIBoards
uses the first board numbers and will overwrite other definitions.
It is only necessary to define the boards once for the driver with the functions
SpcInitPCIBoards
and
SpcInitBoard
. If you are defining the
boards again, you will get an error code from the function and the old definition is still used. You may ignore this error.
Software - Register
These software register are to be used for the functions
SpcSetParam
and
SpcGetParam
of the software driver. All constants are found in
the header file REGS.H.
PCI register
These Registers are set by the driver after PCI initialisation. The information is found in the on-board ROM. The program PCITEST.EXE on
the driver disk will give the same informations.
register name
reg no.
r/w
SPC_PCITYP
2000
r
type of board as listed above
SPC_PCIVERSION
2010
r
board revision: high part in bit 8..15, Low part in bit 0..7
SPC_PCIDATE
2020
r
production date: month in bit 0..7, year in bit 16..31
SPC_PCISERIALNO
2030
r
serial number of the PCI.412
SPC_PCISAMPLERATE
2100
r
max. samplerate as 32 bit integer value
SPC_PCIMEMSIZE
2110
r
installed memory in bytes as 32 bit integer value
SPC_PCIFEATURES
2120
r
installed features as a bitfield. See description beneath.
PCI Features register
Bit 31
not used
...
Bit 8
not used
Bit 7
option synchronisation master: board is clock-master for synchronisation.
Bit 6
option synchronisation slave : board is clock-slave for synchronisation.
Bit 5
option gated sampling installed.
Bit 4
not used
Bit 3
not used
Bit 2
not used
Bit 1
not used
Bit 0
option multiple recording installed.
Error registers
If one action caused an error in the driver this error and the register and value where it occurs will be saved. The driver is then locked until
the error is read out using the SPC_LASTERRORCODE function. All other functions will lead to the same errorcode unless the error is
cleared by reading SPC_LASTERRORCODE.
name
value (dec)
r/w
SPC_LASTERRORCODE
999999
r
errorcode of the last error as defined in errors.h
SPC_LASTERRORREG
999998
r
software register which causes the error
SPC_LASTERRORVALUE
999997
r
value which causes the error
SPC_LASTERRORTEXT
999996
r
Copies a short explanation of the error to a string. The argument value must be a
pointer to a string with at least ERRORTEXTLEN characters.