| Data Acquisition Toolbox | Search  Help Desk |
| setverify | Examples See Also |
Set and return the specified property value.
Syntax
Actual = setverify(obj, 'Property', Value)
Actual = setverify(obj.Channel(index), 'Property', Value)
Description
Actual = setverify(obj, 'Property', Value) sets Property to Value for obj and returns the actual property value to Actual.
Actual = setverify(obj.Channel(index), 'Property', Value) sets Property to Value for the channels specified by index and returns the actual property value to Actual.
setverify is equivalent to the commands
set(obj, 'Property', Value) Actual = get(obj, 'Property')and is particularly useful when setting the
SampleRate, InputRange, and OutputRange properties since these properties can only be set to 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 the closest supported value is automatically selected. If you try to set SampleRate to a value outside the range of supported values, then an error is returned and the current SampleRate value is unchanged.
Although using setverify is not required for setting property values, it does provide a convenient way to verify the actual property value set by the data acquisition engine.
Example
Sound Card
Suppose you create the analog input objectai for a sound card and add one channel to it.
To set the input range to -1 to 1 voltsai = analoginput('winsound')ch = addchannel(ai, 1)
Actual = setverify(ai.Channel(1), 'InputRange', [-1 1])
National Instruments
Suppose you create the analog input objectai 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.
Suppose you useai = analoginput('nidaq', 1)ch = addchannel(ai, 0:7)setverify(ai, 'SampleRate', 10000)
setverify to set the input range for all channels contained by ai to -8 to 8 volts.
Actual = setverify(ai.Channel, 'InputRange', [-8 8])
InputRange was actually set to -10 to 10 volts, which is the closest valid value.
See Also
Functions
get, propinfo, set
Properties
InputRange, OutputRange, SampleRate