5-62
Remote Operation
Example Programs
Set oBinCnvrtBench = New clsStopWatch
Set oAscTraceBench = New clsStopWatch
Set oAscCnvrtBench = New clsStopWatch
’-- Call function to initialize a VISA session to the WDCA
Status = InitVISASession(txtGPIB_IN.Text, txtGPIB_PA.Text, DefRM, DevSessionNum, ErrMsg)
If Status <> 0 Or ErrMsg <> "" Then GoTo ErrorHandler
’-- Set Center Wavelength
Status = viVPrintf(DevSessionNum, "SENS:WAV:CENT " & Val(txtCWL.Text) & "nm" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
’-- Set number of points for WDCA to acquire during sweep
Status = viVPrintf(DevSessionNum, "SENS:SWE:POIN " & CInt(txtNumPoints.Text) & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
’-- Set Span
Status = viVPrintf(DevSessionNum, "SENS:WAV:SPAN " & Val(txtSpan.Text) & "nm" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
’-- Set sensitivity
If chkSensitivityLock.Value = 0 Then
’-- Unlock Sensitivity
Status = viVPrintf(DevSessionNum, "SENS:POW:DC:RANG:LOW:AUTO OFF" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
’-- Set Sensitivity
Status = viVPrintf(DevSessionNum, "SENS:POW:DC:RANG:LOW " & Val(txtSensitivity.Text) & _
Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
Else
’-- Lock Sensitivity
Status = viVPrintf(DevSessionNum, "SENS:POW:DC:RANG:LOW:AUTO ON" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
End If
’-- Sweep Mode
Status = viVPrintf(DevSessionNum, "SENS:SWE:SPE " & cmbSweepMode.Text & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
’-- Trace settings
’-- Attach trace to input
Status = viVPrintf(DevSessionNum, "TRAC:FEED:INP " & cmbTrace.Text & "," & cmbChannel.Text & _
Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
’-- Turn trace update on
Status = viVPrintf(DevSessionNum, "TRAC:FEED:CONT " & cmbTrace.Text & ",ALW" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
’-- Make trace visible on the display
Status = viVPrintf(DevSessionNum, "DISP:WIND:TRAC:STAT " & cmbTrace.Text & ",1" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com