Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 40 additions & 24 deletions Required/Scans.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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!"

Expand All @@ -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)
Copy link
Member

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.

sc_sleep(2)

// Make waves and graphs etc
initializeScan(S)
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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


Copy link
Member

Choose a reason for hiding this comment

The 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.
A nice 1 liner would be:
fast = paramisdefault(fast) ? 1 : fast


// Reconnect instruments
sc_openinstrconnections(0)
Expand All @@ -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)
Expand All @@ -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)))
Copy link
Member

Choose a reason for hiding this comment

The 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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions Required/ls625_single_supply.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ function openLS625connection(instrVarName, visa_address, amps_per_tesla, max_fie

string comm = ""
sprintf comm, "name=LS625,instrID=%s,visa_address=%s" instrVarName, visa_address
// string options = "baudrate=57600,databits=7,stopbits=1,parity=1,test_query=*IDN?"
string options = "test_query=*IDN?"
//string options = "baudrate=57600,databits=7,stopbits=1,parity=1,test_query=*IDN?"
string options = "baudrate=57600,databits=7,parity=1,test_query=*IDN?"
//string options = "test_query=*IDN?"

openVISAinstr(comm, options=options, localRM=localRM, verbose=verbose)

Expand Down
12 changes: 12 additions & 0 deletions Required/srs830.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ function AutoSRSPhase(instrID) // Units: deg
writeInstr(instrID, "APHS \n")
end

function AutoSRSSens(instrID)
Copy link
Member

Choose a reason for hiding this comment

The 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
Expand Down
Loading