Controlling the device, Device initialization, Error handling – Dataman 530 Series User Manual
Page 6: Waveform generation
Development kit for DATAMAN 530
Programmer’s Guide
2. Controlling the device
2.1. Device initialization
First of all, it is necessary to load the driver using the function LoadDriver.
LoadDriver
After the driver is loaded, it is possible to initialize the device using the
function InitHardware. This function returns also the information as to whether the
calibration data is correct or not.
Dim CalibOK As Long
InitHardware (CalibOK)
2.2. Error handling
In case the error occurs, all subsequent calls to functions will fail. Therefore it
is necessary to check if the operations were successful (for example check if the
initialization was successful). Use GetDKError to obtain the error code.
Dim res As Long
res = GetDKError()
In case of an error, it is necessary to reset the error flag (to indicate to the DK,
that the error has been handled). Use ResetDKError function to do so (otherwise no
other function will be successful).
ResetDKError
2.3. Waveform generation
The DATAMAN 531 generator generates the waveforms composed of
samples with 12 bit resolution. Therefore each sample has 4096 quantization levels
(from 0 to 4095 – where 2048 corresponds to the selected shift and 4095 corresponds
to the selected shift + level). The generator distinguishes the two waveform types by
their length:
- the standard length waveform – the length is always fixed to 8192 samples.
The frequency which is set is the frequency of the whole waveform. If the frequency
is higher than the capabilities of the generator, the DK automatically undersamples the
waveform and converts its length to match the selected frequency.
- the arbitrary length waveform – the length of this type is arbitrary. The
frequency which is set is the sampling rate of the generator. Therefore it is possible to
calculate the frequency of the waveform as Frequency/Length. If the frequency is
higher than the capabilities of the generator, the DK sets the highest possible
frequency.
Use SetWaveform function to set the waveform to the device.
- 6 -