Skip to content

Commit d165815

Browse files
authored
fix(snippet): fix all 2ch configs except bias+step (#22)
1 parent 69b180a commit d165815

File tree

1 file changed

+51
-14
lines changed

1 file changed

+51
-14
lines changed

xml-handler/src/resources/sweep/MP5000Sweep.xml

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,6 @@
3333
<substitute name="MEASURE-DELAY">%MEASURE-DELAY%</substitute>
3434
<substitute name="EFFECTIVE-FILTER-COUNT">%EFFECTIVE-FILTER-COUNT%</substitute>
3535
<snippet>
36-
---@diagnostic disable: deprecated
37-
reset(true)
38-
39-
LOGEVENTS = false
40-
41-
local lognumber = 0
42-
local function logevent(device, message)
43-
if LOGEVENTS then
44-
device.slot.trigger.model.addblock.logevent(device.trigger_model, device.trigger_model .. lognumber,
45-
device.slot.trigger.model.LOG_INFO1, device.channel_idx .. &quot;: &quot; .. message)
46-
lognumber = lognumber + 1
47-
end
48-
end
49-
5036
----------------------------------------------------------------------------
5137
-- START OF SWEEP SEGMENT ... do not modify this section
5238
----------------------------------------------------------------------------
@@ -1662,17 +1648,68 @@
16621648
</composite>
16631649

16641650
<snippet>
1651+
1652+
print(&quot;Init...&quot;)
16651653
Init(nodes)
1654+
print(&quot;Reset...&quot;)
16661655
Reset(nodes)
1656+
print(&quot;Configuring Channels...&quot;)
16671657
ConfigureChannels(nodes)
1658+
print(&quot;Configuring Trigger Model...&quot;)
16681659
ConfigureTriggerModel(nodes)
1660+
print(&quot;STEPS: &quot; .. UTILITY.STEP_COUNT .. &quot; SWEEPS: &quot; .. UTILITY.SWEEP_COUNT .. &quot; TOTAL: &quot; .. UTILITY.TOTAL_COUNT)
1661+
print(&quot;Turning on Channels...&quot;)
16691662
TurnOnChannels(nodes)
1663+
print(&quot;Initiate Trigger Model...&quot;)
16701664
InitiateTriggerModels(nodes)
1665+
print(&quot;waitcomplete...&quot;)
16711666
waitcomplete()
1667+
print(&quot;Turn Off Channels...&quot;)
16721668
TurnOffChannels(nodes)
16731669
waitcomplete()
16741670
end
16751671

16761672
_Sweep()
1673+
1674+
function iv_to_string(t)
1675+
if t == CONSTANTS.FUNC_DC_CURRENT then
1676+
return &quot;CURRENT&quot;
1677+
end
1678+
if t == CONSTANTS.FUNC_DC_VOLTAGE then
1679+
return &quot;VOLTAGE&quot;
1680+
end
1681+
end
1682+
1683+
for i, n in ipairs(nodes.biases) do
1684+
for _, buf in ipairs(n.measure.buffers) do
1685+
print()
1686+
print(&quot;----------------------&quot;)
1687+
print(&quot;- BIAS[&quot;.. i ..&quot;] &quot;.. iv_to_string(buf.type)..&quot; -&quot;)
1688+
print(&quot;----------------------&quot;)
1689+
printbuffer(1, buf.buffer.n, buf.buffer)
1690+
end
1691+
end
1692+
1693+
for i, n in ipairs(nodes.steps) do
1694+
for _, buf in ipairs(n.measure.buffers) do
1695+
print()
1696+
print(&quot;----------------------&quot;)
1697+
print(&quot;- STEP[&quot;.. i ..&quot;] &quot;.. iv_to_string(buf.type)..&quot; -&quot;)
1698+
print(&quot;----------------------&quot;)
1699+
printbuffer(1, buf.buffer.n, buf.buffer)
1700+
end
1701+
end
1702+
1703+
for i, n in ipairs(nodes.sweeps) do
1704+
for _, buf in ipairs(n.measure.buffers) do
1705+
print()
1706+
print()
1707+
print(&quot;----------------------&quot;)
1708+
print(&quot;- SWEEP[&quot;.. i ..&quot;] &quot;.. iv_to_string(buf.type)..&quot; -&quot;)
1709+
print(&quot;----------------------&quot;)
1710+
printbuffer(1, buf.buffer.n, buf.buffer)
1711+
end
1712+
end
1713+
16771714
</snippet>
16781715
</composite>

0 commit comments

Comments
 (0)