Agilent Technologies E5071C Manual page 1073

Hide thumbs Also See for E5071C:
Table of Contents

Advertisement

E5071C
Handler Interface
Overview
Program Code
Other topics about Sample Programs
Overview
The sample program communicates with an external instrument through
the handler I/O port.
This program outputs 5 (sets bit 2 and bit 0 to Low, and the other bits to
High) to the port A of the handler I/O port, then waits until the bit 3 of the
port C is set to Low.
See Inputting/Outputting Data for this programming.
Program Code
Excel VBA
Sub Handler_Click()
Dim defrm As Long
Dim vi As Long
Dim Out_Data As Integer
Dim In_Data As Long
Dim Bit_stat As Integer
Dim Flag_bit As Integer
Dim Out_Data_Bin As String
Dim Ret As Long
Dim i As Long
Dim X As Long
Const TimeOutTime = 40000 'timeout time.
Out_Data_Bin = "00000101"
Flag_bit = 3
Call viOpenDefaultRM(defrm) 'Initializes the VISA system.
Call viOpen(defrm, "GPIB0::17::INSTR", 0, 0, vi) 'Opens the session to the specified instrument.
Call viSetAttribute(vi, VI_ATTR_TMO_VALUE, TimeOutTime) 'The state of an attribute for the
specified session.
Call viVPrintf(vi, "*RST" & vbLf, 0) 'Presets the setting state of the ENA.
Call viVPrintf(vi, "*CLS" & vbLf, 0) 'Clears the all status register.
1300
'Session to Default Resource Manager.
'Session to instrument.
'Decimal value.
'Return value.
'Store the output data on the port A (binaly).
'Bit location (bit 3).

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents