• RE: How to use the status model on a 3706A

    Hello Andrea,&#160;<br> <br> I just tried your suggestion, and it seems that if I load my TSP script into the 3706A up front, using a separate python script and the command&#160;<code>write('loadscript filename')</code>, it does not work.<br> <br> If I instead write the TSP script to the instrument line by line in the same python script that also trigger the measurement, like your example, it seemed to work for awhile. Now, suddenly, it is not possible to reset the status registers by use of&#160;<code>status.reset()</code><br> <br> Is there any ways of completely reset the instrument to factory defaults (the&#160;<code>reset()</code>&#160;does not seem to fix anything either)?<br> <br> <br> Kind regards,&#160;<br> Lars
  • RE: How to use the status model on a 3706A

    Hello Andrea.<br> <br> thanks for the explanation and suggestions.<br> I will try this as soon as I am in the lab on monday, and report back to you.<br> <br> Your help is much appreachiated!<br> <br> Have a great weekend!<br> Kind regards,&#160;<br> Lars
  • RE: How to use the status model on a 3706A

    Hello Andrea,&#160;<br> thanks for you quick reply.<br> <br> This is not working for me.<br> Also, I would like to understand this a bit better, as I find the manual a bit confusing.&#160;There is no SRQ annunciator on the front panel when running this on my instrument.<br> <br> Kind regards,&#160;<br> Lars
  • RE: How to use the status model on a 3706A

    <blockquote> <p>Hi Paul,&#160;</p> <p>thanks for doing that.</p> <p></p> <p>Just so you technicians have some more input I have added my code below.</p> <p>TSP script on the 3706A (sweep.tsp):</p> <pre class="linenums prettyprint">-- Reads the sensor output from 3720 in slot2 (channel 1-10) and temperature reading from 3720 in slot1 (channel 1) reset()&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Reset instrument errorqueue.clear()&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Clear error queue status.reset()&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Clearing the status registers and output queue status.request_enable = 0&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Clearing the status enable status.measurement.enable = 0&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Clearing the SRQ on measurement complete enable tempOutput_buffer = dmm.makebuffer(5)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Create buffer sensorOutput_buffer = dmm.makebuffer(50)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Create buffer tempOutput_buffer.clear()&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Clearing the tempOutput_buffer sensorOutput_buffer.clear()&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Clearing the sensorOutput_buffer -- Status registers status.standard.enable = 1169 status.request_enable = 129 status.measurement.enable = status.measurement.BAV &#160; -- Enable SRQ on measurement complete function getTemperature() &#160;&#160; &#160;dmm.func = dmm.TEMPERATURE&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set function to Temperature &#160;&#160; &#160;dmm.transducer = dmm.TEMP_FOURRTD&#160;&#160; &#160;&#160;&#160; &#160;-- Set sensor to 4 wire RTD &#160;&#160; &#160;dmm.fourrtd = dmm.RTD_PT100&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set RTD to PT100 &#160;&#160; &#160;dmm.units = dmm.UNITS_CELSIUS&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set units to C &#160;&#160; &#160;dmm.nplc = 2&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set NPLC &#160;&#160; &#160;dmm.configure.set(&quot;temp&quot;)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Save DMM setting to RTDtemp &#160;&#160; &#160;dmm.setconfig(&quot;1001&quot;, &quot;temp&quot;)&#160;&#160; &#160;&#160;&#160; &#160;-- Assign RTDtemp setting to channel 1 on MUX in slot 1 &#160;&#160; &#160;scan.create(&quot;1001&quot;)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Create scan list &#160;&#160; &#160;scan.measurecount = 5&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set number of repeated measurements in the scan &#160;&#160; &#160;scan.execute(tempOutput_buffer)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Execute scan and save readings to buffer &#160;&#160; &#160;--scan.background(tempOutput_buffer)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Execute backgound scan and save readings to buffer &#160;&#160; &#160;waitcomplete() end function getSensorOutput() &#160;&#160; &#160;dmm.func = dmm.DC_VOLTS&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set dmm function to Volts &#160;&#160; &#160;dmm.nplc = 2&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set NPLC &#160;&#160; &#160;dmm.range = 10&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set Range &#160;&#160; &#160;dmm.configure.set(&quot;sensor&quot;)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Save DMM setting to SensorOutput &#160;&#160; &#160;dmm.setconfig(&quot;2001:2010&quot;, &quot;sensor&quot;)&#160;&#160; &#160;-- Assign sensorOutput setting to channel 1 on MUX in slot 2 &#160;&#160; &#160;scan.create(&quot;2001:2010&quot;)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Create scan list &#160;&#160; &#160;scan.measurecount = 5&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Set number of repeated measurements on each channel &#160;&#160; &#160;scan.execute(sensorOutput_buffer)&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;-- Execute scan and save readings to buffer &#160;&#160; &#160;--scan.background(sensorOutput_buffer)&#160;&#160; &#160;&#160;&#160; &#160;-- Execute background scan and save readings to buffer &#160;&#160; &#160;waitcomplete() end getTemperature() getSensorOutput() opc() </pre> </blockquote> <pre class="linenums prettyprint"></pre> <blockquote> <pre class="linenums prettyprint"></pre> <p><br> Python script to start measurement and read the results:</p> <pre>import pyvisa as visa import time rm = visa.ResourceManager() inst = rm.open_resource('TCPIP0::192.168.10.3::inst0::INSTR') inst.read_termination = '\n' inst.write_termination = '\n' # running sweep.tsp stored on instrument inst.write('sweep.run()') script_running = True status_byte = 0 debug = 1 while script_running: &#160; &#160; status_byte = inst.read_stb() &#160; &#160; if debug: print(str(status_byte) + ' - ' + str(bin(status_byte))) # for debugging &#160; &#160; if debug: print(status_byte) # for debugging &#160; &#160; if (status_byte and 64) == 64: &#160; &#160; &#160; &#160; script_running = False &#160; &#160; time.sleep(0.25) print(inst.query('printbuffer(1, tempOutput_buffer.n, tempOutput_buffer)')) print(inst.query('printbuffer(1, sensorOutput_buffer.n, sensorOutput_buffer)'))</pre> <p></p> <p>Kind regards,&#160;</p> <p>Lars</p> </blockquote>
  • How to use the status model on a 3706A

    Hi,<br> <br> I am currently trying to set up a python script to get the results of measurement sweeps using a 3700A, but I cannot seem to get a correct understanding on how to use the registers to do this.<br> <br> I want to use the OPC() command to check if the measurements are complete, before reading the measurement buffer.<br> <br> <br> Could anyone help me understand how to do this?<br> <br> Kind regards,&#160;<br> Lars