Range

Specify channel measurement range

Description

When working with the session-based interface, use the Range property to indicate the measurement range of a channel.

Values

Range is not applicable for counter channels. For analog channels, value is dependent on the measurement type. This property is read-only for all measurement types except 'Voltage'. You can specify a range in volts for analog channels.

Examples

Set Channel Range

Specify the range of an analog input voltage channel.

Create a session and add an analog input channel.

s = daq.createSession('ni');
ch = addAnalogInputChannel(s,'cDAQ1Mod7',3,'voltage');

Set a range of -60 to +60 volts.

ch.Range = [-60,60];

Display Ranges Available

See what ranges your channel supports before you set the channel range.

Create a session and add an analog input channel.

s = daq.createSession('ni');
ch = addAnalogInputChannel(s,'Dev1',3,'voltage');

Display channel device.

ch.Device
ans = 

ni: National Instruments USB-6211 (Device ID: 'Dev1')
   Analog input subsystem supports:
      4 ranges supported
      Rates from 0.1 to 250000.0 scans/sec
      16 channels ('ai0' - 'ai15')
      'Voltage' measurement type
   
   Analog output subsystem supports:
      -10 to +10 Volts range
      Rates from 0.1 to 250000.0 scans/sec
      2 channels ('ao0','ao1')
      'Voltage' measurement type
   
   Digital subsystem supports:
      8 channels ('port0/line0' - 'port1/line3')
      'InputOnly','OutputOnly' measurement types
   
   Counter input subsystem supports:
      Rates from 0.1 to 80000000.0 scans/sec
      2 channels ('ctr0','ctr1')
      'EdgeCount','PulseWidth','Frequency','Position' measurement types
   
   Counter output subsystem supports:
      Rates from 0.1 to 80000000.0 scans/sec
      2 channels ('ctr0','ctr1')
      'PulseGeneration' measurement type

Create a subsystems object.

sub = ch.Device.Subsystems
sub = 

Analog input subsystem supports:
   4 ranges supported
   Rates from 0.1 to 250000.0 scans/sec
   16 channels ('ai0' - 'ai15')
   'Voltage' measurement type
Properties, Methods, Events

Analog output subsystem supports:
   -10 to +10 Volts range
   Rates from 0.1 to 250000.0 scans/sec
   2 channels ('ao0','ao1')
   'Voltage' measurement type
Properties, Methods, Events

Digital subsystem supports:
   8 channels ('port0/line0' - 'port1/line3')
   'InputOnly','OutputOnly' measurement types
Properties, Methods, Events

Counter input subsystem supports:
   Rates from 0.1 to 80000000.0 scans/sec
   2 channels ('ctr0','ctr1')
   'EdgeCount','PulseWidth','Frequency','Position' measurement types
Properties, Methods, Events

Counter output subsystem supports:
   Rates from 0.1 to 80000000.0 scans/sec
   2 channels ('ctr0','ctr1')
   'PulseGeneration' measurement type
Properties, Methods, Events

Display the ranges available on the analog input subsystem.

sub(1).RangesAvailable
ans = 

-0.20 to +0.20 Volts,-1.0 to +1.0 Volts,-5.0 to +5.0 Volts,-10 to +10 Volts