Hi
I have been playing around with the code but it isn't working. I don't appear to have comms with the meter.
# HP 3478A Multimeter simple read test
import pyvisa
print("Simple GPIB test for HP3478A multimeter")
print("Show the list of Resources")
rm = pyvisa.ResourceManager()
print(rm.list_resources())
# ID string for adapter 0: 'USB0::0x03EB::0x2065::GPIB_23_24238323232351C01171::INSTR'
print("Opening the Meter")
# Resource = GPIB-usb adapter 0. Different for each adapter.
multimeter = rm.open_resource('USB0::0x03EB::0x2065::GPIB_23_24238323232351C01171::INSTR')
# Write some text to display
multimeter.write('D2OK GPIB USB')
# Set function to DC volts (F1), auto-range (RA), trigger hold (T4), 4.5 digit (N4), auto-zero (Z1), internal trigger (T1)
multimeter.write('H1T1')
print("Reading the DC volts")
try:
while True:
print(float(multimeter.read().strip()))
except KeyboardInterrupt:
multimeter.clear()
multimeter.close()
rm.close()
I usually add a lot of print statements to see what is working, and what isn't.
It isn't.
I get the following error messages:
>python gpib_test.py
Simple GPIB test for HP3478A multimeter
Show the list of Resources
('USB0::0x03EB::0x2065::GPIB_23_24238323232351C01171::INSTR', 'ASRL1::INSTR')
Opening the Meter
Traceback (most recent call last):
File "D:\gpib_test.py", line 19, in <module>
multimeter.write('H1T1')
...
If the resource string is from the instrument and not the adapter, then the adapter must have comms with the instrument.
The "D2" command just writes a string to the display, but that is not happening.
The "H1T1" puts the meter into DC mode, continuous internal trigger, but it isn't.
That indicates I may have a hardware fault either in the instrument, or in the adapter.
R&S Tester does not find the usb-gpib adapter resource. I am not sure if installing NI-visa or py-visa has over-written something that R&S needs.