|
84 | 84 |
|
85 | 85 | ---@class Source |
86 | 86 | ---@field values ScalarValue | LogValues | LinearValues | ListValues The value or values to source |
87 | | - ---@field range number | "AUTO" The range to use, or Auto |
| 87 | + ---@field range number | "AUTO" The range to use, or Auto |
88 | 88 | ---@field limiti number The current limit |
89 | 89 | ---@field limitv number | nil The voltage limit |
90 | 90 | ---@field delay number The time to delay before sourcing |
|
98 | 98 | ---@field nplc number | nil |
99 | 99 | ---@field aperture number | nil |
100 | 100 | ---@field rate `CONSTANTS.RATE_FAST` | `CONSTANTS.RATE_NORMAL` | nil |
101 | | - ---@field range number | "AUTO" The range to use, or Auto |
| 101 | + ---@field range number | "AUTO" The range to use, or Auto |
102 | 102 | -- ---@field autozero boolean Whether autozero should be turned on or not |
103 | 103 | ---@field count integer The number of measurments to take |
104 | 104 | -- ---@field filter_enable boolean Whether to enable the filter or not |
|
147 | 147 | ---@class ModelComponent |
148 | 148 | ---@field reset fun(self: Device) The function used to reset the device |
149 | 149 | ---@field config fun(self: Device) The function used to configure the device settings |
150 | | - ---@field trigger_model_setup fun(self: Device) The function used to set up the trigger model |
| 150 | + ---@field trigger_model_setup fun(self: Device, bias_source_event: any | nil, bias_measure_event: any| nil, step_source_event: any | nil, step_measure_event: any | nil, sweep_source_event: any | nil, sweep_measure_event: any | nil, bias_source_complete_events: any[] | nil, bias_measure_complete_events: any[] | nil) The function used to set up the trigger model |
151 | 151 | ---@field trigger_model_initiate fun(self: Device) The function used to initiate the trigger model |
152 | 152 |
|
153 | 153 | UTILITY = { |
|
268 | 268 |
|
269 | 269 | ---Functions for the MSMU60-2 module for MP5000-series mainframes |
270 | 270 | ---@return Model |
271 | | - MSMU60_2 = function() |
| 271 | + MSMU = function() |
272 | 272 | return { |
273 | 273 | common = { |
274 | 274 | --- Resets this MSMU60-2 |
|
282 | 282 | self.node.trigger.timer[2].reset() |
283 | 283 | self.node.trigger.timer[3].reset() |
284 | 284 | self.node.trigger.timer[4].reset() |
285 | | - --for _, v in ipairs(self.slot.trigger.model.table()) do |
286 | 285 | self.slot.trigger.model.abort() |
287 | 286 | self.slot.trigger.model.delete(self.node_name .. " Bias Trigger Model") |
288 | 287 | self.slot.trigger.model.delete(self.node_name .. " Step Trigger Model") |
289 | 288 | self.slot.trigger.model.delete(self.node_name .. " Sweep Trigger Model") |
290 | | - -- self.slot.trigger.model.delete(v) |
291 | | - --end |
292 | 289 | end, |
293 | 290 | --- Configures this MSMU60-2 |
294 | 291 | ---@param self Device |
|
524 | 521 | end |
525 | 522 |
|
526 | 523 | -- Loop back to `bias_wait_sweep_block` until all iterations are complete |
527 | | - if sweep_measure_event ~= nil then |
| 524 | + if step_measure_event ~= nil then |
528 | 525 | tm_add.branch.counter(self.trigger_model, block.loop, |
529 | | - block.wait_sweep, |
| 526 | + block.bias_notify, |
530 | 527 | UTILITY.TOTAL_COUNT) |
531 | | - elseif step_measure_event ~= nil then |
| 528 | + elseif sweep_measure_event ~= nil then |
532 | 529 | tm_add.branch.counter(self.trigger_model, block.loop, |
533 | | - block.bias_notify, |
| 530 | + block.wait_sweep, |
534 | 531 | UTILITY.TOTAL_COUNT) |
535 | 532 | end |
536 | 533 | end, |
|
580 | 577 |
|
581 | 578 | if step_source_complete_events ~= nil and table.getn(step_source_complete_events) > 0 then |
582 | 579 | -- Add an optional wait for other sweep events only on the first stepper |
583 | | - --logevent(self, "WAIT ALL STEPS") |
584 | 580 | UTILITY.make_waitall(self.slot.trigger.model, self.trigger_model, |
585 | 581 | block.waitall_steps, |
586 | 582 | step_source_complete_events) |
|
739 | 735 | } |
740 | 736 | end, |
741 | 737 |
|
742 | | - ---Functions for the MPSU-2ST module for MP5000-series mainframes |
| 738 | + ---Functions for MPSU modules for MP5000-series mainframes |
743 | 739 | ---@return Model |
744 | | - MPSU50_2ST = function() |
| 740 | + MPSU = function() |
745 | 741 | return { |
746 | 742 | common = { |
747 | | - --- Resets this MPSU50_2ST |
| 743 | + --- Resets this MPSU |
748 | 744 | ---@param self Device |
749 | 745 | reset = function(self) |
750 | 746 | self.channel.reset() |
|
755 | 751 | self.node.trigger.timer[2].reset() |
756 | 752 | self.node.trigger.timer[3].reset() |
757 | 753 | self.node.trigger.timer[4].reset() |
758 | | - --for _, v in ipairs(self.slot.trigger.model.table()) do |
759 | 754 | self.slot.trigger.model.abort() |
760 | | - -- self.slot.trigger.model.delete(v) |
761 | | - --end |
762 | 755 | end, |
763 | | - --- Configures this MPSU50_2ST |
| 756 | + --- Configures this MPSU |
764 | 757 | ---@param self Device |
765 | 758 | config = function(self) |
766 | 759 | UTILITY.init_slot_event_ids(self.slot, { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }) |
767 | | - |
768 | 760 |
|
769 | | - local event_id = UTILITY.get_slot_event_id(self.slot) |
770 | | - if event_id then |
771 | | - self.event_source = event_id |
| 761 | + local event_source_id = UTILITY.get_slot_event_id(self.slot) |
| 762 | + if event_source_id then |
| 763 | + self.event_source = event_source_id |
772 | 764 | else |
773 | | - error("Unable to assign event ID to channel: all event IDs for slot[" .. |
| 765 | + error("Unable to assign event source ID to channel: all event IDs for slot[" .. |
774 | 766 | self.slot_idx .. "] have been consumed.") |
775 | 767 | exit() |
776 | 768 | end |
777 | 769 |
|
778 | | - event_id = UTILITY.get_slot_event_id(self.slot) |
779 | | - if event_id then |
780 | | - self.event_measure = event_id |
| 770 | + local event_measure_id = UTILITY.get_slot_event_id(self.slot) |
| 771 | + if event_measure_id then |
| 772 | + self.event_measure = event_measure_id |
781 | 773 | else |
782 | | - error("Unable to assign event ID to channel: all event IDs for slot[" .. |
| 774 | + error("Unable to assign event measure ID to channel: all event IDs for slot[" .. |
783 | 775 | self.slot_idx .. "] have been consumed.") |
784 | 776 | exit() |
785 | 777 | end |
786 | 778 |
|
| 779 | + |
787 | 780 | -- Source Settings -- |
788 | 781 | -- func, level/list/log/linear |
789 | 782 | if self.source.values.scalar ~= nil then |
|
865 | 858 | bias = { |
866 | 859 | --- Configure the trigger model for a Bias |
867 | 860 | ---@param self Device |
868 | | - ---@param bias_event nil Unused |
869 | | - ---@param step_event any | nil The event ID associated with all the steps completing (only one) |
870 | | - ---@param sweep_event any | nil The event ID associated with all the sweep steps completing (only one) |
871 | | - ---@param bias_complete_events any[] | nil The event ID(s) associated with all other bias steps completing. Should only be passed to one bias channel. |
872 | | - trigger_model_setup = function(self, bias_event, step_event, sweep_event, bias_complete_events) |
| 861 | + ---@param bias_source_event nil Unused |
| 862 | + ---@param bias_measure_event nil Unused |
| 863 | + ---@param step_source_event any | nil The event ID associated with all the steps completing source actions (only one) |
| 864 | + ---@param step_measure_event any | nil The event ID associated with all the steps completing measure actions (only one) |
| 865 | + ---@param sweep_source_event any | nil The event ID associated with all the sweep steps completing source actions (only one) |
| 866 | + ---@param sweep_measure_event any | nil The event ID associated with all the sweep steps completing measure actions (only one) |
| 867 | + ---@param bias_source_complete_events any[] | nil The event ID(s) associated with all other bias source-action steps completing. Should only be passed to one bias channel. |
| 868 | + ---@param bias_measure_complete_events any[] | nil The event ID(s) associated with all other bias measure-action steps completing. Should only be passed to one bias channel. |
| 869 | + trigger_model_setup = function(self, bias_source_event, bias_measure_event, step_source_event, |
| 870 | + step_measure_event, sweep_source_event, sweep_measure_event, |
| 871 | + bias_source_complete_events, bias_measure_complete_events) |
| 872 | + UTILITY.MSMU().bias.trigger_model_setup(self, bias_source_event, bias_measure_event, |
| 873 | + step_source_event, step_measure_event, sweep_source_event, sweep_measure_event, |
| 874 | + bias_source_complete_events, bias_measure_complete_events) |
873 | 875 | end, |
874 | 876 | }, |
875 | 877 | step = { |
876 | 878 | --- Configure the trigger model for a Step |
877 | 879 | ---@param self Device |
878 | | - ---@param bias_event any The event that indicates the biases are fully started. |
879 | | - ---@param step_event nil Unused |
880 | | - ---@param sweep_event any The event that indicates the sweepsare fully started. |
881 | | - ---@param step_complete_events any[] | nil The event ID(s) associated with all other steps completing. Should only be passed to one bias channel. |
882 | | - trigger_model_setup = function(self, bias_event, step_event, sweep_event, step_complete_events) |
| 880 | + ---@param bias_source_event any|nil The event ID associated with all the biases completing source actions (only one) |
| 881 | + ---@param bias_measure_event any | nil The event ID associated with all the biases completing measure actions (only one) |
| 882 | + ---@param step_source_event nil Unused |
| 883 | + ---@param step_measure_event nil Unused |
| 884 | + ---@param sweep_source_event any | nil The event ID associated with all the sweep steps completing source actions (only one) |
| 885 | + ---@param sweep_measure_event any | nil The event ID associated with all the sweep steps completing measure actions (only one) |
| 886 | + ---@param step_source_complete_events any[] | nil The event ID(s) associated with all other source-action steps completing. Should only be passed to one bias channel. |
| 887 | + ---@param step_measure_complete_events any[] | nil The event ID(s) associated with all other measure-action steps completing. Should only be passed to one bias channel. |
| 888 | + trigger_model_setup = function(self, bias_source_event, bias_measure_event, step_source_event, |
| 889 | + step_measure_event, sweep_source_event, sweep_measure_event, |
| 890 | + step_source_complete_events, step_measure_complete_events) |
| 891 | + UTILITY.MSMU().step.trigger_model_setup(self, bias_source_event, bias_measure_event, |
| 892 | + step_source_event, step_measure_event, sweep_source_event, sweep_measure_event, |
| 893 | + step_source_complete_events, step_measure_complete_events) |
883 | 894 | end, |
884 | 895 | }, |
885 | 896 |
|
886 | 897 | sweep = { |
887 | 898 | --- Configure the trigger model for a Step |
888 | 899 | ---@param self Device |
889 | | - ---@param bias_event any |
890 | | - ---@param step_event any |
891 | | - ---@param sweep_event nil Unused |
892 | | - ---@param sweep_complete_events any |
893 | | - trigger_model_setup = function(self, bias_event, step_event, sweep_event, sweep_complete_events) |
| 900 | + ---@param bias_source_event any|nil The event ID associated with all the biases completing source actions (only one) |
| 901 | + ---@param bias_measure_event any | nil The event ID associated with all the biases completing measure actions (only one) |
| 902 | + ---@param step_source_event any | nil The event ID associated with all the steps completing source actions (only one) |
| 903 | + ---@param step_measure_event any | nil The event ID associated with all the steps completing measure actions (only one) |
| 904 | + ---@param sweep_source_event nil Unused |
| 905 | + ---@param sweep_measure_event nil Unused |
| 906 | + ---@param sweep_source_complete_events any |
| 907 | + ---@param sweep_measure_complete_events any |
| 908 | + trigger_model_setup = function(self, bias_source_event, bias_measure_event, step_source_event, |
| 909 | + step_measure_event, sweep_source_event, sweep_measure_event, |
| 910 | + sweep_source_complete_events, sweep_measure_complete_events) |
| 911 | + UTILITY.MSMU().sweep.trigger_model_setup(self, bias_source_event, bias_measure_event, |
| 912 | + step_source_event, step_measure_event, sweep_source_event, sweep_measure_event, |
| 913 | + sweep_source_complete_events, sweep_measure_complete_events) |
894 | 914 | end, |
895 | 915 |
|
896 | 916 | }, |
|
901 | 921 | ---@param device DeviceDetails |
902 | 922 | ---@return Model | nil, "smu" | "psu" | nil |
903 | 923 | get_model_from_device = function(device) |
904 | | - -- XXX: DEBUG ONLY, REMOVE MSMU200-2 |
905 | | - if device.model == "MSMU60-2" then |
906 | | - return UTILITY.MSMU60_2(), "smu" |
| 924 | + if string.find(device.model, "MSMU") ~= nil then |
| 925 | + return UTILITY.MSMU(), "smu" |
907 | 926 | end |
908 | | - if device.model == "MPSU50-2ST" then |
909 | | - return UTILITY.MPSU50_2ST(), "psu" |
| 927 | + if string.find(device.model, "MPSU") ~= nil then |
| 928 | + return UTILITY.MPSU(), "psu" |
910 | 929 | end |
911 | 930 | return nil, nil |
912 | 931 | end, |
|
1279 | 1298 |
|
1280 | 1299 | for i, n in ipairs(nodes.biases) do |
1281 | 1300 | for _, buf in ipairs(n.measure.buffers) do |
1282 | | - table.insert(buffers, { heading = "Bias[" .. i .. "]." .. iv_to_string(buf.type), buffer = buf.buffer }) |
| 1301 | + table.insert(buffers, { heading = "bias[" .. i .. "]." .. iv_to_string(buf.type), buffer = buf.buffer }) |
1283 | 1302 | end |
1284 | 1303 | end |
1285 | 1304 |
|
1286 | 1305 | for i, n in ipairs(nodes.steps) do |
1287 | 1306 | for _, buf in ipairs(n.measure.buffers) do |
1288 | | - table.insert(buffers, { heading = "Step[" .. i .. "]." .. iv_to_string(buf.type), buffer = buf.buffer }) |
| 1307 | + table.insert(buffers, { heading = "step[" .. i .. "]." .. iv_to_string(buf.type), buffer = buf.buffer }) |
1289 | 1308 | end |
1290 | 1309 | end |
1291 | 1310 |
|
|
1298 | 1317 | print_table_from_buffers(buffers) |
1299 | 1318 | end |
1300 | 1319 |
|
| 1320 | + |
1301 | 1321 | --#endregion Util |
1302 | 1322 |
|
1303 | 1323 | --========================================================================== |
|
1530 | 1550 | <substitute name="SWEEP-DEVICE:SRANGE">%SRANGE%</substitute> |
1531 | 1551 | <substitute name="SWEEP-DEVICE:START">%START%</substitute> |
1532 | 1552 | <substitute name="SWEEP-DEVICE:STOP">%STOP%</substitute> |
1533 | | - <substitute name="SWEEP-DEVICE:LIST">%LIST%</substitute> |
| 1553 | + <substitute name="SWEEP-DEVICE:LIST">%LIST%</substitute> |
1534 | 1554 | <substitute name="SWEEP-DEVICE:MRANGE">%MRANGE%</substitute> |
1535 | 1555 | <substitute name="SWEEP-DEVICE:MFUNCTION">%MFUNCTION%</substitute> |
1536 | 1556 | <substitute name="SWEEP-DEVICE:SENSE">%SENSE%</substitute> |
|
0 commit comments