Author Topic: \o/ SCPI--RS232--xls/python logging [ghetto solved]  (Read 11237 times)

0 Members and 1 Guest are viewing this topic.

Offline 3roomlabTopic starter

  • Frequent Contributor
  • **
  • Posts: 855
  • Country: 00
\o/ SCPI--RS232--xls/python logging [ghetto solved]
« on: August 26, 2015, 04:49:18 pm »
original thread was to find out if the polida LM399 was genuine via comparisons with what other forum members had. the purpose of the thread has now changed from comparing LM399, to one of getting the logging to work (on a keithley 2015 via RS232)


(original thread)
i got these yesterday, i wasnt sure if they are real. after seeing the thread about the curious LTZ1000. i think i should ask the more experienced people if they think this is real or re-canned or ... ? they dont look like the picture in element14 or the slightly beige 1 in the used keithley. the lead legs are 0.45mm diameter and weigh about 0.6gram. the legs are particularly springy and not like the gold leads i see on element14 picture, and not like the TO92 legs, just springy. (http://sg.element14.com/linear-technology/lm399h-pbf/voltage-ref-shunt-6-95v-to-206ab/dp/2295479?searchRef=SearchLookAhead)

*edit : pic 25_2, the strange looking wet look and "impressed features" on the shell (esp the left unit) i think is an after effect of the outgassing of the lousy plastic wrapper deforming the "can". which i think is really really strange

and the top plastic capping on 1 of it is somewhat crooked  :-//. when i run about 2mA thru it, it gives off 6.84v. i think at over 1mA it should be way above 6.9v ? yes?

are NS LM399 so different in quality or these are truly ... the non-LM399 ? any input greatly appreciated :D
« Last Edit: October 03, 2015, 06:16:42 am by 3roomlab »
 
The following users thanked this post: 2bluesc

Offline Neganur

  • Supporter
  • ****
  • Posts: 1156
  • Country: fi
Re: is this a real NS LM399? (from polida ebay)
« Reply #1 on: August 26, 2015, 05:02:55 pm »
Nah, the lm399 has like 2% initial accuracy on the nominal 6.95V, which is 6.811...7.089V. It should be very stable though that's a good first indicator.

I've bought a couple new old stock from them before (not the lm399) and everything seemed to be OK.

I also would not give too much about Newark's product images.
 

Offline 3roomlabTopic starter

  • Frequent Contributor
  • **
  • Posts: 855
  • Country: 00
Re: is this a real NS LM399? (from polida ebay)
« Reply #2 on: August 26, 2015, 05:10:03 pm »
oh i forgot to mention, the forward resistance measurement of the heater 3-4 pin is 1.8M, the reverse 4-3 is 45k. is that the norm?
 

Offline TheElectricChicken

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: au
Re: is this a real NS LM399? (from polida ebay)
« Reply #3 on: August 26, 2015, 05:14:06 pm »


if you get different readings in different directions then you're measuring from the wrong pins I think.

Also, how accurate is your meter ? if it is accurate, then it's not looking like a good part.

regardless of all else, there are good looking fakes and bad fakes. Some fakes are better than the original in every way, so the only question to ask is if the part is a good part or not. So look towards testing the part against doing the job you want it to do, not whether the new factory that makes it is better or worse than the old factory. What counts is quality, not the brand, which is as easy to fake as it is to exceed.
« Last Edit: August 26, 2015, 05:18:17 pm by TheElectricChicken »
 

Offline Dr. Frank

  • Super Contributor
  • ***
  • Posts: 2425
  • Country: de
Re: is this a real NS LM399? (from polida ebay)
« Reply #4 on: August 26, 2015, 06:22:04 pm »
oh i forgot to mention, the forward resistance measurement of the heater 3-4 pin is 1.8M, the reverse 4-3 is 45k. is that the norm?

The heater consists of a complex circuit, not a simple resistive element. So this simple resistive measurement will not deliver any useful hints, as the readout depends on the DMM used.

(I get something in that ballpark, but won't publish that, due to the non appropriateness of such a test)

Simply power up the heater, following the datasheet, while monitoring the current draw.
This should first show a maximum value, RTFM: 140..200mA, then would go down to the specified power in the temperature stabilized mode, like 8.5mA @ 30V, and proportionally.


The datasheet also contains the min. / max. reference voltage  over current, i.e. 6.6 ..7.3V @ 0.5 .. 10mA, so simply build that circuit on a breadboard and test!

This device is not so easy to falsify, as the white heat cap is special.. it should be a matt and soft plastic.
It's also quite cheap, so a fake is possibly not worthwhile to make.

Frank
« Last Edit: August 26, 2015, 06:28:10 pm by Dr. Frank »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20001
  • Country: gb
  • 0999
Re: is this a real NS LM399? (from polida ebay)
« Reply #5 on: August 26, 2015, 06:31:23 pm »
oh i forgot to mention, the forward resistance measurement of the heater 3-4 pin is 1.8M, the reverse 4-3 is 45k. is that the norm?

The heater consists of a complex circuit, not a simple resistive element.
Indeed. Refer to the bottom left hand of page 6 of the datasheet for the heater schematic.
http://cds.linear.com/docs/en/datasheet/199399fc.pdf
 

Offline TheElectricChicken

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: au
Re: is this a real NS LM399? (from polida ebay)
« Reply #6 on: August 26, 2015, 06:41:51 pm »
these boys know what they're talking about !! The whole thermostat is built into the package.


Do as Dr Frank suggests and test it in a simple circuit...
 

Offline TheElectricChicken

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: au
Re: is this a real NS LM399? (from polida ebay)
« Reply #7 on: August 26, 2015, 06:46:59 pm »
images courtesy  Linear Technology Corporation
 linear.com
 

Offline Andreas

  • Super Contributor
  • ***
  • Posts: 3308
  • Country: de
Re: is this a real NS LM399? (from polida ebay)
« Reply #8 on: August 26, 2015, 07:26:01 pm »
Hello,

for me they look strange:

- the ones that I have are all with golden pins (so your parts are at minimum "used")

- the pin 1 marker on the plastic are much larger (1.5mm width and 0.5mm depth).
  see also in the data sheet:
  http://www.symres.com/files/LM399.pdf

- the holes on the bottom side for the pins seem to be smaller on my devices.
  (But on a very old part I have also a "cross hole").

- The plastic cap seems to be more shiny on your parts

https://www.eevblog.com/forum/projects/lm399-based-10-v-reference/msg361683/#msg361683

So all in all I would not bet that they are genuine.

By the way: the heater draws below 9V nearly no current.

With best regards

Andreas
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2449
  • Country: de
  • Sounds like noise
Re: is this a real NS LM399? (from polida ebay)
« Reply #9 on: August 26, 2015, 08:21:03 pm »
Here is a picture to compare with. You see a couple LM299 from NI, a few LM399 from NI and one LM399 from LT.
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 

Offline 3roomlabTopic starter

  • Frequent Contributor
  • **
  • Posts: 855
  • Country: 00
Re: is this a real NS LM399? (from polida ebay)
« Reply #10 on: August 27, 2015, 01:46:28 am »
hmmm well this is interesting, it seems both are genuine. they both exhibit the inrush (not as high as speced but approx 60-120mA depending on how cold is the startup). and thanks branadic for the pic, it seems your NS variant capsule looks like the way it is as the used units i have gotten, the plastic flag to denote the pin orientation is not very obvious like LT. the insides of these pieces are also gold, so they have re-tinned almost the entire lead. are the LT variant made in a different process with better material  :-// ? their leads look so "solid"  :P and the plastic looks very "fine" cosmetically ?

@andreas : yea the plastic can are really very rattly loose. when poking them onto the bread board, 1 of them decided to come out and say hello ! then i saw the metal can, no markings, bottom side are gold

when tested @ 27v
unit A with 6.95v settles at about 10.7mA (heater current only). case temp 63oC
unit B with 6.81v settles at about 12.6mA (heater current only). case temp 67oC
both are fed 0.98mA into the zener (20k feeder), both drops near to the stable current very quickly in about 3-4s
when the zener feed is increased to 1.9mA, both heater current also increases by approx 1mA, i can see the there is a diode connection between the zener side to heater, i guess the zener feed does affect the heater somehow  :-//? hmmm how could it be ?

i guess i have nothing else for short term tests until i figure out a way to "SCPI" the used keithley thru the RS232, then the routine starts to try and "see" the drifts :P. im having such a high hill to climb learning to use SCPI, this is going to take a long time  :-DD

(maybe LM399 sellers should give a longer timeframe for confirming a purchase? lolz, tough business?!)

again thanks folks for all the tips pics and helps :D
« Last Edit: August 27, 2015, 02:03:50 am by 3roomlab »
 

Offline TheElectricChicken

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: au
Re: is this a real NS LM399? (from polida ebay)
« Reply #11 on: August 27, 2015, 02:23:48 am »
The results of the tests of these apparently genuine parts and the differences between the two are a great argument for making your own temperature controlled voltage reference. There are countless crystal ovens which are basically the same thing, on the internet as well as voltage regulators.

Considering how little it would take to make a design that regulates to better than 1%, and beat the '399 it's worth the challenge for sure. This would be a good exercise for an electronics class who've done a few other projects first.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: is this a real NS LM399? (from polida ebay)
« Reply #12 on: August 27, 2015, 02:41:18 am »
hmmm well this is interesting, it seems both are genuine. they both exhibit the inrush current.

Well, that just proves that it's an oven-regulated reference. Not necessarily a genuine NS part. Remember, a fake FTDI chip works just as well as the real one!
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: is this a real NS LM399? (from polida ebay)
« Reply #13 on: August 27, 2015, 04:40:05 am »
Seems real to me, leads just tinned.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline Dr. Frank

  • Super Contributor
  • ***
  • Posts: 2425
  • Country: de
Re: is this a real NS LM399? (from polida ebay)
« Reply #14 on: August 27, 2015, 08:02:38 am »
Seems very probably to be genuine N.S. part.
2 reasons:

1) this thermal package obviously is genuine, as the complex inner construction is adapted to the IC.
To produce SUCH a fake would not be worthwhile at all.
2) There are no other (fake) 4 pin devices on the market any more, in contrast to 8pin OpAmps in this TO99 package, which are used to imitate an LTZ1000.

The heater really delivers these expected high temperatures at the metal case, (inner chip at 90°C) and stabilizes at a reasonable current, obviously.

I would expect, that the heater current goes down, when powering the zener .
At 1mA, there are 7mW additional power, so the heater should go down by this approximately.

Pay attention, that heater negative is at same or lower potential, than zener negative! (RTFM - datasheet)

Frank
 

Offline eas

  • Frequent Contributor
  • **
  • Posts: 601
  • Country: us
    • Tech Obsessed
Re: is this a real NS LM399? (from polida ebay)
« Reply #15 on: August 27, 2015, 09:50:58 pm »
i guess i have nothing else for short term tests until i figure out a way to "SCPI" the used keithley thru the RS232, then the routine starts to try and "see" the drifts :P. im having such a high hill to climb learning to use SCPI, this is going to take a long time  :-DD
What model Keithley?  What programming language?  I can share a python script I've used to log from multiple Keithley meters to a SQLite3 DB over VXI-11 to a VXI/GPIP gateway. It should be pretty easy to adapt it to talk over RS-232, and just dump the values as text or something.

If you are interested, let me know and I'll share it somehow.
 

Offline eas

  • Frequent Contributor
  • **
  • Posts: 601
  • Country: us
    • Tech Obsessed
Re: is this a real NS LM399? (from polida ebay)
« Reply #16 on: August 28, 2015, 12:20:34 am »
I decided to go ahead and post the python script here: http://techobsessed.net/2015/08/keithley-2000-2700-data-logging-in-python/
 

Offline 3roomlabTopic starter

  • Frequent Contributor
  • **
  • Posts: 855
  • Country: 00
Re: is this a real NS LM399? (from polida ebay)
« Reply #17 on: September 01, 2015, 12:20:10 am »
hi EAS, thanks for sharing. i will try to have a look at it when i have some time. and i will see if i can post some longish term loggin of these LM399 here :P

its a used ebay score keithley 2015 THD (non P type), still have not had time to thoroughly clean this unit up. so far, i have had some problems with the RS232 when using different PCs, still finding time to find/define this problem first

at this point on 1 of the PC, i have tried to install NI VISA, and just like the NI analog devices simulator, the drivers/TSRs it set out inside the PC are just ... a huge mess. i guess it is why many chose to use EZGPIB, sleek is the description i would use for EZGPIB. but since i have 2 RS232 USB devices, i should try to explore it fully (when more time allows)
« Last Edit: September 01, 2015, 12:58:34 am by 3roomlab »
 

Offline 3roomlabTopic starter

  • Frequent Contributor
  • **
  • Posts: 855
  • Country: 00
Re: \o/ logging [solved] ... exploring log to CSV
« Reply #18 on: October 02, 2015, 04:30:00 am »
after some mucking around (nope i dont really know how to use python). this is the python code to grab readings off @ 50Hz. once in a while the read might glitch. this works in windows XP SP3 with PYSERIAL 2.7 on python 2.7 (using a USB-RS232 on COM3 in my case).

Code: [Select]
import time
import serial
# configure the serial connections
ser = serial.Serial(
port='COM3',
baudrate=19200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
        xonxoff=False
)

ser.close()
ser.open()
ser.isOpen()

while True :

  ser.write(':FETCh?\r')   #\r\n is for device terminators set to CR LF

  time.sleep(0.02)   # 50Hz reading.
  out=''
  while ser.inWaiting() > 0:
    out += ser.read(16)
  if out != '':
      out=out.rstrip()
      print (((time.time())*1000),out)  # timestamp in uS
 

while trying to insert commands to switch mode to current mode etc, the comms seems to glitch  ???
curious question --> at what refresh speed does GPIB/488 work at? i assume it is more than 50Hz if it is made to do so?
« Last Edit: October 02, 2015, 04:10:56 pm by 3roomlab »
 

Offline 3roomlabTopic starter

  • Frequent Contributor
  • **
  • Posts: 855
  • Country: 00
Re: \o/ SCPI--RS232--xls/python logging [ghetto solved]
« Reply #19 on: October 03, 2015, 06:58:50 am »
what would the world become if there is no python ^-^ ...

this code logs to *.xls (which can be converted to CSV) and has file spanning. in summary : WinXP SP3 --> python 2.7 (+pyserial 2.7 + XLWT, etc) --> "FETCh" from COM3 --> logs into tweakable "xxx.xls"

@ 4.8kbps, refresh/fetch rate is approx 14Hz

Code: [Select]
import time
import serial  # additional addon library package
import math
import xlwt # additional addon library package
import os
SHTR = 40 #row limit of datasheet 65535
SHTC = 2 #column limit of datasheet 1024
SHTC -= 1 #in XLWT, first physical column is marked zero
RLIM = 65535 # row limit of opencalc
CLIM = 1024 # column limit of opencalc
FLIM = 4 #file limit, number of files to save
out=''
VV=''
print "TEST CPU clock   ","%+0.9f"%(time.clock())
TT = 0
float (TT)
CC = 0
int(CC)

ser = serial.Serial(  # RS232 port configuration
port='COM3',
baudrate=4800,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
xonxoff=True,
timeout=3,
rtscts=False,
dsrdtr=False
)

def cls():
os.system(['clear','cls'][os.name == 'nt'])

def CHKS():
ser.close() # RS232 port close and re-open
time.sleep(0.1)
ser.open()
time.sleep(0.1)
return

def READSS():
ser.write(':FETCh?\r')  #\r\n char term = CR LF
time.sleep(0.05)  #output cycle delay
out=''
while ser.inWaiting() > 0:
out += ser.read(16)
TT = "{:+9.2f}".format(time.clock())
if out != '':
out=out.rstrip()
VV = out
return VV,TT

def range(R1, R2, R3):
y = R1
while y < R2:
yield y
y += R3

def range(R4, R5, R6):
X = R4
while X < R5:
yield X
X += R6

def range(F1, F2, F3):
FF1 = F1
while FF1 < F2:
yield FF1
FF1 += F3

for FF1 in range(0,FLIM,1):
wb = xlwt.Workbook()
ws = wb.add_sheet("DATA")

for y in range(0,SHTC,2):

for x in range(0,SHTR,1):

VV,TT = READSS()
VV = float(VV)
VV = "{:+0.12f}".format(VV)
print "   ","%06d"%y,"%06d"%x, VV , TT
ws.write(x,y,TT)
ws.write(x,y+1,VV)
CC +=1

FN =''
FN = "DATA_" + str(FF1) +".xls"
print "  sheet full, total entries", CC
print "  sheet written to", FN
wb.save(FN)


exit()

my next problem would be ...
i cant get the K2015 to "obey" RS232 measuring commands properly (eg : setting NPLC 100). any1 have experience in setting it thru RS232? or have any hints n tips?


A) being new to keithley 2015, i didnt know that it doesnt have a NPLC 100 function (maximum is NPLC 10)
B) the key problem with comms is the lousy PROLIFIC RS232, but FTDI is no better with higher latency and sudden stops

C) bean counting 4th raw test. 4788 samples @ 8Hz, NPLC 1, 100mV. AUTOZERO = ON. (DMM placed in another corner of the room)

(related thread https://www.eevblog.com/forum/beginners/~~-exploring-scpi-thru-rs232-%28problemsolution%29/msg787792/#msg787792)
« Last Edit: November 04, 2015, 11:07:09 pm by 3roomlab »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf