|
8 | 8 | import xml.etree.ElementTree as ET |
9 | 9 | import zipfile as zf |
10 | 10 | from functools import partial |
11 | | -from typing import TYPE_CHECKING, Any |
| 11 | +from typing import TYPE_CHECKING, Any, Literal, Self |
12 | 12 |
|
13 | 13 | import numpy as np |
14 | 14 | import numpy.typing as npt |
@@ -191,15 +191,26 @@ def __init__( |
191 | 191 | if channel not in list(range(1, num_channels + 1)): |
192 | 192 | raise ValueError("Illegal channel value.") |
193 | 193 |
|
194 | | - self.state: Parameter = self.add_parameter( |
| 194 | + self.state: Parameter[int, Self] = self.add_parameter( |
195 | 195 | "state", |
196 | 196 | label=f"Channel {channel} state", |
197 | 197 | get_cmd=f"OUTPut{channel}:STATe?", |
198 | 198 | set_cmd=f"OUTPut{channel}:STATe {{}}", |
199 | 199 | vals=vals.Ints(0, 1), |
200 | 200 | get_parser=int, |
201 | 201 | ) |
202 | | - """Parameter state""" |
| 202 | + """Channel State: (OFF: 0, ON: 1)""" |
| 203 | + |
| 204 | + self.hold: Parameter[Literal["FIRST", "ZERO"], Self] = self.add_parameter( |
| 205 | + "hold", |
| 206 | + label=f"Channel {channel} hold value", |
| 207 | + get_cmd=f"OUTPut{channel}:WVALUE:ANALOG:STATE?", |
| 208 | + set_cmd=f"OUTPut{channel}:WVALUE:ANALOG:STATE {{}}", |
| 209 | + vals=vals.Enum("FIRST", "ZERO"), |
| 210 | + ) |
| 211 | + """ the output condition of a waveform of the specified |
| 212 | + channel to hold while the instrument is in the waiting-for-trigger state. |
| 213 | + ZERO = 0V, FIRST = first value of next sequence""" |
203 | 214 |
|
204 | 215 | ################################################## |
205 | 216 | # FGEN PARAMETERS |
@@ -587,6 +598,14 @@ def __init__( |
587 | 598 | ) |
588 | 599 | """Parameter all_output_off""" |
589 | 600 |
|
| 601 | + self.force_jump: Parameter[int, Self] = self.add_parameter( |
| 602 | + "force_jump", |
| 603 | + label="Force Jump", |
| 604 | + set_cmd="SOURCE1:JUMP:FORCE {}", |
| 605 | + vals=vals.Ints(1, 16383), |
| 606 | + ) |
| 607 | + """Parameter force_jump""" |
| 608 | + |
590 | 609 | add_channel_list = self.num_channels > 2 |
591 | 610 | # We deem 2 channels too few for a channel list |
592 | 611 | if add_channel_list: |
@@ -619,6 +638,23 @@ def __init__( |
619 | 638 |
|
620 | 639 | self.connect_message() |
621 | 640 |
|
| 641 | + def set_event_jump( |
| 642 | + self, sequence_name: str, current_step: int, next_step: int |
| 643 | + ) -> None: |
| 644 | + """ |
| 645 | + Set event jump for a given step in the sequence |
| 646 | +
|
| 647 | + Args: |
| 648 | + sequence_name: The name of the sequence |
| 649 | + current_step: The step number in the sequence (1-indexed) |
| 650 | + next_step: The step number to jump to (1-indexed) |
| 651 | +
|
| 652 | + """ |
| 653 | + |
| 654 | + self.write( |
| 655 | + f"SLISt:SEQuence:STEP{current_step}:EJUMp {sequence_name}, {next_step}" |
| 656 | + ) |
| 657 | + |
622 | 658 | def force_triggerA(self) -> None: |
623 | 659 | """ |
624 | 660 | Force a trigger A event |
|
0 commit comments