Data Acquisition Toolbox |
 |
The propinfo Function
You can use the propinfo
function to return the characteristics of Data Acquisition Toolbox properties. For example, you can find the default value for any property using this function. propinfo
returns a structure containing the fields shown below.
Table 2-2: propinfo Fields
Field Name
|
Description
|
Type
|
The property data type. Possible values are action function , any , double , and string .
|
Constraint
|
The type of constraint on the property value. Possible values are action function , bounded , enum , and none .
|
ConstraintValue
|
The property value constraint. The constraint can be a range of valid values or a list of valid string values.
|
DefaultValue
|
The property default value.
|
ReadOnly
|
If the property is read-only, a 1 is returned. Otherwise, a 0 is returned.
|
ReadOnlyRunning
|
If the property is read-only while the device object is running, a 1 is returned. Otherwise, a 0 is returned.
|
DeviceSpecific
|
If the property is device-specific, a 1 is returned. If a 0 is returned, the property is supported for all device objects of a given type.
|
For example, to return the characteristics for all the properties associated with the analog input object ai
created in the preceding section
AIinfo = propinfo(ai);
The characteristics for the TriggerType
property are displayed below.
AIinfo.TriggerType
ans =
Type: 'string'
Constraint: 'Enum'
ConstraintValue: {3x1 cell}
DefaultValue: 'Immediate'
ReadOnly: 0
ReadOnlyRunning: 1
DeviceSpecific: 0
This information tells you that:
- The property value data type is a string.
- The property value is constrained as an enumerated list of values.
- There are three possible property values.
- The default value is
Immediate
.
- The property is not read-only.
- You cannot configure the property while the device object is running.
- The property is supported for all analog input objects.
To display the property value constraints
AIinfo.TriggerType.ConstraintValue
ans =
'Manual'
'Immediate'
'Software'
| The daqhelp Function | | Using the Data Acquisition Toolbox |  |