Instrument Control Toolbox | ![]() ![]() |
Returning Property Names and Property Values
Once the instrument object is created, you can use the set
function to return all configurable properties to a variable or to the command line. Additionally, if a property has a finite set of string values, then set
also returns these values.
For example, the configurable properties for the GPIB object g
are shown below. The base properties are listed first, followed by the GPIB-specific properties.
g = gpib('ni',0,1); set(g) ByteOrder: [ {littleEndian} | bigEndian ] BytesAvailableFcn BytesAvailableFcnCount BytesAvailableFcnMode: [ {eosCharCode} | byte ] ErrorFcn InputBufferSize Name OutputBufferSize OutputEmptyFcn RecordDetail: [ {compact} | verbose ] RecordMode: [ {overwrite} | append | index ] RecordName Tag Timeout TimerFcn TimerPeriod UserData GPIB specific properties: BoardIndex CompareBits EOIMode: [ {on} | off ] EOSCharCode EOSMode: [ {none} | read | write | read&write ] PrimaryAddress SecondaryAddress
You can use the get
function to return one or more properties and their current values to a variable or to the command line.
For example, all the properties and their current values for the GPIB object g
are shown below. The base properties are listed first, followed by the GPIB-specific properties.
get(g) ByteOrder = littleEndian BytesAvailable = 0 BytesAvailableFcn = BytesAvailableFcnCount = 48 BytesAvailableFcnMode = eosCharCode BytesToOutput = 0 ErrorFcn = InputBufferSize = 512 Name = GPIB0-1 OutputBufferSize = 512 OutputEmptyFcn = RecordDetail = compact RecordMode = overwrite RecordName = record.txt RecordStatus = off Status = closed Tag = Timeout = 10 TimerFcn = TimerPeriod = 1 TransferStatus = idle Type = gpib UserData = [] ValuesReceived = 0 ValuesSent = 0 GPIB specific properties: BoardIndex = 0 BusManagementStatus = [1x1 struct] CompareBits = 8 EOIMode = on EOSCharCode = LF EOSMode = none HandshakeStatus = [1x1 struct] PrimaryAddress = 1 SecondaryAddress = 0
To display the current value for one property, you supply the property name to get
.
To display the current values for multiple properties, you include the property names as elements of a cell array.
You can also use the dot notation to display a single property value.
![]() | Configuring and Returning Properties | Configuring Property Values | ![]() |