13.07.2015 Views

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

On-board Memory: A Programmer’s ViewThe total memory on a two-channel <strong>CompuScope</strong> card is divided between the two A/D converters on theboard. For instance, a 256M two-channel <strong>CompuScope</strong> card devotes 128M of memory to converter A and128M to converter B.In dual channel mode, each input channel is routed to one of the two converters. Consequently, channel #1captures its data into the memory for converter A and channel #2 captures its data into the memory forconverter B. In single channel mode, however, channel #1 is routed to both A/D converters. Consequentlyboth converter memories contain data from channel #1. Even points are stored in converter A’s memorywhile odd points are stored in converter B’s memory. Single channel <strong>CompuScope</strong>s, like the CS8500, onlyhave one A/D converter so that the memory is not divided as usual.The addresses returned from the routine gage_calculate_addresses represent the trigger address, thestarting address and the ending address of the captured data. These addresses can then be used to loopthrough the desired locations to retrieve the captured data.Gage_mem_read Data Transfer RoutinesThe simplest data transfer routines are the gage_mem_read routines. This family of subroutines transfers asingle data point from <strong>CompuScope</strong> memory to the user buffer. The routines support all classes of<strong>CompuScope</strong> cards – PCI, cPCI, ISA and ISA/PCI. The are ideal for transferring small quantities of databut do not take advantage of high-speed data transfer techniques like PCI bus-mastering. There areseparate gage_mem_read routines for single and dual channel mode.Although the gage_mem_read_single routine returns one point at a time, internally the routine stilltransfers a full four Kilosample block of memory. This speeds up the access to the <strong>CompuScope</strong> memorydramatically for data that is accessed sequentially. Gage_mem_read_single is the preferred method formost applications that need to use discrete data points, since the data are corrected by the driver for anyidiosyncrasies in memory layout and polarity. The data are always returned as integers with the smallestvalue representing the highest voltage and the largest value representing the lowest voltage.As discussed previously, care must be taken to wrap around at the end of the memory address space. Thisis usually done by using the MOD function with the index and gdi.max_available_memory. If thememory depth is a power of 2, then a faster way is to use the AND function withgdi.max_available_memory - 1.location [max_available_memory - 1]location [max_available_memory - 2]location [0]location [1]If one of the block transfer routines, gage_trigger_view_transfer, gage_transfer_buffer or a user-definedroutine is used, then the memory is split between channel A and channel B.As discussed, in single channel mode, the data are divided between the two converter memories, with thefirst data point in converter A memory, the second in converter B memory, the third in A, etc., as shownbelow.Converter A Data 0 Data 2 Data 4 Etc.Converter B Data 1 Data 3 Data 5 Etc.Page 20<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!