EasyManua.ls Logo

Agilent Technologies E5071C - Page 1073

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...
E5071C
1300
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 'Session to Default Resource Manager.
Dim vi As Long 'Session to instrument.
Dim Out_Data As Integer 'Decimal value.
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 'Return value.
Dim i As Long
Dim X As Long
Const TimeOutTime = 40000 'timeout time.
Out_Data_Bin = "00000101" 'Store the output data on the port A (binaly).
Flag_bit = 3 'Bit location (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.

Table of Contents