SpectrumWaveformGenerator#
- class SpectrumWaveformGenerator(resourceName, name)#
Bases:
WaveformGeneratorSpectrumWaveformGeneratorSpectrum-specific AWG implementation.Requires the Spectrum MATLAB driver (see vendor site) to be on MATLAB’s path. Implements device-specific connection (
connectSpec()), configuration (setSpec()), and upload sequencing (upload()).Workflow:
upload()→connectSpec()→setSpec()→ segment/sequence prep → program card → status check →closeSpec().Segment rules: All enabled channels must have equal segment counts; each segment must meet board minimum length and be padded to a multiple of 32 samples.
Scaling: Samples are mapped to 16-bit DAC range; amplitudes are validated against
OutputLimitconsideringOutputLoad.
Example:
awg = SpectrumDN2662_02("PCI::SPCM0", name="SpecAWG"); awg.SamplingRate = [1.25e9, 1.25e9]; awg.IsOutput = [true true]; % ... set awg.WaveformList per channel ... awg.upload();
- Constructor Summary
- SpectrumWaveformGenerator(resourceName, name)#
Construct a
SpectrumWaveformGenerator.- Parameters:
resourceName (
string) – Vendor-specific resource stringname (
string, optional) – Device nickname
- Property Summary
- Device#
- ErrorMap#
- RegMap#
- Method Summary
- check()#
Check Spectrum device status and sequence option presence.
- close()#
- closeSpec()#
Close the Spectrum device if connected.
- connect()#
No persistent session (Spectrum connects per-upload).
Spectrum AWG MATLAB driver requires closing/opening the card around uploads; use
connectSpec()withinupload().
- connectSpec()#
Initialize Spectrum maps and open the device.
Loads
RegMapandErrorMap, frees lingering sessions, and opens the card usingResourceName.- Raises:
error– If Spectrum MATLAB library is missing or card open fails
- set()#
Unused (Spectrum initializes per-upload).
- setSpec()#
Configure sampling rate, trigger, and enabled outputs for Spectrum device.
Sets card PLL to requested
SamplingRate(1), programs trigger source based onTriggerSource(1), and enables channels perIsOutput.- Raises:
error– On PLL setup failure or subsequent Spectrum errors
- upload()#
Upload waveforms as same-sized segments and sequence them (Spectrum requirement).
Channels must have identical segment counts; each segment stores samples for all enabled channels. Segments are padded to 32-sample boundaries and meet board minimums; scaling maps to 16-bit DAC.
- Raises:
error– On mismatched segment counts, segment size mismatch, output limit violations, or Spectrum driver errors
Set and connect obj.connectSpec;