EasyManua.ls Logo

Agilent Technologies E5071C - Page 1074

Agilent Technologies E5071C
2685 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming
1301
Call viVPrintf(vi, ":CONT:HAND:C:MODE INP" & vbLf, 0) 'Configures the port C to input port.
Call viVPrintf(vi, ":CONT:HAND:IND:STAT ON" & vbLf, 0) 'Line enable /INDEX signal.
Call viVPrintf(vi, ":CONT:HAND:RTR:STAT ON" & vbLf, 0) 'Line enable /READY FOR TRIGGER
signal.
For i = 1 To Len(Out_Data_Bin) 'Convert Out_Dara_Bin to a decimal value.
If Mid(Out_Data_Bin, Len(Out_Data_Bin) - i + 1, 1) = "1" Then
X = 2 ^ (i - 1)
Ret = Ret + X
End If
Next i
Out_Data = Ret 'Sets the decimal value.
Call viVPrintf(vi, ":CONT:HAND:A " & Ret & vbLf, 0) 'Sets to the port A.
Call viVPrintf(vi, ":CONT:HAND:C?" & vbLf, 0) 'Outputs data to output port C.
Call viVScanf(vi, "%t", In_Data) 'Reads data from the port C.
Call ErrorCheck(vi) 'Checking the error.
Call viClose(vi) 'Closes the resource manager session.
Call viClose(defrm) 'Breaks the communication and terminates the VISA system.
End
End Sub
Sub ErrorCheck(vi As Long)
Dim err As String * 50, ErrNo As Variant, Response
Call viVQueryf(vi, ":SYST:ERR?" & vbLf, "%t", err) 'Reads error message.
ErrNo = Split(err, ",") 'Gets the error code.
If Val(ErrNo(0)) <> 0 Then
Response = MsgBox(CStr(ErrNo(1)), vbOKOnly) 'Display the message box.
End If
End Sub
HT Basic (handler.htb)
10 INTEGER Out_data,In_data,Bit_stat
20 DIM Out_data_bin$[9]

Table of Contents