With interface-based communication, there are common steps that comprise the basic workflow. Create an object of the interface type you are using to connect to the instrument. Setting properties is optional, but common. You read and write data, then clean up to disconnect.
|Create I2C object|
|Create SPI object|
|Create MODBUS object|
|Create TCP/IP client connection with TCP/IP server|
|Create TCP/IP server|
|Connect to UDP socket|
|Connection to serial port|
|Create GPIB object|
|Create connection to device using VISA|
|Disconnect interface object from instrument|
|Connect interface object to instrument|
|Write text to instrument|
|Read binary data from instrument|
|Read data from instrument, and format as text|
|Write binary data to instrument|
|Read data asynchronously from instrument|
|Stop asynchronous read and write operations|
|Read binblock data from instrument|
|Write binblock data to instrument|
|Remove data from input buffer|
|Remove data from output buffer|
|Instrument object properties|
|Configure or display instrument object properties|
|Instrument object property information|
|Display instrument object summary information|
|Information about available hardware|
|Disconnect and delete all instrument objects|
|Remove instrument objects from MATLAB workspace|
|Remove instrument objects from memory|
|Read line of text from instrument and discard terminator|
|Read line of text from instrument and include terminator|
|Open Property Inspector|
|Display event information when event occurs|
|Read instrument objects from memory to MATLAB workspace|
|Find visible and hidden instrument objects|
|Help for instrument object type, function, or property|
|Define and retrieve commands that identify instruments|
|Define notification for instrument events|
|Determine whether instrument objects are valid|
|Length of instrument object array|
|Load instrument objects and variables into MATLAB workspace|
|Class method names and descriptions|
|Convert instrument object to MATLAB code|
|Write text to instrument, and read data from instrument|
|Record data and event information to file|
|Save instrument objects and variables to MAT-file|
|Read data from instrument, format as text, and parse|
|Size of instrument object array|
|Test and Measurement Tool||Control oscilloscopes and other instruments|
You need to create a MATLAB® object that represents the instrument to communicate with the instrument.
Before you can use the instrument object to write or read data, you must connect it to the instrument whose address or port is specified in the creation function.
You can configure the instrument object behavior by assigning values to properties.
You can write text or binary data to the instrument and read text or binary data from the instrument.
You can use SCPI commands with the Instrument Control Toolbox™ and the MATLAB programming environment to control multiple instruments using similar functions.
Disconnect the object from the instrument, and remove the object from memory and from the workspace.