Author Topic: GPIB DMM + Calibrator automation  (Read 5237 times)

0 Members and 1 Guest are viewing this topic.

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
GPIB DMM + Calibrator automation
« on: July 02, 2018, 01:40:13 pm »
Hello all,

right now I am experimenting with GPIB automation with python scripts (from member "e61_phil").

So far I managed to get most of my DMMs and also my Fluke 5450A working.

The next step is to automate my Datron/Wavetek 4808 calibrator.
In Keysight Connection Expert the 4808 is marked as connected.
But right now I cannot get the 4808 to respond to any command codes (see att. code overview)
 
Does anyone have a working python script running with a Datron/Wavetek calibrator and can share a test file or give a hint?
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: GPIB DMM + Calibrator automation
« Reply #1 on: July 02, 2018, 04:32:47 pm »
Show me yours, and i will show you mine :D.
I'm working on python SW to run calibrations, and it also supports 4808, however it's not ready for prime time, and designed to run on linux-gpib environment.

One thing that comes to mind - do you have terminations set correctly for 4808? Not forget "=" symbol after command end?
Also It's rather picky on proper formatting, you can't pass too much resolution for values, or it will drop the commands.

Short example of what works for me:

Code: [Select]
def w4808_function(cmd):
    if (cmd == "DCV"):
        intf.write ("F0=")
    elif (cmd == "ACV"):
        intf.write ("F1=")
    elif (cmd == "DCI"):
        intf.write ("F2=")
    elif (cmd == "ACI"):
        intf.write ("F3=")
    elif (cmd == "RES"):
        intf.write ("F4=")
   
def w4808_out_set(cmd):
    intf.write ("M%s=" % cmd)
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: quarks

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #2 on: July 02, 2018, 07:51:51 pm »
Hello TiN,

thanks a lot for your reply.

I had used the termination, in python and also directly in "Keysight  Interactive IO".
So far no luck.

With your code I get IndentationError (see att.).

Unfortunately I am a newbie in Python and do not know what to try next.
 

Offline AG7CK

  • Regular Contributor
  • *
  • Posts: 131
  • Country: th
Re: GPIB DMM + Calibrator automation
« Reply #3 on: July 02, 2018, 11:31:17 pm »
This seems to be an error in line 33 because of the indentation ("tab"-space) from line 20 to line 33 (the lines inbetween are commented out).

In python indentation has rules - you cannot in general add spaces in front of a line. I would clean up code/comments and spacing first.
 
The following users thanked this post: quarks

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: GPIB DMM + Calibrator automation
« Reply #4 on: July 03, 2018, 12:21:17 am »
Yep, python does not like extra spaces, unlike C/C++.
You need def block start same as rest of cost, at beginning of the line.

YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: quarks

Offline e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #5 on: July 03, 2018, 11:15:01 am »
If the format is sensitive, one could use the format() method of a string object to create a proper string from a float.

@Tin: Do you have some generic Python software for calibration? I have lots of scripts for different measurements but nothing generic.
That's sometimes a bit ugly if one would like to run the same calibration with different instruments. Perhaps one should define some classes with a standard interface for DMMs and so on?
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: GPIB DMM + Calibrator automation
« Reply #6 on: July 03, 2018, 11:54:15 am »
What you mean by "generic"? So far I wrote about this:

Code: [Select]
** Main logic
[+] - astd_ac.py
[+] - cal.py         - Calibration report logic / data parser
[+] - cal_ac.py      - Calibration report logic / data parser 4920/5790 only
[+] - dut.py         - DUT glue logic module
[+] - dut_ac.py      - AVMS glue logic module
[+] - main.py
[+] - markup.py
[+] - meow.py
[+] - mfc.py         - MFC source logic / glue
[+] - mfc_5700.py    - 5700A specific hacks
[+] - mfc_sec.py     - Secondary MFC source logic / glue
[+] - siggen.py
[+] - std.py         - Manual standards logic / glue
** Interface HAL
[+] - if_bme280.py   - BME280
[+] - if_debug.py    - Simulation IF
[+] - if_gpib.py     - linux-gpib IF
** Device support
[+] - d1281.py       - Wavetek/Datron 1281
[+] - f5450a.py      - Fluke 5450A
[+] - f5700a.py      - Fluke 5700A
[+] - f5720a.py      - Fluke 5720A
[+] - f5790a.py      - Fluke 5790A
[+] - hp34401a.py    - HPAK 34401A
[+] - hp3457a.py     - HPAK 3457A
[+] - hp3458a.py     - HPAK 3458A
[+] - k2000calv2.py  - K2000
[+] - k2001.py       - K2001
[+] - k2002.py       - K2002
[+] - k2182.py       - K2182
[+] - k2182a.py      - K2182A
[+] - r6581t.py      - R6581T
[+] - t9823.py       - Time 9823
[+] - w4808.py       - Wavetek 4808
[+] - w4920.py       - Wavetek 4920 + mV opt
[+] - w4920m.py      - Wavetek 4920M + WBV opt
[+] - test.py   

About 1420kb of code so far, 732 changesets in repository (and still lots of things broken/patched thru).
First commit August 1, 2016  :)
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: quarks

Offline e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #7 on: July 03, 2018, 11:57:19 am »
How do you configure which type of DUT you're measuring? And how do you define the calibration points?

Have you worked out something which runs with multiple DMMs without changing a lot?
 

Offline ManateeMafia

  • Frequent Contributor
  • **
  • Posts: 730
  • Country: us
Re: GPIB DMM + Calibrator automation
« Reply #8 on: July 03, 2018, 11:58:27 am »
What's the meow.py?  Is that a secret ppm adjustment tool? 
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: GPIB DMM + Calibrator automation
« Reply #9 on: July 03, 2018, 12:14:56 pm »
Meow.py makes everything rain cats.

e61_phil, i use config file to set operation mode. Calibration points hardcoded into DUT procedure. I have three main procedures for every device/DUT: performance test, user calibration, manufacturer calibration.
Once procedure is ready, then I couple program logic and DUT procedure thru glue code. Unsupported stuff on either side (source or DUT) is dropped automagikally.
For starters I take calibration points from service manual for DUT and expand them to more points as I desire.

Code: [Select]
; This is calkit configuration file
; For options please refer to documentation
[calkit]
if_debug       = false ; (if true run all code w/o talking to real hardware)
no_delays      = false ; (don't use delays in code to run during debug)
env_sensor     = bme280 ; none or bme280 or f1620 - Environment sensor
verbose        = true  ; verbose outputs in terminal
interface      = gpib ; (use linux-gpib bidning to run)
alienated      = true  ; don't stop for user inputs
lab_location   = xdevs_hq ; (lab location id, available are xdevs_hq, xdevs_usfl, xdevs_idtw)
logfilenm      = results/imc5700_4920m_test1.html
report_filenm  = results/imc5700_4920m_test1.html
raw_data_filelog = results/imc5700_4920m_test1.log

[testset]
testmode       = full  ; fast - run only RES,DCV, normal - run RES,DCV,DCZ,ACVA,DCI, full - run everything, dconly
all_test_disable = false ; Run bogus data if true
enabled_dcz    = true  ;(DC Zero test active)
enabled_dcv    = true  ;(FS/-FS DC Voltage test active)
enabled_dclin  = true  ;(DC Linearity test active)
enabled_dci    = true  ;(DCI test active)
enabled_acz    = false ;(AC Zero test active)
enabled_acva   = true  ;(AC Analog test active)
enabled_acvs   = true  ;(AC Sync test active)
enabled_aci    = true  ;(ACI test active)
enabled_rez    = true  ;(Resistance zero test active)
enabled_res    = true  ;(Resistance 4W test active)
enabled_res1g  = true  ;(1G Resistance test active)
enabled_res2w  = false ;(Resistance 2W test active)
enabled_freq   = false ;(Frequency test active)
enabled_period = false ;(Period test active)
   
[mode]
run_selftest   = true ;true to Run self-diag tests before perf-test)
run_acal       = true ;true to Run 3458 ACAL before perf-test)
run_zcal_mfc   = true ;true to Run 5700 Zero CAL before perf-test)

[specification]
cal_spec        = 24h   ; (24h or 90d or 180d or 1y or 2y)
confidence      = 0.95  ; 95% (+guardbanding)

[dut]
dut_gpib_addr     = 19        ; GPIB Address
dut               = w4920m ; DUT device type
secure_password   = 0        ; DUT security password
dut_terminal_side = 1        ; 1 - front, 0 - rear
dut_serno         = XXX

[standard]
mfc_gpib_addr     = 1     ; GPIB Address
mfc               = f5700  ; (MFC type)
mfcs              = none   ; (MFC type)
mfc_acal          = true   ;(Run Calcheck + reports prior to DUT perf-test)

After everything runs (typical running time for DUT is 6-15 hours, if no manual operations like cable swap or 1Gohm resistor test) pretty HTML page generated with all data for review.
Example data.

3458A 3458B 3458B other lab K2002 4920M

All test points are checked to relative 24-hour specification at K=1, not 1 year. If DUT pass this spec, then there is nothing to worry about  :-DD. Enough to say, it takes weeks of runtime/tweaking to make any single DUT to produce "all green" report. Even then often "green" reports are just not happening.
« Last Edit: July 03, 2018, 12:18:14 pm by TiN »
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: quarks, e61_phil

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #10 on: July 05, 2018, 09:42:17 am »
here a short update, my tested 4808 has a bad IEEE488 connector, which I need to replace.

Therefore I was searching for a female IEEE-488 connector in straight pin print version (like see att.)
Unfortunately these plugs seem to be hard to find in Germany.
Does anyone know a source?

As I have another 4808, I tested my initial GPIB commands with success

W4808.write("F0=")         # DCV
W4808.write("R6=")         # Range 10
W4808.write("A1=")         # Full Range +
W4808.write("M+10=")      # +10V
W4808.write("O1=")         # Output On
W4808.write("O0=")         # Output Off

also a combined string works fine
W4808.write("R6F0M+10O1=")   
« Last Edit: July 06, 2018, 08:54:09 am by quarks »
 

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #11 on: July 05, 2018, 01:37:41 pm »
I just tested Advantest R6581 commands

in Python I tried:

R6581.write("DCV")
R6581.write("R5")         #Range 10V
R6581.write("AZ1")         #Autozero AZ0=off / AZ1=on
R6581.write("RE8")         #Resolution 8.5 digit

and all worked fine.

Does anyone know the command for readout?
« Last Edit: July 05, 2018, 01:40:38 pm by quarks »
 

Offline e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #12 on: July 05, 2018, 02:05:43 pm »
Did you try a simple R6581.read() ?
 
The following users thanked this post: quarks

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #13 on: July 05, 2018, 02:56:27 pm »
I tried

float(R6581.read())

and

float(R6581.query("RDG?"))

without luck
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: GPIB DMM + Calibrator automation
« Reply #14 on: July 05, 2018, 03:25:12 pm »
float(R6581.query("RDG?"))

without luck

Why RDG? 6581 is SCPI-talkative.

Quote from: Calkit code
def r6581t_get_meas():
    ...
    tdata = float(intf.read("READ?")[1])
    ...
    ...
    return tdata
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: quarks

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #15 on: July 05, 2018, 04:09:49 pm »
Hello TiN,

I just tried what was working with my other gear, because I did not find the syntax in the japanese "CommandMatrix_R6581.pdf" I have.

In my (not working) Python test script it looks like this:´

data = [datetime.datetime.today(), value, float(F8508A.query("RDG?")), float(hp3458A1.read()), float(R6581.read())]

unfortunately I do not know what command / syntax to use to get a R6581 reading

R6581 is set to
"CONFIGURE GPIB"
"LANGUAGE"
"ADVANTEST"
« Last Edit: July 06, 2018, 12:24:05 am by quarks »
 

Offline e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #16 on: July 05, 2018, 09:04:33 pm »
What you mean by "generic"?

I was thinking about a couple of classes. One for every type of DMM and all with the same interface. This way one could simply change the instantiation line and use another class and the rest of the script don't care about the instrument used.

Such a DMM class should implement methods like these:
get_reading()
get_type()

set_range()
set_function()
...


Perhaps one will not need this for calibration, but most of the scripts I use are not only for calibration. Sometimes one would use a couple of DMMs for an experiment and this time it would be nice if one can use all instruments the same way.

One could also implement methods which will return lists of calibration points, specifications and so on.
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: GPIB DMM + Calibrator automation
« Reply #17 on: July 06, 2018, 08:05:30 am »
R6581 is set to
"CONFIGURE GPIB"
"LANGUAGE"
"ADVANTEST"
Two different GPIB command set is supported by the 6581, what TiN described is in the other, "SCPI".
I cannot really help you with the ADC format, I opted for other as it looked easier to understand, e.g.:
      self.inst.write("*RST")
      self.inst.write("*CLS")
      self.inst.write("FORM ASCII")
      self.inst.write("CONF:VOLT:DC")
      self.inst.write("VOLT:DC:RANG:AUTO ON")
      self.inst.write("VOLT:DC:NPLC 50")
      self.inst.write("VOLT:DC:DIG 8")
      self.inst.write("ARM:SOUR IMM")
      self.inst.write("TRIG:SOUR IMM")
      self.inst.write("ZERO:AUTO ON")
      self.inst.write("INIT:CONT ON")
      self.inst.write("VOLT:DC:PROT ON")

There are also a lot of examples in chapter 9.12 in the manual, for both command sets. The title can be translated by google, so can have an idea what the program is doing.
 
The following users thanked this post: quarks

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #18 on: July 06, 2018, 10:33:01 am »
Hello z01z,

thanks a lot.

I changed to "SCPI" and your commands are working.

The R6581 readout is working after I changed R6581 "DATA-FORMAT" from "REAL64" to "ASCII"
"Keysight Interactive IO" gives the following:
 
* Connected to: GPIB0::8::INSTR
-> READ?
<- +00.0000060E+00,OFF

But in Python I still get

ValueError: could not convert string to float: '+00.0000060E+00,OFF\r\n'

Any idea?
 

Offline AG7CK

  • Regular Contributor
  • *
  • Posts: 131
  • Country: th
Re: GPIB DMM + Calibrator automation
« Reply #19 on: July 06, 2018, 11:24:17 am »
Only the first 15 characters of your string is a number - the rest is some handshake / termination stuff.

If you have STRING_FROM_READING = '+00.0000060E+00,OFF\r\n'

then you can use STRING_FROM_READING[1:16] which is (16-1)=15 long and begins at position 1. Hence it returns '+00.0000060E+00'.

Search "python string slicing".


 
The following users thanked this post: quarks

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: GPIB DMM + Calibrator automation
« Reply #20 on: July 06, 2018, 11:37:02 am »
The problem according to the error printout is that not a single float is returned but two values, which cannot be converted to a float.
The question is, do you need the additional fields or not?

Courtesy of google translate (ch 9.4.1 in manual):
Output data • Element setting is effective when the data output format is ASCII. When each setting item is set to ON, the following items are attached to the measured value.
However, items turned OFF will not be attached to measured values.

A lot of things can be returned:
DCV+1000. 0000E-03, PAS, OFF, 01CH, NUL, SMO, SCL, 1994/12/31 00:00

If only the measurement value is needed, turn everything else off (":FORM:ELEM NONE").
Sorry for that, seems like I've copied the commands from an older script and discovered the need for this command later.
 
The following users thanked this post: quarks

Offline e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #21 on: July 06, 2018, 11:59:47 am »
Only the first 15 characters of your string is a number - the rest is some handshake / termination stuff.

If you have STRING_FROM_READING = '+00.0000060E+00,OFF\r\n'

then you can use STRING_FROM_READING[1:16] which is (16-1)=15 long and begins at position 1. Hence it returns '+00.0000060E+00'.

Search "python string slicing".

I wouldn't slice the + away

If the length of extra stuff behind the measurement isn't clear, one could also split the string at "," and use only the part before the first ,
float(inst.query("READ?").split(",")[0])
 

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #22 on: July 06, 2018, 12:00:13 pm »
many thanks for all the help

float(R6581.query("READ?")[:-6])

fixed the readout problem

 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: GPIB DMM + Calibrator automation
« Reply #23 on: July 06, 2018, 12:12:11 pm »
quarks

That's wrong way to do it. Disable the extra stuffs using FORM command:

Quote from: Calkit
def r6581t_setup():
    intf.clear()
    intf.write("*RST\n")
    intf.write(":STAT:PRES")
    intf.write(":INP:TERM FRON\n")
    intf.write(":INP:GUAR FLO")
    intf.write(":SENS:VOLT:DC:NPLC 100")
    intf.write(":SENS:VOLT:DC:DIG MAX")
    intf.write(":SENS:VOLT:DC:PROT ON")
    intf.write(":SENS:CURR:DC:NPLC 100")
    intf.write(":SENS:CURR:DC:DIG MAX")
    intf.write(":SENS:FRES:NPLC 100")
    intf.write(":SENS:FRES:DIG MAX")
    intf.write(":FORM:ELEM NONE")
    intf.write(":TSYS:FAST:STAT OFF")

SCPI is common GPIB-language today.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: quarks

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #24 on: July 20, 2018, 09:52:17 am »
GPIB is working stable with my calibrator and all my DMMs

I do have old Datron/Wavetek "Portocal" calibration software, but unfortunately it can only be used for calibration with a dongle (which I do not have and most likely will never get one).

Now I wonder if the "Portocal" software could still be heplfull?
Could it be possible to extract usefull calibration procedures and port them to Phyton?

Does anyone have experience/hints/ideas/suggestions?
 

Offline Zucca

  • Supporter
  • ****
  • Posts: 4306
  • Country: it
  • EE meid in Itali
Re: GPIB DMM + Calibrator automation
« Reply #25 on: July 20, 2018, 10:16:10 am »
Upload it here:

https://doc.xdevs.com/contact/

and let the world "digest" it.
Can't know what you don't love. St. Augustine
Can't love what you don't know. Zucca
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: GPIB DMM + Calibrator automation
« Reply #26 on: July 20, 2018, 11:39:23 am »
quarks
I could take a look on that, as I never heard about Portocal before. I ported quite a few Fluke MET/CAL procedures (mostly for 3458 & Keithleys) to python, it's straight forward once sequence is check.

I'm thinking to make lite calibration python app, that will load pre-determined GPIB listing and just "playback" it on the equipment, saving the result with test points and measurements into file.
It would be rather simple thing, which I could share publicly.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: quarks

Offline eurofox

  • Supporter
  • ****
  • Posts: 873
  • Country: be
    • Music
Re: GPIB DMM + Calibrator automation
« Reply #27 on: July 20, 2018, 12:43:24 pm »
Meow.py makes everything rain cats.

rain cats or cats in the rain  :-DD
eurofox
 

Offline quarksTopic starter

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: GPIB DMM + Calibrator automation
« Reply #28 on: July 20, 2018, 01:01:57 pm »
quarks
I could take a look on that, as I never heard about Portocal before. I ported quite a few Fluke MET/CAL procedures (mostly for 3458 & Keithleys) to python, it's straight forward once sequence is check.

I'm thinking to make lite calibration python app, that will load pre-determined GPIB listing and just "playback" it on the equipment, saving the result with test points and measurements into file.
It would be rather simple thing, which I could share publicly.

Hello TiN,

att. is a short info about Portocal.
It is similar to Fluke MET/CAL, but died when Fluke took over Wavetek (Datron).

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf