Data Acquisition Toolbox
  Function/Property:
    Search    Help Desk 

Setting Property Values

As discussed in "Property Names and Property Values" in Chapter 2, the Data Acquisition Toolbox supports two basic types of properties: base properties and device-specific properties. Base properties apply to all supported hardware devices while device-specific properties are incorporated into the toolbox on a per-device basis. For analog input objects, the base properties are divided into two groups: common properties and channel properties. Common properties apply to all channels in a channel group while channel properties apply on a per-channel basis.

You can set property values for the device object or one or more channels using the set command or subscripted assignment. For channels, you can use the set command to assign multiple property values for multiple channels. This feature is discussed below.

Setting Multiple Property Values for Multiple Channels

Using the set command, you can assign different values for multiple properties and multiple channels.

where:

Using this syntax, each row of V1 corresponds to a different channel, each column of V1 corresponds to a different property, and Vmn is the value to set for property n of channel m.

For example, suppose you create the analog input object AI for a sound card, and configure it for stereo operation. The code shown below illustrates how you can assign a different value to the SensorRange and ChannelName properties for each channel using a single call to set.

Alternatively, you can set these property values one channel at a time

or one channel and one property at a time.

Note:
You cannot set multiple property values with one call using subscripted assignments.



[ Previous | Help Desk | Next ]