Instrument Control Toolbox    

Example: Parsing Input Data Using scanstr

This example illustrates how to use the scanstr function to parse data that you read from a Tektronix TDS 210 oscilloscope. scanstr is particularly useful when you want to parse a string into one or more cell array elements, where each element is determined to be either a double or a string.

  1. Create an instrument object -- Create the GPIB object g associated with a National Instruments GPIB controller with board index 0, and an instrument with primary address 1.
  2. Connect to the instrument -- Connect g to the oscilloscope.
  3. Write and read data -- Return identification information to separate elements of a cell array using the default delimiters.
  4. Disconnect and clean up -- When you no longer need g, you should disconnect it from the instrument, and remove it from memory and from the MATLAB workspace.

  Example: Reading Binary Data Example: Understanding EOI and EOS