Initialization, Error, And Functions For Execution - YOKOGAWA wt1600 User Manual

Digital power meter
Hide thumbs Also See for wt1600:
Table of Contents

Advertisement

7.3
Initialization, Error, and Functions for
Execution
----------------------------------------------------------------------------------------
Option Explicit
Dim StartFlag As Integer
Dim addr As Integer
Dim Timeout As Integer
Dim Dev As Integer
Dim term As String
Dim Query(1100) As String
Dim Dummy As Integer
----------------------------------------------------------------------------------------
Private Function InitGpib() As Integer
Dim eos As Integer
Dim eot As Integer
Dim brd As Integer
Dim sts As Integer
eos = &HC0A
eot = 1
term = Chr(10)
Timeout = T10s
brd = ilfind("GPIB0")
If (brd < 0) Then
End If
Dev = ildev(0, addr, 0, Timeout, eot, eos)
If (Dev < 0) Then
End If
sts = ilsic(brd)
If (sts < 0) Then
End If
InitGpib = 0
End Function
----------------------------------------------------------------------------------------
Private Sub DisplayGPIBError(ByVal sts As Integer, ByVal msg As String)
Dim wrn As String
Dim ers As String
Dim ern As Integer
If (sts And TIMO) Then
Else
End If
If (sts And EERR) Then
IM 760101-11E
Call DisplayGPIBError(brd, "ilfind")
InitGpib = 1
Exit Function
Call DisplayGPIBError(Dev, "ildev")
InitGpib = 1
Exit Function
Call DisplayGPIBError(sts, "ilsic")
InitGpib = 1
Exit Function
wrn = "Time out" + Chr(13)
wrn = ""
ern = iberr
If (ern = EDVR) Then
ers = "EDVR:System error"
ElseIf (ern = ECIC) Then
ers = "ECIC:Function requires GPIB board to be CIC"
ElseIf (ern = ENOL) Then
ers = "ENOL:No Listeners on the GPIB"
ElseIf (ern = EADR) Then
ers = "EADR:GPIB board not addressed correctly"
ElseIf (ern = EARG) Then
ers = "EARG:Invalid argument to function call"
ElseIf (ern = ESAC) Then
ers = "ESAC:GPIB board not System Controller as required"
ElseIf (ern = EABO) Then
ers = "EABO:I/O operation aborted(timeout)"
ElseIf (ern = ENEB) Then
ers = "ENEB:Nonexistent GPIB board"
ElseIf (ern = EDMA) Then
ers = "EDMA:DMA error"
ElseIf (ern = EOIP) Then
ers = "EOIP:I/O operation started before previous operation completed"
ElseIf (ern = ECAP) Then
ers = "ECAP:No capability for intended operation"
ElseIf (ern = EFSO) Then
ers = "EFSO:File system operation error"
ElseIf (ern = EBUS) Then
ers = "EBUS:GPIB bus error"
ElseIf (ern = ESTB) Then
ers = "ESTB:Serial poll status byte queue overflow"
ElseIf (ern = ESRQ) Then
ers = "ESRQ:SRQ remains asserted"
'Start Flag
'GPIB Address
'Timeout
'Device ID(GPIB)
'Terminator
'Query String
'EOS
'EOI
'GPIB Board ID
'Terminator = LF
'EOI = Enable
'Timeout = 10s
'Set IFC
7
7-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents