EEVblog Electronics Community Forum

Products => Test Equipment => Topic started by: kj7e on May 03, 2018, 05:10:34 am

Title: HP 3456A gpib comand fun
Post by: kj7e on May 03, 2018, 05:10:34 am
Okay, just found my new favorite thing for the evening.  Playing with gpib commands for the first time really, found the cheat sheet for the 3456A and it works.  Going to write a script to do some logging with it tomorrow.  Just cause this is fun.

https://youtu.be/qZDShxF3dwM
Title: Re: HP 3456A gpib comand fun
Post by: kj7e on May 04, 2018, 01:30:49 am
Okay, first script, resets the meter and reads the output as fast as it can send it.

https://youtu.be/HWX6oFdah5s


Not the exact code I show in the video, only doing a reset 'H' below, resets to the default 10NPLC, DCV, Auto range, Auto Zero;

Code: [Select]
import visa
rm = visa.ResourceManager()
dvm = rm.open_resource('GPIB0::22::INSTR')

dvm.write('H')

try:
    while True:
        print(dvm.read('V'))
except KeyboardInterrupt:
    print('Manual break by user')
Title: Re: HP 3456A gpib comand fun
Post by: TiN on May 04, 2018, 04:32:23 am
Finally :) Dat Keithley 2030 is just made obsolete.
After spending some time with GPIB, you will find using buttons on meter somewhat non-convenient.  ;)
Title: Re: HP 3456A gpib comand fun
Post by: kj7e on May 04, 2018, 04:43:01 am
Been off work the last two weeks recovering (4 cracked ribs, broken clavicle and a few other issues), still cant sit in a chair very long, cant type much yet without getting really sore.  So just board and having fun trying to stay entertained.  Love playing with the old 3456A, what a great toy.  Now I have it reading back data I can log it and do anything I want with it.  Ill work on the Keithley and other gear later, still being a kid with the old HP.

Need to figure out how to make impressive plots like you do.
Title: Re: HP 3456A gpib comand fun
Post by: kj7e on May 06, 2018, 11:08:31 pm
Final part3, dynamic reading update while the script is running, log formatting and making a simple plot.  Don't think I'm going to do much more with the 3456A, this was just a starter exercise, started playing with Python and TSP commands on the DMM7510 last night.

https://youtu.be/ASu6DuDdVmA

Code: [Select]
# Stewart Labs HP 3456A PyVisa logging script

# Logging
import logging
logging.basicConfig(level=logging.INFO,
                    format='%(asctime)s.%(msecs)03d , %(message)s',
                    datefmt='%Y/%m/%d %H:%M:%S',
                    filename='3456A_test_log.txt')

# Visa
import visa
rm = visa.ResourceManager()
dvm = rm.open_resource('GPIB0::22::INSTR')
#del dvm.timeout

# Instrument Config
dvm.write('H6STG')

# Clear Screen
import os
os.system('cls')
print('***Logging started - CTL+C to STOP\nSee 3456A_test_log.txt for data\n\nCurrent reading')
count = 1

# Query Loop
try:
    while True:
        mes = dvm.query('V')
        red = mes.strip('\n')
        logging.info(red)
        print("#", count, "=", red, end='', flush=True)
        count += 1
except KeyboardInterrupt:
    print('*** Manual break by user***\nClosing log & reseting DMV\n')
    dvm.write('H6STG')
Title: Re: HP 3456A gpib comand fun
Post by: denimdragon on July 11, 2018, 04:22:28 am
Final part3, dynamic reading update while the script is running, log formatting and making a simple plot.  Don't think I'm going to do much more with the 3456A, this was just a starter exercise, started playing with Python and TSP commands on the DMM7510 last night.

https://youtu.be/ASu6DuDdVmA

Code: [Select]
# Stewart Labs HP 3456A PyVisa logging script

# Logging
import logging
logging.basicConfig(level=logging.INFO,
                    format='%(asctime)s.%(msecs)03d , %(message)s',
                    datefmt='%Y/%m/%d %H:%M:%S',
                    filename='3456A_test_log.txt')

# Visa
import visa
rm = visa.ResourceManager()
dvm = rm.open_resource('GPIB0::22::INSTR')
#del dvm.timeout

# Instrument Config
dvm.write('H6STG')

# Clear Screen
import os
os.system('cls')
print('***Logging started - CTL+C to STOP\nSee 3456A_test_log.txt for data\n\nCurrent reading')
count = 1

# Query Loop
try:
    while True:
        mes = dvm.query('V')
        red = mes.strip('\n')
        logging.info(red)
        print("#", count, "=", red, end='', flush=True)
        count += 1
except KeyboardInterrupt:
    print('*** Manual break by user***\nClosing log & reseting DMV\n')
    dvm.write('H6STG')

Awesome script  :-+ I have a 3456A and I'm working on using it for data logging. I'll have to give this a try, but I'm using Prologix GPIB-Ethernet Controller. I'll see what I can pull off with this. Thanks!
Title: Re: HP 3456A gpib comand fun
Post by: bitseeker on July 12, 2018, 12:51:54 am
kj7e, nice job with the scripting. I'll have to try some Python with my gear, too. Most of the logging I've done so far has been with BenchView. Note that "DMV" in your manual break message is probably intended to be "DVM." (Although, it would be nice to be able to initiate a break in the lines at DMV via GPIB. ;D)

denimdragon, for the Prologix interfaces, you can also check out EZGPIB (http://www.ulrich-bangert.de/html/downloads.html).

Title: Re: HP 3456A gpib comand fun
Post by: GregDunn on July 12, 2018, 03:03:15 am
When I worked for the gummint, I was in charge of our microwave test lab and took the opportunity to order every piece of HPIB gear that even sounded like it was useful.   ;D  We controlled everything from a 9825A computer; it ran microwave sweeps using an 8620 generator, captured miscellaneous data with the 3456, plotted everything with an HP pen plotter, dumped test logs to one of their thermal printers.... the lot.  We even pressed some of the gear into use at our antenna test range.  Having a programmable DVM made so many things fast and easy.  It got to the point that all you had to do was connect the DUT and press "start".
Title: Re: HP 3456A gpib comand fun
Post by: K5HJ on July 19, 2018, 05:18:19 am
Damon,

I've been using my 3456 and GPIB with a Python script to log temperature and voltage of some voltage references I built.
These old boat anchors are still quite useful and affordable.

I don't think your dvm.query('V') does anything different from a normal read.
The 'V' sent to the 3456 is ignored.
The Varience register you mention is a statistic register an is read using 'REV'.
If you attempt to read it without doing a statistic run, it will return an overload condition.

Have fun.

Randy