Programming Examples

9

'DIGITIZE command. Capture

'Analyze - Once the waveform has been captured, it can be analyzed.

'There are many parts of a waveform to analyze. This example shows

'some of the possible ways to analyze various parts of a waveform. Analyze

Exit Sub

VisaComError:

MsgBox "VISA COM Error:" + vbCrLf + Err.Description

End Sub

'

'Initialize

'-------------------------------------------------------------------

'Initialize will start the program with the oscilloscope in a known

'state. This is required because some uninitialized conditions could

'cause the program to fail or not perform as expected.

'

'In this example, we initialize the following:

'- Oscilloscope

'- Channel 1 range

'- Display Grid

'- Timebase reference, range, and delay

'- Trigger mode and type

'

'There are also some additional initialization commands, which are

'not used, but shown for reference.

'-------------------------------------------------------------------

Private Sub Initialize()

On Error GoTo VisaComError

'Clear the interface. myScope.IO.Clear

'RESET - This command puts the oscilloscope into a known state.

'This statement is very important for programs to work as expected.

'Most of the following initialization commands are initialized by

'*RST. It is not necessary to reinitialize them unless the default

'setting is not suitable for your application.

myScope.WriteString "*RST" ' Reset the oscilloscope to the defaults.

'AUTOSCALE - This command evaluates all the input signals and sets

'the correct conditions to display all of the active signals.

'Same as pressing the Autoscale key.

myScope.WriteString ":AUTOSCALE"

'CHANNEL_PROBE - Sets the probe attenuation factor for the selected

'channel. The probe attenuation factor may be set from 0.1 to 1000. myScope.WriteString ":CHAN1:PROBE 10" ' Set Probe to 10:1.

Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Reference

579

Page 579
Image 579
Agilent Technologies 5000 Series manual Programming Examples