setverify - Configure and return specified property

Syntax

Actual = setverify(obj,'PropertyName',PropertyValue)
Actual = setverify(obj.Channel(index),'PropertyName',PropertyValue)
Actual = setverify(obj.Line(index),'PropertyName',PropertyValue)

Arguments

obj

A device object or array of device objects.

'PropertyName'

A property name.

PropertyValue

A property value.

obj.Channel(index)

One or more channels contained by obj.

obj.Line(index)

One or more lines contained by obj.

Actual

The actual value for the specified property.

Description

Actual = setverify(obj,'PropertyName',PropertyValue) sets PropertyName to PropertyValue for obj, and returns the actual property value to Actual.

Actual = setverify(obj.Channel(index),'PropertyName',PropertyValue) sets PropertyName to PropertyValue for the channels specified by index, and returns the actual property value to Actual.

Actual = setverify(obj.Line(index),'PropertyName',PropertyValue) sets PropertyName to PropertyValue for the lines specified by index, and returns the actual property value to Actual.

Remarks

setverify is equivalent to the commands

set(obj,'PropertyName',PropertyValue)
Actual = get(obj,'PropertyName')

Using setverify is not required for setting property values, but it does provide a convenient way to verify the actual property value set by the data acquisition engine.

setverify is particularly useful when setting the SampleRate, InputRange, and OutputRange properties because these properties can only be set to specific values accepted by the hardware. You can use the propinfo function to obtain information about the valid values for these properties.

If a property value is specified but does not match a valid value, then

Examples

Create the analog input object ai for a National Instruments® AT-MIO-16DE-10 board, add eight hardware channels to it, and set the sample rate to 10,000 Hz using setverify.

ai = analoginput('nidaq','Dev1');
ch = addchannel(ai,0:7);
ActualRate = setverify(ai,'SampleRate',10000);

Suppose you use setverify to set the input range for all channels contained by ai to -8 to 8 volts.

ActualInputRange = setverify(ai.Channel,'InputRange',[-8 8]);

The InputRange value was actually rounded up to -10 to 10 volts.

ActualInputRange{1}
ans =
   -10    10

See Also

Functions

get, propinfo, set

Properties

InputRange, OutputRange, SampleRate

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS