Agilent Technologies E5071C Manual page 1074

Hide thumbs Also See for E5071C:
Table of Contents

Advertisement

Call viVPrintf(vi, ":CONT:HAND:C:MODE INP" & vbLf, 0)
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
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)
Call viClose(vi)
Call viClose(defrm)
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]
'Sets the decimal value.
'Checking the error.
'Closes the resource manager session.
'Breaks the communication and terminates the VISA system.
'Configures the port C to input port.
Programming
1301

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents