Programming
1305
X = 2 ^ (i - 1)
Data_Dec = Data_Dec + X
End If
Next i
Call viVPrintf(vi, ":SENS:MULT:OUTP " & CStr(Data_Dec) & vbLf, 0) 'Sets the control line.
Call viVPrintf(vi, ":SENS:MULT:DISP ON" & vbLf, 0) 'Turns on the E5091A property
display.
Call viVPrintf(vi, ":SENS:MULT:STAT ON" & vbLf, 0) 'Turns on the control of the
E5091A.
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
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
Sample Program in HT Basic (e5091ctr_2.htb)
10 DIM Port1$[3],Port2$[3],Port3$[3],Port4$[3],Data_bin$[9]
20 DIM Line1$[3],Line2$[3],Line3$[3],Line4$[3]
30 DIM Line5$[3],Line6$[3],Line7$[3],Line8$[3]
40 DIM Model$[8]
50 INTEGER Data_dec
60 !
70 ASSIGN @Agte507x TO 717
80 !