next up previous contents
Next: Data Acquisition Timings Up: Data Acquisition Previous: Direct Memory Access (DMA)   Contents

Using A/D commands

The commands CYC (number of cycles sampled), IFF (IF reference), and SFQ (samples per cycle) are used to configure the A/D system to make measurements. When using the A/D commands CYC, IFF, and SFQ, it is important to note that the hardware imposes some limits. The DMA restriction of 65,536 samples has been noted above. The product of the CYC and SEQ values should not exceed this limit. The other important limitation is imposed by the A/D's maximum sampling frequency of 100 kHz. In this case, the product of the SFQ and IFF values should not exceed this maximum sampling frequency. For instance, if the commands:
  IFF 1000
  SFQ 64
are sent to the ZY, the resulting sampling frequency will be 64 kHz, which is acceptable. If we had sent:
  IFF 2000
  SFQ 64
However, the sampling rate requested would be 128 kHz, which is beyond the capabilities of the A/D converter. In any case, the ZY will not allow an illegal condition: the offending command will return with an error, in this case it would be the SFQ command, because it was the command that caused the illegal condition (SFQ 32 would be OK, for example). Once the A/D system has been properly configured, the client program can use either low level commands or high level commands to make a measurement. The following examples show how to use the low level commands to perform measurements: To integrate a number of cycles and calculate a phase and amplitude:
  TRG    ; trigger the measurement
  MPC    ; calculate phase and magnitude from data in DMA buffer
  RAD    ; return phase, in radians
  MAG    ; return magnitude, in volts
The ZY responds with:
  TRG 1
  MPC 1
  RAD 1, 3.6657776
  MAG 1, 2.67
To calculate a sequence of phases and amplitudes, each one corresponding to a cycle structure in the DMA buffer:
  TRG    ; trigger the measurement
  SEQ    ; calculate and return the sequence data
The ZY responds with:
  TRG 1
  SEQ 1, 0, 3.534, 4.23489882, 0, 0
  SEQ 1, 1, 3.499, 4.23398948, 0, 0
  ...
  SEQ 1, n, 3.529, 4.23459893, 0, 0
Where n is (number-of-cycles - 1). The 2 zeroes at the end of each line are place holders for an undocumented experimental feature and may be safely ignored. To retrieve a range of individual samples from the DMA buffer:
  TRG;     ; trigger the measurement
  DAT 0, 9 ; request samples 0 through 9
The ZY responds with:
  TRG 1
  DAT 1, 0, -22094
  DAT 1, 1, -20138
  ...
  DAT 1, 9, 30982
High level commands are very similar to their low level counterparts, except that the data in the DMA buffer is associated with a cube, and the results of the phase and amplitude are stored in that cube's data structure, and can be used to return actual distance measurements (with low level commands, the results are not stored anywhere outside the phase system's structures, and are overwritten by the next calculation). The following example shows how to use high level commands to make a distance measurement:
  CMEAS 1, ZG11   ; move laser to cube ZG11, measure and return results
The ZY responds with:
  CMEAS 1, 4, ZG11, 0.524, 2.13223465, 70023.021
The first parameter returned by CMEAS indicates that the operation succeeded. Following this flag is the cube index number, the cube name, amplitude of the return signal, phase of the return signal, and measured distance to the corner cube target. There are no high level equivalents to the SEQ and DAT commands. There is, however, another high level data acquisition command that merits mention: SCN. SCN causes the ZY to measure in turn each cube listed in the scan list. The NUM and ORD commands are used to maintain this list (see NUM, ORD, SCN). If a large number of cubes need to be measured, SCN is preferable to repeating the example above for each cube, for the following reasons:
  1. It is optimized for speed (see following section).
  2. It requires a single command from the client. This is particularly important in a multiple ZY system, as each can scan the list of cubes concurrently, without the need of multiple commands from the client program, which necessarily would have to send them in sequence to each ZY.

next up previous contents
Next: Data Acquisition Timings Up: Data Acquisition Previous: Direct Memory Access (DMA)   Contents
Ramon E. Creager 2002-03-11