-
Notifications
You must be signed in to change notification settings - Fork 2
Raysu 2023 0519 #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Raysu 2023 0519 #162
Changes from 1 commit
3e0a632
dc342b1
cab0308
42e81ff
ddee3d2
6395069
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -459,7 +459,7 @@ function ScanFastDacSlow(instrID, start, fin, channels, numpts, delay, ramprate, | |
| RampStartFD(S, ignore_lims=1) | ||
|
|
||
| // Let gates settle | ||
| sc_sleep(S.delayy) | ||
| sc_sleep(1) | ||
|
|
||
| // Make Waves and Display etc | ||
| InitializeScan(S) | ||
|
|
@@ -475,6 +475,7 @@ function ScanFastDacSlow(instrID, start, fin, channels, numpts, delay, ramprate, | |
| sc_sleep(S.delayy) | ||
| i = 0 | ||
| do | ||
|
|
||
| rampToNextSetpoint(S, i, fastdac=1, ignore_lims=1) // Ramp x to next setpoint | ||
| sc_sleep(S.delayx) | ||
| if (s.is2d) | ||
|
|
@@ -663,8 +664,8 @@ function ScanFastDAC2D(fdID, startx, finx, channelsx, starty, finy, channelsy, n | |
|
|
||
| end | ||
|
|
||
| function Scank2400(instrID, startx, finx, channelsx, numptsx, delayx, rampratex, [y_label, comments, nosave]) //Units: mV | ||
| variable instrID, startx, finx, numptsx, delayx, rampratex, nosave | ||
| function Scank2400(instrID, startx, finx, channelsx, numptsx, delayx, rampratex, [y_label, comments, nosave, ramp]) //Units: mV | ||
| variable instrID, startx, finx, numptsx, delayx, rampratex, nosave, ramp | ||
| string channelsx, y_label, comments | ||
| //abort "WARNING: This scan has not been tested with an instrument connected. Remove this abort and test the behavior of the scan before running on a device!" | ||
|
|
||
|
|
@@ -684,10 +685,10 @@ function Scank2400(instrID, startx, finx, channelsx, numptsx, delayx, rampratex, | |
| // PreScanChecksKeithley(S) | ||
|
|
||
| // Ramp to start without checks because checked above | ||
| rampK2400Voltage(S.instrIDx, startx) | ||
| rampK2400Voltage(S.instrIDx, startx, ramprate = rampratex) | ||
|
|
||
| // Let gates settle | ||
| sc_sleep(S.delayy*20) | ||
| sc_sleep(2) | ||
|
|
||
| // Make waves and graphs etc | ||
| initializeScan(S) | ||
|
|
@@ -696,8 +697,11 @@ function Scank2400(instrID, startx, finx, channelsx, numptsx, delayx, rampratex, | |
| variable i=0, setpointx | ||
| do | ||
| setpointx = S.startx + (i*(S.finx-S.startx)/(S.numptsx-1)) | ||
| // rampK2400Voltage(S.instrIDx, setpointx, ramprate=S.rampratex) | ||
| setK2400Voltage(S.instrIDx, setpointx) | ||
| if (ramp ==1) | ||
| rampK2400Voltage(S.instrIDx, setpointx, ramprate=S.rampratex) | ||
| else | ||
| setK2400Voltage(S.instrIDx, setpointx) | ||
| endif | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not essential, but nice to keep orderly indenting. |
||
| sc_sleep(S.delayx) | ||
| RecordValues(S, i, i) | ||
| i+=1 | ||
|
|
@@ -734,11 +738,11 @@ function Scank24002D(instrIDx, startx, finx, numptsx, delayx, rampratex, instrID | |
| // PreScanChecksKeithley(S) | ||
|
|
||
| // Ramp to start without checks because checked above | ||
| rampK2400Voltage(S.instrIDx, startx) | ||
| rampK2400Voltage(S.instrIDy, starty) | ||
| rampK2400Voltage(S.instrIDx, startx, ramprate = rampratex) | ||
| rampK2400Voltage(S.instrIDy, starty, ramprate = rampratex) | ||
|
|
||
| // Let gates settle | ||
| sc_sleep(S.delayy*5) | ||
| sc_sleep(2) | ||
|
|
||
| // Make waves and graphs etc | ||
| initializeScan(S) | ||
|
|
@@ -750,7 +754,6 @@ function Scank24002D(instrIDx, startx, finx, numptsx, delayx, rampratex, instrID | |
| setpointy = S.starty + (i*(S.finy-S.starty)/(S.numptsy-1)) | ||
| rampK2400Voltage(S.instrIDy, setpointy, ramprate=S.rampratey) | ||
| rampK2400Voltage(S.instrIDx, setpointx, ramprate=S.rampratex) | ||
|
|
||
| sc_sleep(S.delayy) | ||
| j=0 | ||
| do | ||
|
|
@@ -1086,11 +1089,18 @@ function ScanMultipleK2400LS625Magnet2D(keithleyIDs, start, fin, numptsx, delayx | |
| end | ||
|
|
||
|
|
||
|
|
||
| function ScanLS625Magnet(instrID, startx, finx, numptsx, delayx, [y_label, comments, nosave]) | ||
| variable instrID, startx, finx, numptsx, delayx, nosave | ||
| function ScanLS625Magnet(instrID, startx, finx, numptsx, delayx, [y_label, comments, nosave, fast]) //set fast=1 to run quickly | ||
| variable instrID, startx, finx, numptsx, delayx, nosave, fast | ||
| string y_label, comments | ||
| //abort "WARNING: This scan has not been tested with an instrument connected. Remove this abort and test the behavior of the scan before running on a device!" | ||
|
|
||
|
|
||
| variable ramprate | ||
|
|
||
| if(paramisdefault(fast)) | ||
| fast=0 | ||
| endif | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In IGOR if the parameter is default it is already set to 0. But it is good to be explicit. |
||
|
|
||
| // Reconnect instruments | ||
| sc_openinstrconnections(0) | ||
|
|
@@ -1099,14 +1109,17 @@ function ScanLS625Magnet(instrID, startx, finx, numptsx, delayx, [y_label, comme | |
| comments = selectstring(paramisdefault(comments), comments, "") | ||
| y_label = selectstring(paramisdefault(y_label), y_label, "") | ||
|
|
||
|
|
||
|
|
||
| // Initialize ScanVars | ||
| struct ScanVars S | ||
| initScanVars(S, instrIDx=instrID, startx=startx, finx=finx, numptsx=numptsx, delayx=delayx, \ | ||
| y_label=y_label, x_label = "Field /mT", comments=comments) | ||
| y_label=y_label, comments=comments) | ||
|
|
||
|
|
||
| // Check software limits and ramprate limits | ||
| // PreScanChecksMagnet(S) | ||
| ramprate = getLS625rate(S.instrIDx) | ||
|
|
||
| // Ramp to start without checks because checked above | ||
| setlS625fieldWait(S.instrIDx, S.startx) | ||
|
|
@@ -1121,8 +1134,13 @@ function ScanLS625Magnet(instrID, startx, finx, numptsx, delayx, [y_label, comme | |
| variable i=0, setpointx | ||
| do | ||
| setpointx = S.startx + (i*(S.finx-S.startx)/(S.numptsx-1)) | ||
| setlS625fieldWait(S.instrIDx, setpointx, short_wait = 1) // Mr Ray changed this on August 04 | ||
| sc_sleep(S.delayx) | ||
| if(fast==1) | ||
| setlS625field(S.instrIDx, setpointx) | ||
| sc_sleep(max(S.delayx, (S.delayx+60*abs(finx-startx)/numptsx/ramprate))) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this math do? Looks like you have the time in minutes for a ramp to complete divided by the number of points in x. So if you take 1 data point this is the same as setlS625fieldwait(S.instrIDx, setpointx) but if you take 1e6 data points then you will start collecting data immediately?? |
||
| else | ||
| setlS625fieldwait(S.instrIDx, setpointx) | ||
| // sc_sleep(S.delayx) | ||
| endif | ||
| RecordValues(S, i, i) | ||
| i+=1 | ||
| while (i<S.numptsx) | ||
|
|
@@ -1135,7 +1153,6 @@ function ScanLS625Magnet(instrID, startx, finx, numptsx, delayx, [y_label, comme | |
| endif | ||
| end | ||
|
|
||
|
|
||
| function ScanBabyDACLS625Magnet2D(bdID, startx, finx, channelsx, numptsx, delayx, rampratex, magnetID, starty, finy, numptsy, delayy, rampratey, [startxs, finxs, y_label, comments, nosave]) //Units: mV | ||
| // Sweeps BabyDAC on x-axis and Keithley on y-axis | ||
| variable bdID, startx, finx, numptsx, delayx, rampratex, magnetID, starty, finy, numptsy, delayy, rampratey, nosave | ||
|
|
@@ -1373,15 +1390,14 @@ function ScanK2400LS625Magnet2D(keithleyID, startx, finx, numptsx, delayx, rampr | |
| do | ||
| setpointx = S.startx | ||
| setpointy = S.starty + (i*(S.finy-S.starty)/(S.numptsy-1)) | ||
| setlS625fieldWait(S.instrIDy, setpointy) | ||
| setlS625field(S.instrIDy, setpointy) | ||
| rampK2400Voltage(S.instrIDx, setpointx, ramprate=S.rampratex) | ||
| // setK2400Voltage(S.instrIDy, setpointy) | ||
|
|
||
| setlS625fieldWait(S.instrIDy, setpointy, short_wait = 1) | ||
| sc_sleep(S.delayy) | ||
| j=0 | ||
| do | ||
| setpointx = S.startx + (j*(S.finx-S.startx)/(S.numptsx-1)) | ||
| rampK2400Voltage(S.instrIDx, setpointx, ramprate=S.rampratex) | ||
| setK2400Voltage(S.instrIDx, setpointx) | ||
| sc_sleep(S.delayx) | ||
| RecordValues(S, i, j) | ||
| j+=1 | ||
|
|
@@ -1416,7 +1432,7 @@ function ScanSRSFrequency(instrID, startx, finx, numptsx, delayx, nosave) | |
| SetSRSFrequency(S.instrIDx,startx) | ||
|
|
||
| // Let gates settle | ||
| sc_sleep(S.delayy*10) | ||
| sc_sleep(2) | ||
|
|
||
| // Make waves and graphs etc | ||
| initializeScan(S) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,6 +247,18 @@ function AutoSRSPhase(instrID) // Units: deg | |
| writeInstr(instrID, "APHS \n") | ||
| end | ||
|
|
||
| function AutoSRSSens(instrID) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Write a comment on what this function does. |
||
| variable instrID | ||
| string response | ||
|
|
||
|
|
||
| writeInstr(instrID, "AGAN \n") | ||
| do | ||
| response = queryInstr(instrID, "*STB? \n") | ||
| asleep(0.5) | ||
| while (str2num(response) < 1) | ||
| end | ||
|
|
||
| function SetSRSreadout(instrID, readout, [ch, ratio]) //e.g. for Ch1: readout 0 = x, 1 = r, 2 = xnoise etc | ||
| variable instrID, readout | ||
| variable ch, ratio | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is probably better to keep delayy instead of hard coding a 2 second sleep. It would be better to add an optional parameter to Scank2400 that allows you to set delayy and if not set will use default of 2.