
Acquisition modes
Buffer handling
(c) Spectrum Instrumentation GmbH
89
Step 1: Buffer definition
Directly after buffer definition the complete buffer is empty (card to PC) or
completely filled (PC to card). In our example we have a notify size which
is 1/4 of complete buffer memory to keep the example simple. In real
world use it is recommended to set the notify size to a smaller stepsize.
Step 2: Start and first data available
In between we have started the transfer and have waited for the first data
to be available for the user. When there is at least one block of notify size
in the memory we get an interrupt and can proceed with the data. Any
data that already was transferred is announced. The USER_POS is still
zero as we are right at the beginning of the complete transfer.
Step 3: set the first data available for card
Now the data can be processed. If transfer is going from card to PC that
may be storing to hard disk or calculation of any figures. If transfer is go
-
ing from PC to card that means we have to fill the available buffer again
with data. After the amount of data that has been processed by the user
application we set it available for the card and for the next step.
Step 4: next data available
After reaching the next border of the notify size we get the next part of the
data buffer to be available. In our example at the time when reading the
USER_LEN even some more data is already available. The user position
will now be at the position of the previous set CARD_LEN.
Step 5: set data available again
Again after processing the data we set it free for the card use.
In our example we now make something else and don’t react to the inter
-
rupt for a longer time. In the background the buffer is filled with more da
-
ta.
Step 6: roll over the end of buffer
Now nearly the complete buffer is filled. Please keep in mind that our cur
-
rent user position is still at the end of the data part that we processed and
marked in step 4 and step 5. Therefore the data to process now is split in
two parts. Part 1 is at the end of the buffer while part 2 is starting with
address 0.
Step 7: set the rest of the buffer available
Feel free to process the complete data or just the part 1 until the end of
the buffer as we do in this example. If you decide to process complete
buffer please keep in mind the roll over at the end of the buffer.
This buffer handling can now continue endless as long as we manage to
set the data available for the card fast enough. The USER_POS and USER_LEN for step 8 would now look exactly as the buffer shown in step 2.
Содержание M2p.59 Series
Страница 190: ......