Instrument Control Toolbox |
 |
The propinfo Function
You can use the propinfo
function to return the characteristics of Instrument Control 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.
Field Name
|
Description
|
Type
|
The property data type. Possible values are action , any , double , string , and struct .
|
Constraint
|
The type of constraint on the property value. Possible values are action , 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
|
The condition under which a property is read only. Possible values are always , never , whileOpen , and whileRecording .
|
Interface Specific
|
If the property is interface-specific, a 1 is returned. If a 0 is returned, the property is supported for all interfaces.
|
For example, to display the property characteristics for the EOIMode
property associated with the GPIB object g
g = gpib('ni',0,1);
EOIinfo = propinfo(g,'EOIMode')
EOIinfo =
Type: 'string'
Constraint: 'enum'
ConstraintValue: {2x1 cell}
DefaultValue: 'on'
ReadOnly: 'never'
InterfaceSpecific: 1
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 two possible property values
- The default value is
on
- The property can be configured at any time (it is never read only)
- The property is not supported for all interfaces.
To display the property value constraints
EOIinfo.ConstraintValue
ans =
'on'
'off'
| The instrhelp Function | | Using the Instrument Control Toolbox |  |