Numerical Methods

Outline

Introduction

Linear
Equations

Interpolation

Numerical
Solutions

Computer
Measurement

- PyVISA
- Establishing communication
Communicating with instruments

      

Communicating with instruments

Once communication has been established with an instrument, the basic commands to communicate with it are open(), write(), read(), query(), and close().

  • Resource.open(): Opens a session to the specified resource. For example,
        Keithley_3390 = rm.open_resource('USB::0x05E6::0x3390::1421720::INSTR')
    opens a sesssion to a Keithley 3390 Waveform Generator connected to the computer via USB.

  • Resource.write(): Pass a command to the resource. For example,
        Keithley_3390.write('APPL:SIN 6 KHZ, 2.0 VPP, -2.5 V')
    Sets the output of the waveform generator to a 6 kHz sine wave with a 2 V peak-to-peak amplitude and a dc offset of -2.5 V.
    Consult the manual of the instrument to see which commands it understands.

  • Resource.read(): Reads information from the resource, e.g. to get the data after a measurement was triggered by a command via write().

  • Resource.query(): Pass a command to the resource and returns its answer. (Basically read() and write() in combination.)

  • Resource.close() Closes the session and disconnects the device.

  • Resource.clear() Clears the buffer of the device.

Below are descriptions of instruments and of measurements which contain example Python scripts.