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