283
Chapter 6 Application Programs
Example: Microsoft Visual Basic for Windows
4
6
’
’ AM Modulation
’
Arb.Output "OUTPut:LOAD INFinity" ’ Configure for Hi Z load
Arb.Output "APPLy:SINusoid 1e6,1,0" ’ 1MHz Sine, 1Vpp, 0Vdc offset
Arb.Output "AM:INTernal:FUNCtion RAMP" ’ Modulating signal: Ramp
Arb.Output "AM:INTernal:FREQuency 10e3" ’ Modulating frequency: 10kHz
Arb.Output "AM:DEPTh 80" ’ Modulating depth: 80%
Arb.Output "AM:STATe ON" ’ Turn ON AM modulation
Check_Errors ’ Routine checks for errors
MsgBox "AM Modulation", vbOKOnly, "33250A Example"
Arb.Output "AM:STATe OFF" ’ Turn OFF AM modulation
’
’ FM Modulation
’
Arb.Output "outp:load 50" ’ Configure for 50 ohm load
Arb.Output "appl:sin 20e3,1,0" ’ 20kHz Sine, 1Vpp, 0Vdc Offset
Arb.Output "fm:dev 20e3" ’ FM deviation: 20kHz
Arb.Output "fm:int:freq 1000" ’ FM Modulating Freq: 1kHz
Arb.Output "fm:stat on" ’ Turn ON FM modulation
Check_Errors ’ Routine checks for errors
MsgBox "FM Modulation", vbOKOnly, "33250A Example"
Arb.Output "fm:stat off" ’ Turn OFF FM modulation
’
’ Linear Sweep
’
Arb.Output "sweep:time 1" ’ 1 second sweep time
Arb.Output "freq:start 100" ’ Start frequency: 100Hz
Arb.Output "freq:stop 20000" ’ Stop frequency: 20kHz
Arb.Output "sweep:stat on" ’ Turn ON sweeping
Check_Errors ’ Routine checks for errors
MsgBox "Linear Sweep", vbOKOnly, "33250A Example"
Arb.Output "sweep:stat off" ’ Turn OFF sweeping
’
’ Pulse Waveform with variable Edge Times
’
Arb.Output "output:state off" ’ Disable Output BNC
Arb.Output "volt:low 0;:volt:high 0.75" ’ Low = 0V, High = 0.75V
Arb.Output "pulse:period 1e-3" ’ 1ms intervals
Arb.Output "pulse:width 100e-6" ’ 100us pulse width
Arb.Output "pulse:tran 10e-6" ’ Edge time 10us
Arb.Output "func pulse" ’ Select Function Pulse
Arb.Output "output:state on" ’ Enable Output BNC
For i = 1 To 20 ’ Vary edge by 1usec steps
Arb.Output "puls:tran " & (0.00001 + i * 0.000001)
Sleep 300 ’ Wait 300msec
Next i
Check_Errors ’ Routine checks for errors
MsgBox "Pulse Waveform with variable Edge Times", vbOKOnly, "33250A Example"
Continued...