Acquisition modes
Commands
(c) Spectrum GmbH
71
This function is used to define buffers for standard sample data transfer as well as for extra data transfer for additional ABA or timestamp
information. Therefore the dwBufType parameter can be one of the following:
The dwDirection parameter defines the direction of the following data transfer:
The direction information used here must match the currently used mode. While an acquisition mode is used
there’s no transfer from PC to card allowed and vice versa. It is possible to use a special memory test mode
to come beyond this limit. Set the SPC_MEMTEST register as defined further below.
The dwNotifySize parameter defines the amount of bytes after which an interrupt should be generated. If leaving this parameter zero, the
transfer will run until all data is transferred and then generate an interrupt. Filling in notify size > zero will allow you to use the amount of
data that has been transferred so far. The notify size is used on FIFO mode to implement a buffer handshake with the driver or when trans-
ferring large amount of data where it may be of interest to start data processing while data transfer is still running. Please see the chapter on
handling positions further below for details.
The Notify size sticks to the page size which is defined by the PC hardware and the operating system. There-
fore the notify size must be a multiple of 4 kByte. For data transfer it may also be a fraction of 4k in the
range of 16, 32, 64, 128, 256, 512, 1k or 2k. No other values are allowed. For ABA and timestamp the notify
size can be 2k as a minimum. If you need to work with ABA or timestamp data in smaller chunks please use the
polling mode as described later.
The pvDataBuffer must point to an allocated data buffer for the transfer. Please be sure to have at least the amount of memory allocated that
you program to be transferred. If the transfer is going from card to PC this data is overwritten with the current content of the card on-board
memory.
When not doing FIFO mode one can also use the qwBrdOffs parameter. This parameter defines the starting position for the data transfer as
byte value in relation to the beginning of the card memory. Using this parameter allows it to split up data transfer in smaller chunks if one
has acquired a very large on-board memory.
The qwTransferLen parameter defines the number of bytes that has to be transferred with this buffer. Please be sure that the allocated memory
has at least the size that is defined in this parameter. In standard mode this parameter cannot be larger than the amount of data defined with
memory size.
Memory test mode
In some cases it might be of interest to transfer data in the opposite direction. Therefore a special memory test mode is available which allows
random read and write access of the complete on-board memory. While memory test mode is activated no normal card commands are pro-
cessed:
Invalidation of the transfer buffer
The command can be used to invalidate an already defined buffer if the buffer is about to be deleted by user. This function is automatically
called if a new buffer is defined or if the transfer of a buffer has completed
The dwBufType parameter need to be the same parameter for which the buffer has been defined:
SPCM_BUF_DATA
1000
Buffer is used for transfer of standard sample data
SPCM_BUF_ABA
2000
Buffer is used to read out slow ABA data. Details on this mode are described in the chapter about the ABA mode
option
SPCM_BUF_TIMESTAMP
3000
Buffer is used to read out timestamp information. Details on this mode are described in the chapter about the
timestamp option.
SPCM_DIR_PCTOCARD
0
Transfer is done from PC memory to on-board memory of card
SPCM_DIR_CARDTOPC
1
Transfer is done from card on-board memory to PC memory.
Register
Value
Direction
Description
SPC_MEMTEST
200700
read/write
Writing a 1 activates the memory test mode, no commands are then processed.
Writing a 0 deactivates the memory test mode again.
uint32 _stdcall spcm_dwInvalidateBuf ( // invalidate the transfer buffer
drv_handle hDevice, // handle to an already opened device
uint32 dwBufType); // type of the buffer to invalidate as listed above under SPCM_BUF_XXXX
SPCM_BUF_DATA
1000
Buffer is used for transfer of standard sample data
SPCM_BUF_ABA
2000
Buffer is used to read out slow ABA data. Details on this mode are described in the chapter about the ABA mode
option. The ABA mode is only available on analog acquisition cards.
SPCM_BUF_TIMESTAMP
3000
Buffer is used to read out timestamp information. Details on this mode are described in the chapter about the times-
tamp option. The timestamp mode is only available on analog or digital acquisition cards.