\o/ SCPI--RS232--xls/python logging [ghetto solved] - Page 1
Forum section: electronics / projects

author: 3roomlab
author_rank: Frequent Contributor
timestamp: August 26, 2015, 04:49:18 pm
content: 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 strangeand 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

author: Neganur
author_rank: Unknown
timestamp: August 26, 2015, 05:02:55 pm
content: 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.

author: 3roomlab
author_rank: Frequent Contributor
timestamp: August 26, 2015, 05:10:03 pm
content: 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?

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 26, 2015, 05:14:06 pm
content: 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.

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 26, 2015, 06:22:04 pm
content: Quote from: 3roomlab on August 26, 2015, 05:10:03 pmThe 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

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2015, 06:31:23 pm
content: Quote from: Dr. Frank on August 26, 2015, 06:22:04 pmIndeed. 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

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 26, 2015, 06:41:51 pm
content: 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...

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 26, 2015, 06:46:59 pm
content: images courtesy Linear Technology Corporationlinear.com

author: Andreas
author_rank: Super Contributor
timestamp: August 26, 2015, 07:26:01 pm
content: 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 partshttps://www.eevblog.com/forum/projects/lm399-based-10-v-reference/msg361683/#msg361683So all in all I would not bet that they are genuine.By the way: the heater draws below 9V nearly no current.With best regardsAndreas

author: branadic
author_rank: Super Contributor
timestamp: August 26, 2015, 08:21:03 pm
content: Here is a picture to compare with. You see a couple LM299 from NI, a few LM399 from NI and one LM399 from LT.

author: 3roomlab
author_rank: Frequent Contributor
timestamp: August 27, 2015, 01:46:28 am
content: 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"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 goldwhen tested @ 27vunit A with 6.95v settles at about 10.7mA (heater current only). case temp 63oCunit B with 6.81v settles at about 12.6mA (heater current only). case temp 67oCboth are fed 0.98mA into the zener (20k feeder), both drops near to the stable current very quickly in about 3-4swhen 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. im having such a high hill to climb learning to use SCPI, this is going to take a long time(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

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 27, 2015, 02:23:48 am
content: 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.

author: rs20
author_rank: Super Contributor
timestamp: August 27, 2015, 02:41:18 am
content: Quote from: 3roomlab on August 27, 2015, 01:46:28 amWell, 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!

author: TiN
author_rank: Super Contributor
timestamp: August 27, 2015, 04:40:05 am
content: Seems real to me, leads just tinned.

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 27, 2015, 08:02:38 am
content: 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

author: eas
author_rank: Frequent Contributor
timestamp: August 27, 2015, 09:50:58 pm
content: Quote from: 3roomlab on August 27, 2015, 01:46:28 amWhat 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.

author: eas
author_rank: Frequent Contributor
timestamp: August 28, 2015, 12:20:34 am
content: I decided to go ahead and post the python script here:http://techobsessed.net/2015/08/keithley-2000-2700-data-logging-in-python/

author: 3roomlab
author_rank: Frequent Contributor
timestamp: September 01, 2015, 12:20:10 am
content: 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 hereits 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 firstat 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)

author: 3roomlab
author_rank: Frequent Contributor
timestamp: October 02, 2015, 04:30:00 am
content: 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:import timeimport serial# configure the serial connectionsser = 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 LFtime.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 uSwhile trying to insert commands to switch mode to current mode etc, the comms seems to glitchcurious question --> at what refresh speed does GPIB/488 work at? i assume it is more than 50Hz if it is made to do so?

author: 3roomlab
author_rank: Frequent Contributor
timestamp: October 03, 2015, 06:58:50 am
content: 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 14HzCode:import timeimport serial # additional addon library packageimport mathimport xlwt # additional addon library packageimport osSHTR = 40 #row limit of datasheet 65535SHTC = 2 #column limit of datasheet 1024SHTC -= 1 #in XLWT, first physical column is marked zeroRLIM = 65535 # row limit of opencalcCLIM = 1024 # column limit of opencalcFLIM = 4 #file limit, number of files to saveout=''VV=''print "TEST CPU clock ","%+0.9f"%(time.clock())TT = 0float (TT)CC = 0int(CC)ser = serial.Serial( # RS232 port configurationport='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-opentime.sleep(0.1)ser.open()time.sleep(0.1)returndef READSS():ser.write(':FETCh?\r') #\r\n char term = CR LFtime.sleep(0.05) #output cycle delayout=''while ser.inWaiting() > 0:out += ser.read(16)TT = "{:+9.2f}".format(time.clock())if out != '':out=out.rstrip()VV = outreturn VV,TTdef range(R1, R2, R3):y = R1while y < R2:yield yy += R3def range(R4, R5, R6):X = R4while X < R5:yield XX += R6def range(F1, F2, F3):FF1 = F1while FF1 < F2:yield FF1FF1 += F3for 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 , TTws.write(x,y,TT)ws.write(x,y+1,VV)CC +=1FN =''FN = "DATA_" + str(FF1) +".xls"print " sheet full, total entries", CCprint " sheet written to", FNwb.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 stopsC) bean counting 4th raw test. 4788 samples @ 8Hz, NPLC 1, 100mV. AUTOZERO = ON. (DMM placed in another corner of the room)(related threadhttps://www.eevblog.com/forum/beginners/~~-exploring-scpi-thru-rs232-%28problemsolution%29/msg787792/#msg787792)