Documentation

Generate and Acquire Signals with ADALM1000

Updated Function Syntax

To accommodate the ADALM1000, the following Data Acquisition Toolbox™ functions have been updated with new argument options:

Source Voltage and Measure Current

This example shows how to source a voltage while measuring current on the same channel to calculate load resistance. First program the ADALM1000 to provide a constant 5 V supply to the load, and then measure the current on the same device channel.

Set up a Data Acquisition Toolbox session to operate the ADALM100.

s = daq.createSession('adi');

Define an analog output channel in the session to source voltage from device channel A.

addAnalogOutputChannel(s,'SMU1','A','Voltage');

Define an analog input channel in the session to measure current on that same device channel A.

addAnalogInputChannel(s,'SMU1','A','Current');

Generate an output voltage, and measure the current.

V_load = 5;
outputSingleScan(s,V_load);
I_load = inputSingleScan(s);
outputSingleScan(s,0);  % Reset device output.
R_load = V_load/I_load
R_load =

   50.3005

Note

The ADALM1000 continues to generate the last value programmed until you release the session. When you are finished with your signals, reset the device to output 0 volts.

For more information and complete workflows with the ADALM1000, see Data Acquisition Toolbox Support Package for Analog Devices ADALM1000 Examples.

Generate a Pulse

This example shows how to generate a 1-millisecond, 5-volt pulse, surrounded on either side by 10 milliseconds at 0 volts.

pdata = zeros(2100,1); % Column vector of 2100 samples.
pdata (1001:1100) = 5; % Pulse in middle of vector.

s = daq.createSession('adi');
addAnalogOutputChannel(s,'SMU1','B','Voltage');

queueOutputData(s,pdata);
s   % View channel configuration and scan settings.
s = 

Data acquisition session using Analog Devices Inc. hardware:
   Will run for 2100 scans (0.021 seconds) at 100000 scans/second.
   Number of channels: 1
      index Type Device Channel   MeasurementType        Range      Name
      ----- ---- ------ ------- ------------------- --------------- ----
      1     ao   SMU1   B       Voltage (SingleEnd) 0 to +5.0 Volts
startForeground(s);

Generate Waveforms

This example shows how to simultaneously generate a 1-kHz square wave on channel A, and a 100-Hz sine wave on channel B. Each output lasts for 5 seconds.

The example requires two session channels for device channels A and B, both as output channels for voltage.

s = daq.createSession('adi');
addAnalogOutputChannel(s,'SMU1','A','Voltage');
addAnalogOutputChannel(s,'SMU1','B','Voltage');

Define the two waveforms.

Sq = zeros(500000,1); % 500k sample column vectors
Sw = zeros(500000,1);

% Define square wave:
for r = 1:100:499900;
    Sq(r:r+49) = 5;  % Set first 50 of each 100 samples to 5 v.
end

% Define sine wave:
for a = 1:500000
    Sw(a) = sin(a*2*pi/1000);
end
Sw = Sw + 1;  % Shift for positive voltage output

queueOutputData(s,[Sq Sw])
s   % View channel configuration and scan settings.
s = 

Data acquisition session using Analog Devices Inc. hardware:
   Will run for 500000 scans (5 seconds) at 100000 scans/second.
   Number of channels: 2
      index Type Device Channel   MeasurementType        Range      Name
      ----- ---- ------ ------- ------------------- --------------- ----
      1     ao   SMU1   A       Voltage (SingleEnd) 0 to +5.0 Volts
      2     ao   SMU1   B       Voltage (SingleEnd) 0 to +5.0 Volts

Start generation that lasts for 5 seconds.

startForeground(s); 

Limitations and Restrictions

The following restrictions and limitation apply when controlling the Analog Devices® ADALM1000 with Data Acquisition Toolbox. Some are restrictions of the hardware, some are restrictions imposed by Data Acquisition Toolbox.

  • You cannot add channels from multiple ADALM1000 modules in the same Data Acquisition Toolbox session object. To recover from attempting this, you might need to execute daqreset.

  • You cannot simultaneously source and measure voltage on the same channel, nor simultaneously source and measure current on the same channel.

  • You cannot execute a single-scan operation that performs both source and measurement simultaneously.

  • You cannot use AC coupling, nor differential terminal configurations.

  • You cannot use triggers or digital pins.

  • You cannot measure current without generating an output voltage.

  • When specified output ranges are exceeded, the device might reset itself. Any measurements taken during this time might be unreliable until the reset is complete.

Not all data acquisition session background operations are supported in this version of the ADALM support package. Use foreground operation for full generation and acquisition functionality.

Related Topics

External Websites