roughly working differential measuring

master
Eggert Jung 3 years ago
parent 43ca2adc56
commit d5a528115f

@ -18,6 +18,8 @@
==================================================================================================== ====================================================================================================
""" """
## channel.exclusiveclose(
import socket import socket
import struct import struct
import math import math
@ -70,12 +72,26 @@ def Configure_4WO_Scan(s, scan_channels, scan_count):
instrSend(s, "dmm.autorange = dmm.OFF") instrSend(s, "dmm.autorange = dmm.OFF")
instrSend(s, "dmm.range = 100") instrSend(s, "dmm.range = 100")
instrSend(s, 'dmm.setconfig("slot1", "fourwireohms")') # instrSend(s, 'dmm.setconfig("slot1", "fourwireohms")')
# excluveclose
instrSend(s, "scan.create(\"{0}\")".format(scan_channels)) # Create the scan instrSend(s, 'channel.setbackplane("1001:1030", "1913")')
instrSend(s, "scan.scancount = {0}".format(scan_count)) # Set the Scan Count instrSend(s, 'channel.setbackplane("1031:1060", "1924")')
instrSend(s, "reading_buffer = dmm.makebuffer(scan.scancount * scan.stepcount)") # Configure Buffer
instrSend(s, "scan.background(reading_buffer)") # Execute Scan and save to buffer instrSend(s, 'channel.open("allslots")')
instrSend(s, 'channel.close("1015")')
instrSend(s, 'channel.close("1037")')
instrSend(s, 'closedSlot5 = channel.getclose("slot1")')
instrQuery(s, "print(closedSlot5)", 64)
instrSend(s, "dmm.measure()")
# instrQuery(s, "print(dmm.measure())", 64)
#instrSend(s, "scan.create(\"{0}\")".format(scan_channels)) # Create the scan
#instrSend(s, "scan.scancount = {0}".format(scan_count)) # Set the Scan Count
#instrSend(s, "reading_buffer = dmm.makebuffer(scan.scancount * scan.stepcount)") # Configure Buffer
#instrSend(s, "scan.background(reading_buffer)") # Execute Scan and save to buffer
return return
@ -189,29 +205,31 @@ scaninterval = 1 # Delay between the start of each scan (if n
Configure_4WO_Scan(s, scanchannels, scancount) Configure_4WO_Scan(s, scanchannels, scancount)
expectedCnt = 30 #expectedCnt = 30
channelcount = int(float(instrQuery(s, "print(scan.stepcount)", 64))) #channelcount = int(float(instrQuery(s, "print(scan.stepcount)", 64)))
startindex = 1 #startindex = 1
endindex = channelcount #endindex = channelcount
total_readings_count = 0 #total_readings_count = 0
target = channelcount * scancount #target = channelcount * scancount
cntr = 1 #cntr = 1
# Extract readings while the scan is running....
while(total_readings_count < target):
vals = int(float(instrQuery(s, "print(reading_buffer.n)", 16))) ## Extract readings while the scan is running....
#while(total_readings_count < target):
while(vals < endindex): # vals = int(float(instrQuery(s, "print(reading_buffer.n)", 16)))
time.sleep(0.1) #
vals = int(float(instrQuery(s, "print(reading_buffer.n)", 16))) # while(vals < endindex):
# time.sleep(0.1)
data_string = instrQuery(s, "printbuffer({},{}, reading_buffer.readings)".format(startindex, endindex), 2048) # vals = int(float(instrQuery(s, "print(reading_buffer.n)", 16)))
print("Scan {0:4} : {1}".format(cntr, data_string)) #
Write_Data(output_data_path, data_string) # data_string = instrQuery(s, "printbuffer({},{}, reading_buffer.readings)".format(startindex, endindex), 2048)
startindex += channelcount # print("Scan {0:4} : {1}".format(cntr, data_string))
endindex += channelcount # Write_Data(output_data_path, data_string)
total_readings_count += channelcount # startindex += channelcount
cntr += 1 # endindex += channelcount
# total_readings_count += channelcount
# cntr += 1
# Close the socket connection # Close the socket connection

Loading…
Cancel
Save