|
11 | 11 | # # |
12 | 12 | ##################################################################### |
13 | 13 |
|
14 | | -__version__ = '1.1.0' |
| 14 | +__version__ = '1.2.0' |
15 | 15 |
|
16 | 16 |
|
17 | 17 | from labscript import ( |
@@ -64,6 +64,8 @@ class NI_DAQmx(IntermediateDevice): |
64 | 64 | "AI_start_delay_ticks", |
65 | 65 | "AI_term", |
66 | 66 | "AI_chans", |
| 67 | + "AI_timebase_terminal", |
| 68 | + "AI_timebase_rate", |
67 | 69 | "AO_range", |
68 | 70 | "max_AI_multi_chan_rate", |
69 | 71 | "max_AI_single_chan_rate", |
@@ -102,6 +104,8 @@ def __init__( |
102 | 104 | AI_start_delay_ticks=None, |
103 | 105 | AI_term='RSE', |
104 | 106 | AI_term_cfg=None, |
| 107 | + AI_timebase_terminal=None, |
| 108 | + AI_timebase_rate=None, |
105 | 109 | AO_range=None, |
106 | 110 | max_AI_multi_chan_rate=None, |
107 | 111 | max_AI_single_chan_rate=None, |
@@ -154,6 +158,12 @@ def __init__( |
154 | 158 | AI_term_cfg (dict, optional): Dictionary of analog input channels and their |
155 | 159 | supported terminations. Best to use `get_capabilities.py` to introspect |
156 | 160 | these. |
| 161 | + AI_timebase_terminal (str, optional): Channel string that specifies what |
| 162 | + channel to use for the Sample Clock Timebase signal. |
| 163 | + If None, use default internal clocks. |
| 164 | + Must also specify the rate when not using the internal sources. |
| 165 | + AI_timebase_rate (float, optional): Supplied clock frequency for the AI timebase. |
| 166 | + Only specify if using an external clock source. |
157 | 167 | AO_range (iterable, optional): A `[Vmin, Vmax]` pair that sets the analog |
158 | 168 | output voltage range for all analog outputs. |
159 | 169 | max_AI_multi_chan_rate (float, optional): Max supported analog input |
@@ -250,6 +260,13 @@ def __init__( |
250 | 260 | # no analog inputs |
251 | 261 | self.AI_chans = [] |
252 | 262 | self.start_delay_ticks = None |
| 263 | + # special AI timebase handling |
| 264 | + if num_AI > 0: |
| 265 | + if (AI_timebase_rate is None) ^ (AI_timebase_terminal is None): |
| 266 | + raise LabscriptError("You must specify terminal and rate when using an external AI timebase") |
| 267 | + self.AI_timebase_terminal = AI_timebase_terminal |
| 268 | + self.AI_timebease_rate = AI_timebase_rate |
| 269 | + |
253 | 270 | self.num_AO = num_AO |
254 | 271 | self.num_CI = num_CI |
255 | 272 | self.ports = ports if ports is not None else {} |
|
0 commit comments