AnsweredAssumed Answered

How can I periodically store the data from thermocouple scans for long period scans?

Question asked by abba on Feb 8, 2018
Latest reply on Apr 24, 2018 by tomc

Hi,

 

I'm trying to program a 34972A using python to take thermocouple readings for a predetermined time and interval. In the benchlink data logger I am able to take the scans and store the data on a rolling basis. How could I replicate this using the commands available in command expert?

 

This is what I have so far:

import visa
import time
import pandas
# start of Untitled

 

rm = visa.ResourceManager()
v34972A = rm.open_resource('USB0::0x0957::0x2007::MY49013602::0::INSTR')
v34972A.timeout = None
v34972A.write('*RST')
v34972A.write(':ABORt')
v34972A.write(':CONFigure:TEMPerature %s,%s,(%s)' % ('TCouple', 'K', '@102:104'))
v34972A.write(':UNIT:TEMPerature %s' % ('C'))
v34972A.write(':ROUTe:SCAN (%s)' % ('@102:104'))
v34972A.write(':TRIGger:SOURce %s' % ('TIMer'))
v34972A.write(':TRIGger:COUNt %d' % (5))
v34972A.write(':TRIGger:TIMer %G' % (1.0))
v34972A.write(':FORMat:READing:CHANnel %d' % (1))
v34972A.write(':FORMat:READing:ALARm %d' % (0))
v34972A.write(':FORMat:READing:UNIT %d' % (1))
v34972A.write(':FORMat:READing:TIME:TYPE %s' % ('ABSolute'))
v34972A.write(':FORMat:READing:TIME %d' % (1))
v34972A.write(':FORMat:READing:UNIT %d' % (1))
readings = v34972A.query(':READ?')
v34972A.close()
rm.close()

 

I am programming this in python. With the above I'm able to copy the readings after the scan finishes. Is there anyway to do copy and store the scans periodically instead?

Outcomes