
82
(c) Spectrum Instrumentation GmbH
Commands
Acquisition modes
data replay. After replay has been finished - depending on the programmed mode - the status bit M2STAT_CARD_READY is set and the card
stops.
Data Transfer
Data transfer consists of two parts: the buffer definition and the commands/status information that controls the transfer itself. Data transfer
shares the command and status register with the card control commands and status information. In general the following details on the data
transfer are valid for any data transfer in any direction:
• The memory size register (SPC_MEMSIZE) must be programmed before starting the data transfer.
• When the hardware buffer is adjusted from its default (see „Output latency“ section later in this manual), this must be done before defin
-
ing the transfer buffers in the next step via the spcm_dwDefTransfer function.
• Before starting a data transfer the buffer must be defined using the spcm_dwDefTransfer function.
• Each defined buffer is only used once. After transfer has ended the buffer is automatically invalidated.
• If a buffer has to be deleted although the data transfer is in progress or the buffer has at least been defined it is necessary to call the spc
-
m_dwInvalidateBuf function.
Definition of the transfer buffer
Before any data transfer can start it is necessary to define the transfer buffer with all its details. The definition of the buffer is done with the
spcm_dwDefTransfer function as explained in an earlier chapter.
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
uint32 _stdcall spcm_dwDefTransfer_i64 (// Defines the transfer buffer by using 64 bit unsigned integer values
drv_handle hDevice, // handle to an already opened device
uint32 dwBufType, // type of the buffer to define as listed below under SPCM_BUF_XXXX
uint32 dwDirection, // the transfer direction as defined below
uint32 dwNotifySize, // number of bytes after which an event is sent (0=end of transfer)
void* pvDataBuffer, // pointer to the data buffer
uint64 qwBrdOffs, // offset for transfer in board memory
uint64 qwTransferLen); // buffer length
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.
SPCM_DIR_CARDTOGPU
2
RDMA transfer from card memory to GPU memory, SCAPP option needed, Linux only
SPCM_DIR_GPUTOCARD
3
RDMA transfer from GPU memory to card memory, SCAPP option needed, Linux only
Image 49: Generation cards: graphical overview of generation status and card command interaction
Summary of Contents for M2p.59 Series
Page 190: ......