show as live image

master
Eggert Jung 3 years ago
parent 2648bfd6c4
commit 1a5fe6e49b

@ -25,6 +25,9 @@ import struct
import math import math
import time import time
import numpy as np
from matplotlib import pyplot
echoCmd = 0 echoCmd = 0
def instrConnect(mySocket, myAddress, myPort, timeOut, doReset, doIdQuery): def instrConnect(mySocket, myAddress, myPort, timeOut, doReset, doIdQuery):
@ -65,19 +68,6 @@ def Write_Data(output_data_path, dataStr):
return return
#def Configure_4WO_Scan(s, scan_channels, scan_count):
# instrSend(s, "reset()")
# instrSend(s, "dmm.func = \"fourwireohms\"")
#
# instrSend(s, "dmm.autorange = dmm.OFF")
# instrSend(s, "dmm.range = 100")
# instrSend(s, 'dmm.setconfig("slot1", "fourwireohms")')
# 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
def Configure_Backplane(s): def Configure_Backplane(s):
instrSend(s, "reset()") instrSend(s, "reset()")
instrSend(s, "dmm.func = \"fourwireohms\"") instrSend(s, "dmm.func = \"fourwireohms\"")
@ -124,23 +114,21 @@ t1 = time.time() # Start the timer...
Configure_Backplane(s) Configure_Backplane(s)
#print(instrQuery(s, 'print(channel.getclose("allslots"))', 64)[:-1]) a = np.zeros(shape=(90, 90))
#instrSend(s, 'channel.exclusiveclose("2029")') pyplot.ion()
#instrSend(s, 'channel.close("3059")') fig, ax = pyplot.subplots()
#print(instrQuery(s, 'print(channel.getclose("allslots"))', 64)[:-1]) axim = ax.imshow(a, interpolation='nearest', cmap='gray', vmin=0, vmax=30)
x = 0
y = 0
print() print()
for ch1 in [*range(1001, 1031)] + [*range(2001, 2031)] + [*range(3001, 3031)]: for ch1 in [*range(1001, 1031)] + [*range(2001, 2031)] + [*range(3001, 3031)]:
for ch2 in [*range(1031, 1061)] + [*range(2031, 2061)] + [*range(3031, 3061)]: for ch2 in [*range(1031, 1061)] + [*range(2031, 2061)] + [*range(3031, 3061)]:
print(diff_4W_mess(s, ch1, ch2), end='\t') a[x][y]=diff_4W_mess(s, ch1, ch2)
print() axim.set_data(a)
fig.canvas.flush_events()
#print("steps: {}".format(channelcount)) y+=1
# x+=1
#while(int(float(instrQuery(s, "scanState, scanCount, stepCount = scan.state(); print(scanState)", 255))) != 6):
# time.sleep(0.1)
#
#print(instrQuery(s, "printbuffer(0, reading_buffer.n, reading_buffer)", 2048))
# Close the socket connection # Close the socket connection
instrDisconnect(s) instrDisconnect(s)

Loading…
Cancel
Save