Author Topic: HP 3456A gpib comand fun  (Read 3781 times)

0 Members and 1 Guest are viewing this topic.

Offline kj7eTopic starter

  • Frequent Contributor
  • **
  • Posts: 911
  • Country: us
  • Damon Stewart
HP 3456A gpib comand fun
« 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
« Last Edit: May 03, 2018, 07:57:56 pm by kj7e »
 
The following users thanked this post: flittle

Offline kj7eTopic starter

  • Frequent Contributor
  • **
  • Posts: 911
  • Country: us
  • Damon Stewart
Re: HP 3456A gpib comand fun
« Reply #1 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')
« Last Edit: May 04, 2018, 03:56:29 am by kj7e »
 
The following users thanked this post: flittle

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: HP 3456A gpib comand fun
« Reply #2 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.  ;)
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline kj7eTopic starter

  • Frequent Contributor
  • **
  • Posts: 911
  • Country: us
  • Damon Stewart
Re: HP 3456A gpib comand fun
« Reply #3 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.
 

Offline kj7eTopic starter

  • Frequent Contributor
  • **
  • Posts: 911
  • Country: us
  • Damon Stewart
Re: HP 3456A gpib comand fun
« Reply #4 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')
 
The following users thanked this post: denimdragon

Offline denimdragon

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
  • "Hole charge chaser and wanna-be o-scope fixer"
Re: HP 3456A gpib comand fun
« Reply #5 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!
"Hi there. I'm short in the hair department, do you mind if I pull a few strands from your head? Thanks!"
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 9057
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: HP 3456A gpib comand fun
« Reply #6 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.

TEA is the way. | TEA Time channel
 
The following users thanked this post: kj7e

Offline GregDunn

  • Frequent Contributor
  • **
  • Posts: 725
  • Country: us
Re: HP 3456A gpib comand fun
« Reply #7 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".
 

Offline K5HJ

  • Regular Contributor
  • *
  • Posts: 60
Re: HP 3456A gpib comand fun
« Reply #8 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
 
The following users thanked this post: kj7e


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf