Commands (in alphabetical order), Daqadcarm, Daqadcbufferrotate – Measurement Computing WaveBook rev.3.0 User Manual
Page 199: Commands

WaveBook User’s Manual,
6-24-99
daqX API - Command Reference D-3
Commands
(in Alphabetical Order)
daqAdcArm
DLL Function
daqAdcArm(DaqHandleT handle);
C
daqAdcArm(DaqHandleT handle);
Visual BASIC
VBdaqAdcArm&(ByVal handle&)
Delphi
daqAdcArm(handle:DaqHandleT)
Parameters
handle
Handle to the device to which configured ADC acquisition is to be armed
Returns
DerrNoError
No error (see the API Error Codes table at the end of this chapter).
See Also
daqAdcDisarm
Program References
ADCEX1.C, DACEX1.C, DYN32ENH.C, DAQEX.FRM (VB), ADCEX.PAS (Delphi)
Used With
All devices
Description
daqAdcArm
allows you to arm an ADC acquisition by enabling the currently defined ADC configuration for acquisition. ADC acquisition
will occur when the trigger event (as specified by daqAdcSetTrig)is satisfied. All ADC acquisition configuration information must be
specified prior to the daqAdcArm command. For a previously configured acquisition, the daqAdcArm command will use the specified
parameters. If no previous configuration was given, or it is desirable to change any or all acquisition parameters, then those commands
relating to the desired ADC acquisition configuration must be issued prior to calling daqAdcArm.
daqAdcBufferRotate
DLL Function
daqAdcBufferRotate(DaqHandleT handle, PWORD buf, DWORD scanCount, DWORD chanCount,
DWORD retCount);
C
daqAdcBufferRotate(DaqHandleT handle, PWORD buf, DWORD scanCount, DWORD chanCount,
DWORD retCount);
Visual BASIC
VBdaqAdcBufferRotate&(ByVal handle&, buf%(), ByVal scanCount&, ByVal chanCount&,
ByVal retCount&)
Delphi
daqAdcBufferRotate(handle:DaqHandleT; buf:PWORD; scanCount:DWORD; chanCount:DWORD;
retCount:DWORD)
handle
Handle to the device for which the ADC transfer buffer is to be rotated
buf
Pointer to the buffer to rotate
scanCount
Total number of scans in the buffer
chanCount
Number of channels in each scan
Parameters
retCount
Last value returned in the retCount parameter of the daqAdcTransferGetStat function
Returns
DerrNoError
No error (see the API Error Codes table at the end of this chapter).
See Also
daqAdcTransferGetStat, daqAdcTransferSetBuffer
Program References
None
Used With
All devices
Description
daqAdcBufferRotate
allows you to linearize a circular buffer acquired via a transfer in cycle mode. This command will organize the
circular buffer chronologically. In other words, it will order the data from oldest-first to newest-last in the buffer. When scans are acquired
using daqAdcBufferTransfer with a non-zero cycle parameter, the buffer is used as a circular buffer; once it is full, it is re-used,
starting at the beginning of the buffer. Thus, when the acquisition is complete, the buffer may have been overwritten many times and the
last acquired scan may be any place within the buffer.
For example, during the acquisition of 1000 scans in a buffer that only has room for 60 scans, the buffer is filled with scans 1 through 60.
Then scan 61 overwrites scan 1; scan 62 overwrites scan 2; and so on until scan 120 overwrites scan 60. At this point, the end of the
buffer has been reached again and so scan 121 is stored at the beginning of the buffer, overwriting scan 61. This process of overwriting
and re-using the buffer continues until all 1000 scans have been acquired. At this point, the buffer has the following contents:
Buffer Position
1
2
3
...
39
40
41
42
...
58
59
60
Scan
961
962
963
...
999
1000
941
942
...
958
959
960
In this case, because the total number of scans is not an even multiple of the buffer size, the oldest scan is not at the beginning of the
buffer and the last scan is not at the end of the buffer. daqAdcBufferRotate can rearrange the scans into their natural, chronological
order:
Buffer Position
1
2
3
...
39
40
41
42
...
58
59
60
Scan
941
942
943
...
979
980
981
982
...
998
999
1000
If the total number of acquired scans is no greater than the buffer size, then the scans have not overwritten earlier scans and the buffer is
already in chronological order. In this case, daqAdcBufferRotate does not modify the buffer.
Note: daqAdcBufferRotate only works on unpacked samples.