Instrument Control Toolbox    

The Instrument Control Session


The instrument control session comprises all the steps you are likely to take when communicating with your instrument. These steps are:

  1. Create an instrument object - You create an instrument object using the gpib, visa, or serial creation functions.

    You can also configure properties during object creation. For example, you may want to configure properties associated with serial port communications such as the baud rate, the number of data bits, and so on.

  1. Connect to the instrument - You connect the object to the instrument using the fopen function.

    After the object is connected, you can read data, write data, or alter instrument settings by configuring property values.

  1. Configure properties - To establish the instrument object behavior, you assign values to properties using the set function or dot notation.

    In practice, you can configure many of the properties at any time including during - or just after - object creation. Conversely, depending on your instrument settings and the requirements of your application, you may be able to accept the default property values and skip this step.

  1. Write and read data - You can now write data to the instrument using the fprintf and fwrite function, and read data from the instrument using the fgetl, fgets, fread, fscanf, and readasync function.

    The instrument object behaves according to the previously configured or default property values.

  1. Disconnect and clean up - When you no longer need the object, you should disconnect it from the instrument using the fclose function, remove it from memory using the delete function, and remove it from the MATLAB workspace using the clear command.

The instrument control session is used in many of the documentation examples included in this guide.


 Using the Instrument Control Toolbox Creating an Instrument Object