zhinst-core 25.10.0.274__cp314-cp314-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of zhinst-core might be problematic. Click here for more details.

@@ -0,0 +1,1486 @@
1
+ """LabOne core API."""
2
+
3
+ from typing import (
4
+ List,
5
+ Union,
6
+ overload,
7
+ Any,
8
+ Dict,
9
+ Optional,
10
+ Tuple,
11
+ TypeAlias,
12
+ )
13
+
14
+ # typing.Literal requires Python 3.8+
15
+ from typing_extensions import Literal
16
+ from enum import Enum
17
+ import numpy as np
18
+
19
+ __version__: str
20
+
21
+ LabOneResultAny: TypeAlias = Any
22
+ LabOneResultNested: TypeAlias = Dict[str, Union[LabOneResultNested, LabOneResultAny]]
23
+
24
+ _STUB_VERSION_HASH = "cab58d6d54c65423de6d43a7ee796431"
25
+
26
+ class ziListEnum(Enum):
27
+ """Enumeration for listNodes."""
28
+
29
+ absolute: int
30
+ """Returns absolute paths."""
31
+ all: int
32
+ """Default flag, returning a simple listing of the given node."""
33
+ basechannel: int
34
+ """Returns only one instance of a node in case of multiple channels."""
35
+ excludestreaming: int
36
+ """Excludes streaming nodes."""
37
+ excludevectors: int
38
+ """Excludes vector nodes."""
39
+ getonly: int
40
+ """Returns only nodes which can be used with the get command."""
41
+ leavesonly: int
42
+ """Returns only nodes that are leaves, which means the they are at the outermost level of the tree."""
43
+ recursive: int
44
+ """Returns the nodes recursively."""
45
+ settingsonly: int
46
+ """Returns only nodes which are marked as setting."""
47
+ streamingonly: int
48
+ """Returns only streaming nodes."""
49
+ subscribedonly: int
50
+ """Returns only subscribed nodes."""
51
+
52
+ class ModuleBase:
53
+ def clear(self) -> None:
54
+ """End the module thread."""
55
+
56
+ def execute(self) -> None:
57
+ """Start the module execution.
58
+
59
+ Subscribing or unsubscribing is not possible until the execution is
60
+ finished."""
61
+
62
+ def finish(self) -> None:
63
+ """Stop the execution.
64
+
65
+ The execution may be restarted by calling 'execute' again."""
66
+
67
+ def finished(self) -> bool:
68
+ """Check if the execution has finished.
69
+
70
+ Returns:
71
+ Flag if the execution is finished."""
72
+
73
+ @overload
74
+ def get(self, path: str, *, flat: Literal[False] = False) -> LabOneResultNested:
75
+ """Return a dict with all nodes from the specified sub-tree.
76
+
77
+ Args:
78
+ path: Path string of the node. Use wild card to select all.
79
+ flat: Specify which type of data structure to return.
80
+ Return data either as a flat dict (True) or as a nested
81
+ dict tree (False). Default = False.
82
+
83
+ Returns:
84
+ A dict with all nodes from the specified sub-tree."""
85
+
86
+ @overload
87
+ def get(self, path: str, *, flat: Literal[True]) -> Dict[str, LabOneResultAny]:
88
+ """Return a dict with all nodes from the specified sub-tree.
89
+
90
+ Args:
91
+ path: Path string of the node. Use wild card to select all.
92
+ flat: Specify which type of data structure to return.
93
+ Return data either as a flat dict (True) or as a nested
94
+ dict tree (False). Default = False.
95
+
96
+ Returns:
97
+ A dict with all nodes from the specified sub-tree."""
98
+
99
+ def get(self, path: str, *, flat: bool = False) -> LabOneResultNested:
100
+ """Return a dict with all nodes from the specified sub-tree.
101
+
102
+ Args:
103
+ path: Path string of the node. Use wild card to select all.
104
+ flat: Specify which type of data structure to return.
105
+ Return data either as a flat dict (True) or as a nested
106
+ dict tree (False). Default = False.
107
+
108
+ Returns:
109
+ A dict with all nodes from the specified sub-tree."""
110
+
111
+ def getDouble(self, path: str) -> float:
112
+ """Get a double value from the specified node.
113
+
114
+ Args:
115
+ path: Path string of the node.
116
+
117
+ Returns:
118
+ Floating point double value."""
119
+
120
+ def getInt(self, path: str) -> int:
121
+ """Get a integer value from the specified node.
122
+
123
+ Args:
124
+ path: Path string of the node.
125
+
126
+ Returns:
127
+ Integer value."""
128
+
129
+ def getString(self, path: str) -> str: # Wrong return type in docs (object)
130
+ """Get a string value from the specified node.
131
+
132
+ Args:
133
+ path: Path string of the node.
134
+
135
+ Returns:
136
+ String value."""
137
+
138
+ def getStringUnicode(self, path: str) -> str: # Wrong return type in docs (object)
139
+ """Get a unicode encoded string value from the specified node.
140
+
141
+ Deprecated, please use `getString` instead.
142
+ Args:
143
+ path: Path string of the node.
144
+
145
+ Returns:
146
+ Unicode encoded string value."""
147
+
148
+ def help(self, path: str = "*") -> None:
149
+ """Prints a well-formatted description of a module parameter.
150
+
151
+ Args:
152
+ path: Path for which the nodes should be listed. The path may
153
+ contain wildcards so that the returned nodes do not
154
+ necessarily have to have the same parents."""
155
+
156
+ def listNodes(
157
+ self,
158
+ path: str,
159
+ *,
160
+ flags: Union[ziListEnum, int] = 0,
161
+ recursive: bool = False,
162
+ absolute: bool = False,
163
+ leavesonly: bool = False,
164
+ settingsonly: bool = False,
165
+ streamingonly: bool = False,
166
+ subscribedonly: bool = False,
167
+ basechannelonly: bool = False,
168
+ getonly: bool = False,
169
+ excludevectors: bool = False,
170
+ excludestreaming: bool = False,
171
+ ) -> List[str]:
172
+ """This function returns a list of node names found at the specified path.
173
+
174
+ Args:
175
+ path: Path for which the nodes should be listed. The path may
176
+ contain wildcards so that the returned nodes do not
177
+ necessarily have to have the same parents.
178
+ flags: Flags specifying how the selected nodes are listed
179
+ (see `zhinst.core.ziListEnum`). Flags can also specified by
180
+ the keyword arguments below.
181
+ recursive: Returns the nodes recursively (default: False)
182
+ absolute: Returns absolute paths (default: True)
183
+ leavesonly: Returns only nodes that are leaves, which means they
184
+ are at the outermost level of the tree (default: False).
185
+ settingsonly: Returns only nodes which are marked as setting
186
+ (default: False).
187
+ streamingonly: Returns only streaming nodes (default: False).
188
+ subscribedonly: Returns only subscribed nodes (default: False).
189
+ basechannelonly: Return only one instance of a node in case of
190
+ multiple channels (default: False).
191
+ getonly: Return only nodes that can be used in a get request
192
+ excludestreaming: Exclude streaming nodes (default: False).
193
+ excludevectors: Exclude vector nodes (default: False).
194
+
195
+ Returns:
196
+ List of node names."""
197
+
198
+ def listNodesJSON(
199
+ self,
200
+ path: str,
201
+ *,
202
+ flags: Union[ziListEnum, int] = 0,
203
+ recursive: bool = False,
204
+ absolute: bool = False,
205
+ leavesonly: bool = False,
206
+ settingsonly: bool = False,
207
+ streamingonly: bool = False,
208
+ subscribedonly: bool = False,
209
+ basechannelonly: bool = False,
210
+ getonly: bool = False,
211
+ excludevectors: bool = False,
212
+ excludestreaming: bool = False,
213
+ ) -> str: # `object` in documentation
214
+ """Returns a json dict of all nodes found at the specified path.
215
+
216
+ Args:
217
+ path: Path for which the nodes should be listed. The path may
218
+ contain wildcards so that the returned nodes do not
219
+ necessarily have to have the same parents.
220
+ flags: Flags specifying how the selected nodes are listed
221
+ (see `zhinst.core.ziListEnum`). Flags can also specified by
222
+ the keyword arguments below. They are the same as for
223
+ listNodes(), except that recursive, absolute, and leavesonly
224
+ are enforced.
225
+ settingsonly: Returns only nodes which are marked as setting
226
+ (default: False).
227
+ streamingonly: Returns only streaming nodes (default: False).
228
+ subscribedonly: Returns only subscribed nodes (default: False).
229
+ basechannelonly: Return only one instance of a node in case of
230
+ multiple channels (default: False).
231
+ excludestreaming: Exclude streaming nodes (default: False).
232
+ excludevectors: Exclude vector nodes (default: False).
233
+
234
+ Returns:
235
+ JSON dictionary nodepath:information"""
236
+
237
+ def progress(self) -> np.ndarray:
238
+ """Reports the progress of the execution.
239
+
240
+ Returns:
241
+ Progress with a number between 0 and 1."""
242
+
243
+ @overload
244
+ def read(self, flat: Literal[False]) -> LabOneResultNested:
245
+ """Read the module output data.
246
+
247
+ If the module execution is still ongoing only a subset of data is
248
+ returned. If huge data sets are produced call this method to keep
249
+ memory usage reasonable.
250
+
251
+ Args:
252
+ flat: Specify which type of data structure to return.
253
+ Return data either as a flat dict (True) or as a nested
254
+ dict tree (False). Default = False.
255
+
256
+ Returns:
257
+ The module output data."""
258
+
259
+ @overload
260
+ def read(self, flat: Literal[True]) -> Dict[str, LabOneResultAny]:
261
+ """Read the module output data.
262
+
263
+ If the module execution is still ongoing only a subset of data is
264
+ returned. If huge data sets are produced call this method to keep
265
+ memory usage reasonable.
266
+
267
+ Args:
268
+ flat: Specify which type of data structure to return.
269
+ Return data either as a flat dict (True) or as a nested
270
+ dict tree (False). Default = False.
271
+
272
+ Returns:
273
+ The module output data."""
274
+
275
+ def read(self, flat: bool = False) -> Dict[str, LabOneResultAny]:
276
+ """Read the module output data.
277
+
278
+ If the module execution is still ongoing only a subset of data is
279
+ returned. If huge data sets are produced call this method to keep
280
+ memory usage reasonable.
281
+
282
+ Args:
283
+ flat: Specify which type of data structure to return.
284
+ Return data either as a flat dict (True) or as a nested
285
+ dict tree (False). Default = False.
286
+
287
+ Returns:
288
+ The module output data."""
289
+
290
+ def save(self, filename: str) -> None:
291
+ """Save measured data to file.
292
+
293
+ Args:
294
+ filename: File name string (without extension)."""
295
+
296
+ @overload
297
+ def set(self, path: str, value: Any) -> None:
298
+ """Set a single node value.
299
+
300
+ `path` is the node path and `value` the value to set.
301
+
302
+ Args:
303
+ path: Node path string.
304
+ value: The value to set in case of a single node set.
305
+ """
306
+
307
+ @overload
308
+ def set(self, items: Union[List[Tuple[str, Any]], Tuple[Tuple[str, Any]]]) -> None:
309
+ """Set multiple nodes. `items` is a list of path/value pairs.
310
+
311
+ A transaction is used to optimize the data transfer.
312
+
313
+ Args:
314
+ items: A list of path/value pairs.
315
+ """
316
+
317
+ def subscribe(self, path: Union[str, List[str]]) -> None:
318
+ """Subscribe to one or several nodes.
319
+
320
+ After subscription the module execution can be started with the
321
+ 'execute' command. During the module execution paths can not be
322
+ subscribed or unsubscribed.
323
+
324
+ Args:
325
+ path: Path string of the node. Use wild card to
326
+ select all. Alternatively also a list of path
327
+ strings can be specified."""
328
+
329
+ def trigger(self) -> None:
330
+ """Execute a manual trigger, if applicable."""
331
+
332
+ def unsubscribe(self, path: Union[str, List[str]]) -> None:
333
+ """Unsubscribe from one or several nodes.
334
+
335
+ During the module execution paths can not be subscribed
336
+ or unsubscribed.
337
+
338
+ Args:
339
+ path: Path string of the node. Use wild card to
340
+ select all. Alternatively also a list of path
341
+ strings can be specified."""
342
+
343
+ class AwgModule(ModuleBase): ...
344
+ class DataAcquisitionModule(ModuleBase): ...
345
+ class DeviceSettingsModule(ModuleBase): ...
346
+ class ImpedanceModule(ModuleBase): ...
347
+ class MultiDeviceSyncModule(ModuleBase): ...
348
+ class PidAdvisorModule(ModuleBase): ...
349
+ class PrecompensationAdvisorModule(ModuleBase): ...
350
+ class QuantumAnalyzerModule(ModuleBase): ...
351
+ class RecorderModule(ModuleBase): ...
352
+ class ScopeModule(ModuleBase): ...
353
+ class StreamingModule(ModuleBase): ...
354
+ class SweeperModule(ModuleBase): ...
355
+ class ZoomFFTModule(ModuleBase): ...
356
+
357
+ class ziDAQServer:
358
+ """Class to connect with a Zurich Instruments data server.
359
+
360
+ Args:
361
+ host: Host string e.g. '127.0.0.1' for localhost
362
+ port: Port number e.g. 8004 for the ziDataServer.
363
+ api_level: API level number.
364
+ allow_version_mismatch: if set to True, the connection to the data-server
365
+ will succeed even if the data-server is on a different version of LabOne.
366
+ If False, an exception will be raised if the data-server is on a
367
+ different version. (default = False)
368
+ """
369
+
370
+ def __init__(
371
+ self,
372
+ host: str,
373
+ port: int,
374
+ api_level: Literal[0, 1, 4, 5, 6],
375
+ allow_version_mismatch: bool = False,
376
+ ) -> None: ...
377
+ def asyncSetDouble(self, path: str, value: float) -> None:
378
+ """Asynchronously set the value as double for a specified node.
379
+
380
+ Asynchronously means that the command is nonblocking and
381
+ does not wait for the data server acknowledgement.
382
+
383
+ Warning:
384
+ This command never reports any error.
385
+
386
+ Args:
387
+ path: Path string of the node.
388
+ value: Value of the node."""
389
+
390
+ def asyncSetInt(self, path: str, value: int) -> None:
391
+ """Asynchronously set the value as integer for a specified node.
392
+
393
+ Asynchronously means that the command is nonblocking and
394
+ does not wait for the data server acknowledgement.
395
+
396
+ Warning:
397
+ This command never reports any error.
398
+
399
+ Args:
400
+ path: Path string of the node.
401
+ value: Value of the node."""
402
+
403
+ def asyncSetString(self, path: str, value: str) -> None:
404
+ """Asynchronously set the value as string for a specified node.
405
+
406
+ Asynchronously means that the command is nonblocking and
407
+ does not wait for the data server acknowledgement.
408
+
409
+ Warning:
410
+ This command never reports any error.
411
+
412
+ Args:
413
+ path: Path string of the node.
414
+ value: Value of the node."""
415
+
416
+ def awgModule(self) -> AwgModule:
417
+ """Create a AwgModule object.
418
+
419
+ This will start a thread for running an asynchronous module.
420
+
421
+ Returns:
422
+ Created module instance."""
423
+
424
+ def connect(self) -> None:
425
+ """Initiate the connection to the data server.
426
+
427
+ Important:
428
+ During the object initialization the connection is already
429
+ established. It is therefore not necessary to call this
430
+ function unless one actively disconnects from the data
431
+ server with the `disconnect` method."""
432
+
433
+ def connectDevice(
434
+ self,
435
+ dev: str,
436
+ interface: Literal["USB", "PCIe", "1GbE"],
437
+ params: Optional[str] = None,
438
+ ) -> None:
439
+ """Connect with the data server to a specified device.
440
+
441
+ The device must be visible to the server. If the device is
442
+ already connected the call will be ignored. The function will block
443
+ until the device is connected and the device is ready to use.
444
+
445
+ Args:
446
+ dev: Device serial.
447
+ interface: Device interface.
448
+ params: Optional interface parameters string."""
449
+
450
+ def dataAcquisitionModule(self) -> DataAcquisitionModule:
451
+ """Create a DataAcquisitionModule object.
452
+
453
+ This will start a thread for running an asynchronous module.
454
+
455
+ Returns:
456
+ Created module instance."""
457
+
458
+ def deviceSettings(
459
+ self,
460
+ ) -> DeviceSettingsModule: # Deprecated arguments not included
461
+ """Create a Device Settings Module object.
462
+
463
+ This will start a thread for running an asynchronous module.
464
+
465
+ Returns:
466
+ Created module instance."""
467
+
468
+ def disconnect(self) -> None:
469
+ """Disconnects from the data server.
470
+
471
+ Important:
472
+ During the destruction the connection is closed properly.
473
+ This function therefore does not need to be called in normal
474
+ usage."""
475
+
476
+ def disconnectDevice(self, dev: str) -> None:
477
+ """Disconnect a device from the data server.
478
+
479
+ This function will return immediately. The disconnection of
480
+ the device may not yet be finished.
481
+ Args:
482
+ dev: Device serial string of device to disconnect."""
483
+
484
+ def echoDevice(self, dev: str) -> None: # Deprecated
485
+ """Deprecated, see the 'sync' command.
486
+
487
+ Sends an echo command to a device and blocks until
488
+ answer is received. This is useful to flush all
489
+ buffers between API and device to enforce that
490
+ further code is only executed after the device executed
491
+ a previous command.
492
+ Args:
493
+ dev: Device string e.g. 'dev100'."""
494
+
495
+ def flush(self) -> None: # Deprecated
496
+ """Deprecated, see the 'sync' command.
497
+
498
+ The flush command is identical to the sync command."""
499
+
500
+ @overload
501
+ def get(
502
+ self,
503
+ paths: str,
504
+ *,
505
+ flat: Literal[False] = False,
506
+ flags: Union[ziListEnum, int] = 0,
507
+ settingsonly: bool = True,
508
+ subscribedonly: bool = False,
509
+ basechannelonly: bool = False,
510
+ excludevectors: bool = False,
511
+ ) -> LabOneResultNested:
512
+ """Return a dict with all nodes matching the path expression.
513
+
514
+ Note: High-speed streaming nodes (e.g. `/devN/demods/0/sample`) are
515
+ are never returned.
516
+
517
+ Args:
518
+ paths: Path expression string. Multiple paths can be specified
519
+ as a comma-separated list. Wildcards are supported to
520
+ select multiple matching nodes.
521
+ flat: Specify which type of data structure to return.
522
+ Return data either as a flat dict (True) or as a nested
523
+ dict tree (False, default).
524
+ flags: Flags specifying how the selected nodes are listed
525
+ (see `zhinst.core.ziListEnum`). Flags can also specified by
526
+ the keyword arguments below.
527
+ settingsonly: Returns only nodes which are marked as setting
528
+ (default: True).
529
+ subscribedonly: Returns only subscribed nodes (default: False).
530
+ basechannelonly: Return only one instance of a node in case of
531
+ multiple channels (default: False).
532
+ excludevectors: Exclude vector nodes (default: False).
533
+
534
+ Returns:
535
+ A dict with all nodes from the specified sub-tree."""
536
+
537
+ @overload
538
+ def get(
539
+ self,
540
+ paths: str,
541
+ *,
542
+ flat: Literal[True],
543
+ flags: Union[ziListEnum, int] = 0,
544
+ settingsonly: bool = True,
545
+ subscribedonly: bool = False,
546
+ basechannelonly: bool = False,
547
+ excludevectors: bool = False,
548
+ ) -> Dict[str, LabOneResultAny]:
549
+ """Return a dict with all nodes from the specified sub-tree.
550
+ Note: Flags are ignored for a path that specifies one or more leaf nodes.
551
+ Specifying flags, either as positional or keyword argument is
552
+ mandatory if an empty set would be returned given the
553
+ default flags (settingsonly).
554
+ High-speed streaming nodes (e.g. `/devN/demods/0/sample`) are
555
+ are never returned.
556
+
557
+ Args:
558
+ paths: Path string of the node. Multiple paths can be specified
559
+ as a comma-separated list. Wild cards are supported to
560
+ select multiple matching nodes.
561
+ flat: Specify which type of data structure to return.
562
+ Return data either as a flat dict (True) or as a nested
563
+ dict tree (False, default).
564
+ flags: Flags specifying how the selected nodes are listed
565
+ (see `zhinst.core.ziListEnum`). Flags can also specified by
566
+ the keyword arguments below.
567
+
568
+ settingsonly: Returns only nodes which are marked as setting
569
+ (default: True).
570
+ subscribedonly: Returns only subscribed nodes (default: False).
571
+ basechannelonly: Return only one instance of a node in case of
572
+ multiple channels (default: False).
573
+ excludevectors: Exclude vector nodes (default: False).
574
+
575
+ Returns:
576
+ A dict with all nodes from the specified sub-tree."""
577
+
578
+ def get(
579
+ self,
580
+ paths: str,
581
+ *,
582
+ flat: bool = False,
583
+ flags: Union[ziListEnum, int] = 0,
584
+ settingsonly: bool = True,
585
+ subscribedonly: bool = False,
586
+ basechannelonly: bool = False,
587
+ excludevectors: bool = False,
588
+ ) -> LabOneResultNested:
589
+ """Return a dict with all nodes from the specified sub-tree.
590
+ Note: Flags are ignored for a path that specifies one or more leaf nodes.
591
+ Specifying flags, either as positional or keyword argument is
592
+ mandatory if an empty set would be returned given the
593
+ default flags (settingsonly).
594
+ High-speed streaming nodes (e.g. `/devN/demods/0/sample`) are
595
+ are never returned.
596
+
597
+ Args:
598
+ paths: Path string of the node. Multiple paths can be specified
599
+ as a comma-separated list. Wild cards are supported to
600
+ select multiple matching nodes.
601
+ flat: Specify which type of data structure to return.
602
+ Return data either as a flat dict (True) or as a nested
603
+ dict tree (False, default).
604
+ flags: Flags specifying how the selected nodes are listed
605
+ (see `zhinst.core.ziListEnum`). Flags can also specified by
606
+ the keyword arguments below.
607
+
608
+ settingsonly: Returns only nodes which are marked as setting
609
+ (default: True).
610
+ subscribedonly: Returns only subscribed nodes (default: False).
611
+ basechannelonly: Return only one instance of a node in case of
612
+ multiple channels (default: False).
613
+ excludevectors: Exclude vector nodes (default: False).
614
+
615
+ Returns:
616
+ A dict with all nodes from the specified sub-tree."""
617
+
618
+ def getAsEvent(self, path: str) -> None:
619
+ """Trigger an event on the specified node.
620
+
621
+ The node data is returned by a subsequent poll command.
622
+
623
+ Args:
624
+ path: Path string of the node. Note: Wildcards and paths
625
+ referring to streaming nodes are not permitted."""
626
+
627
+ def asyncGetAsEvent(self, path: str) -> None:
628
+ """Trigger an event on the specified node.
629
+
630
+ The node data is returned by a subsequent poll command.
631
+
632
+ The difference to the non async equivalent is that this
633
+ function returns immediately, even before the data server
634
+ has received the request. This gives the lowest latency at
635
+ the cost of not providing feedback if the request fails
636
+
637
+ .. versionadded:: 23.02
638
+
639
+ Args:
640
+ path: Path string of the node. Note: Wildcards and paths
641
+ referring to streaming nodes are not permitted."""
642
+
643
+ def getAuxInSample(self, path: str) -> Dict[str, np.ndarray]:
644
+ """Returns a single auxin sample.
645
+
646
+ The auxin data is averaged in contrast to the auxin data
647
+ embedded in the demodulator sample.
648
+
649
+ Args:
650
+ path: Path string of the node"""
651
+
652
+ def getByte(self, path: str) -> str:
653
+ """Get a byte array (string) value from the specified node.
654
+
655
+ Args:
656
+ path: Path string of the node.
657
+
658
+ Returns:
659
+ Byte array (string) value."""
660
+
661
+ def getComplex(self, path: str) -> complex:
662
+ """Get a complex double value from the specified node.
663
+
664
+ Args:
665
+ path: Path string of the node.
666
+
667
+ Returns:
668
+ Complex double value."""
669
+
670
+ def getConnectionAPILevel(self) -> Literal[0, 1, 4, 5, 6]: # Deprecated
671
+ """Returns ziAPI level used for the active connection.
672
+
673
+ DEPRECATED, use api_level.
674
+
675
+ Returns:
676
+ ziAPI level used for the active connection."""
677
+
678
+ def getDIO(self, path: str) -> Dict[str, np.ndarray]:
679
+ """Returns a single DIO sample.
680
+
681
+ Args:
682
+ path: Path string of the node
683
+
684
+ Returns:
685
+ Single DIO sample."""
686
+
687
+ def getDebugLogpath(self) -> str:
688
+ """Path where logfiles are stored.
689
+
690
+ Note, it will return an empty string if the path has not
691
+ been set or logging has not been enabled via `setDebugLevel()`.
692
+
693
+ Returns:
694
+ Path to directory where logfiles are stored."""
695
+
696
+ def getDouble(self, path: str) -> float:
697
+ """Get a double value from the specified node.
698
+
699
+ Args:
700
+ path: Path string of the node.
701
+
702
+ Returns:
703
+ Floating point double value."""
704
+
705
+ def getInt(self, path: str) -> int:
706
+ """Get a integer value from the specified node.
707
+
708
+ Args:
709
+ path: Path string of the node.
710
+
711
+ Returns:
712
+ Integer value."""
713
+
714
+ def getList(self, path: str, flags: int = 8) -> List[str]: # Deprecated
715
+ """DEPRECATED: superseded by get(...).
716
+
717
+ Return a list with all nodes from the specified sub-tree.
718
+ Args:
719
+ path: Path string of the node. Use wild card to
720
+ select all.
721
+ flags: Specify which type of nodes to include in the
722
+ result. Allowed:
723
+ ZI_LIST_NODES_SETTINGSONLY = 0x08 (default)
724
+ ZI_LIST_NODES_ALL = 0x00 (all nodes)"""
725
+
726
+ def getSample(self, path: str) -> Dict[str, np.ndarray]:
727
+ """Returns a single demodulator sample (including DIO and AuxIn).
728
+
729
+ For more efficient data recording use subscribe and poll methods!
730
+
731
+ Args:
732
+ path: Path string of the node
733
+
734
+ Returns:
735
+ Single demodulator sample (including DIO and AuxIn)."""
736
+
737
+ def getString(self, path: str) -> str: # `object` in documentation
738
+ """Get a string value from the specified node.
739
+
740
+ Args:
741
+ path: Path string of the node.
742
+
743
+ Returns:
744
+ String value."""
745
+
746
+ def getStringUnicode(self, path: str) -> str: # `object` in documentation
747
+ """Get a unicode encoded string value from the specified node.
748
+
749
+ Deprecated, please use `getString` instead.
750
+ Args:
751
+ path: Path string of the node.
752
+
753
+ Returns:
754
+ Unicode encoded string value."""
755
+
756
+ def help(self, path: str) -> None:
757
+ """Prints a well-formatted description of a node.
758
+
759
+ HF2 devices do not support this functionality.
760
+
761
+ Args:
762
+ path: Path for which the nodes should be listed. The path may
763
+ contain wildcards so that the returned nodes do not
764
+ necessarily have to have the same parents."""
765
+
766
+ def impedanceModule(self) -> ImpedanceModule:
767
+ """Create a ImpedanceModule object.
768
+
769
+ This will start a thread for running an asynchronous module.
770
+
771
+ Returns:
772
+ Created module instance."""
773
+
774
+ def listNodes(
775
+ self,
776
+ path: str,
777
+ *,
778
+ flags: Optional[Union[ziListEnum, int]] = None,
779
+ recursive: bool = False,
780
+ absolute: bool = False,
781
+ leavesonly: bool = False,
782
+ settingsonly: bool = False,
783
+ streamingonly: bool = False,
784
+ subscribedonly: bool = False,
785
+ basechannelonly: bool = False,
786
+ getonly: bool = False,
787
+ excludevectors: bool = False,
788
+ excludestreaming: bool = False,
789
+ ) -> List[str]:
790
+ """This function returns a list of node names found at the specified path.
791
+
792
+ Args:
793
+ path: Path for which the nodes should be listed. The path may
794
+ contain wildcards so that the returned nodes do not
795
+ necessarily have to have the same parents.
796
+ flags: Flags specifying how the selected nodes are listed
797
+ (see `zhinst.core.ziListEnum`). Flags can also specified by
798
+ the keyword arguments below.
799
+
800
+ recursive: Returns the nodes recursively (default: False)
801
+ absolute: Returns absolute paths (default: True)
802
+ leavesonly: Returns only nodes that are leaves, which means they
803
+ are at the outermost level of the tree (default: False).
804
+ settingsonly: Returns only nodes which are marked as setting
805
+ (default: False).
806
+ streamingonly: Returns only streaming nodes (default: False).
807
+ subscribedonly: Returns only subscribed nodes (default: False).
808
+ basechannelonly: Return only one instance of a node in case of
809
+ multiple channels (default: False).
810
+ getonly: Return only nodes that can be used in a get request
811
+ excludestreaming: Exclude streaming nodes (default: False).
812
+ excludevectors: Exclude vector nodes (default: False).
813
+
814
+ Returns:
815
+ List of node names."""
816
+
817
+ def listNodesJSON(
818
+ self,
819
+ path: str,
820
+ *,
821
+ flags: Optional[Union[ziListEnum, int]] = None,
822
+ recursive: bool = False,
823
+ absolute: bool = False,
824
+ leavesonly: bool = False,
825
+ settingsonly: bool = False,
826
+ streamingonly: bool = False,
827
+ subscribedonly: bool = False,
828
+ basechannelonly: bool = False,
829
+ getonly: bool = False,
830
+ excludevectors: bool = False,
831
+ excludestreaming: bool = False,
832
+ ) -> List[str]: # `object` in documentation
833
+ """Returns a list of nodes with description found at the specified path.
834
+
835
+ HF2 devices do not support this functionality.
836
+
837
+ Args:
838
+ path: Path for which the nodes should be listed. The path may
839
+ contain wildcards so that the returned nodes do not
840
+ necessarily have to have the same parents.
841
+ flags: Flags specifying how the selected nodes are listed
842
+ (see `zhinst.core.ziListEnum`). Flags can also specified by
843
+ the keyword arguments below. They are the same as for
844
+ listNodes(), except that recursive, absolute, and leavesonly
845
+ are enforced.
846
+ settingsonly: Returns only nodes which are marked as setting
847
+ (default: False).
848
+ streamingonly: Returns only streaming nodes (default: False).
849
+ subscribedonly: Returns only subscribed nodes (default: False).
850
+ basechannelonly: Return only one instance of a node in case of
851
+ multiple channels (default: False).
852
+ getonly: Return only nodes that can be used in a get request
853
+ excludestreaming: Exclude streaming nodes (default: False).
854
+ excludevectors: Exclude vector nodes (default: False).
855
+
856
+ Returns:
857
+ JSON dictionary nodepath:information"""
858
+
859
+ def logOff(self) -> None:
860
+ """Disables logging of commands sent to a server."""
861
+
862
+ def logOn(self, flags: int, filename: str, style: Literal[0, 1, 2] = 2) -> None:
863
+ """Enables logging of commands sent to a server.
864
+
865
+ Args:
866
+ flags: Flags (LOG_NONE: 0x00000000
867
+ LOG_SET_DOUBLE: 0x00000001
868
+ LOG_SET_INT: 0x00000002
869
+ LOG_SET_BYTE: 0x00000004
870
+ LOG_SET_STRING: 0x00000008
871
+ LOG_SYNC_SET_DOUBLE: 0x00000010
872
+ LOG_SYNC_SET_INT: 0x00000020
873
+ LOG_SYNC_SET_BYTE: 0x00000040
874
+ LOG_SYNC_SET_STRING: 0x00000080
875
+ LOG_GET_DOUBLE: 0x00000100
876
+ LOG_GET_INT: 0x00000200
877
+ LOG_GET_BYTE: 0x00000400
878
+ LOG_GET_STRING: 0x00000800
879
+ LOG_GET_DEMOD: 0x00001000
880
+ LOG_GET_DIO: 0x00002000
881
+ LOG_GET_AUXIN: 0x00004000
882
+ LOG_GET_COMPLEX: 0x00008000
883
+ LOG_LISTNODES: 0x00010000
884
+ LOG_SUBSCRIBE: 0x00020000
885
+ LOG_UNSUBSCRIBE: 0x00040000
886
+ LOG_GET_AS_EVENT: 0x00080000
887
+ LOG_UPDATE: 0x00100000
888
+ LOG_POLL_EVENT: 0x00200000
889
+ LOG_POLL: 0x00400000
890
+ LOG_ALL : 0xffffffff)
891
+ filename: Log file name.
892
+ style: Log style (LOG_STYLE_TELNET: 0, LOG_STYLE_MATLAB: 1,
893
+ LOG_STYLE_PYTHON: 2 (default))."""
894
+
895
+ def multiDeviceSyncModule(self) -> MultiDeviceSyncModule:
896
+ """Create a MultiDeviceSyncModule object.
897
+
898
+ This will start a thread for running an asynchronous module.
899
+
900
+ Returns:
901
+ Created module instance."""
902
+
903
+ def pidAdvisor(self) -> PidAdvisorModule: # Deprecated arguments not included
904
+ """Create a PID Advisor Module object.
905
+
906
+ This will start a thread for running an asynchronous module.
907
+
908
+ Returns:
909
+ Created module instance."""
910
+
911
+ @overload
912
+ def poll(
913
+ self,
914
+ recording_time_s: float,
915
+ timeout_ms: int,
916
+ *,
917
+ flat: Literal[False] = False,
918
+ flags: int = 0,
919
+ ) -> LabOneResultNested:
920
+ """Poll all Events available before and within an given time period.
921
+
922
+ Continuously check for value changes (by calling pollEvent) in all
923
+ subscribed nodes for the specified duration and return the data. If
924
+ no value change occurs in subscribed nodes before duration + timeout,
925
+ poll returns no data. This function call is blocking (it is
926
+ synchronous). However, since all value changes are returned since
927
+ either subscribing to the node or the last poll (assuming no buffer
928
+ overflow has occurred on the Data Server), this function may be used
929
+ in a quasi-asynchronous manner to return data spanning a much longer
930
+ time than the specified duration. The timeout parameter is only
931
+ relevant when communicating in a slow network. In this case it may be
932
+ set to a value larger than the expected round-trip time in the
933
+ network.
934
+
935
+ Args:
936
+ recording_time_s: Recording time in [s]. The function will block
937
+ during that time.
938
+ timeout_ms: Poll timeout in [ms]. Recommended value is 500ms.
939
+ flags: Poll flags.
940
+ DEFAULT = 0x0000: Default.
941
+ FILL = 0x0001: Fill holes.
942
+ THROW = 0x0004: Throw EOFError exception if sample
943
+ loss is detected (only possible in
944
+ combination with DETECT).
945
+ DETECT = 0x0008: Detect data loss holes.
946
+ flat: Specify which type of data structure to return.
947
+ Return data either as a flat dict (True) or as a nested
948
+ dict tree (False). Default = False.
949
+
950
+ Returns:
951
+ A dict with the polled events. (Empty if no event
952
+ occurred within the given timeout)"""
953
+
954
+ @overload
955
+ def poll(
956
+ self,
957
+ recording_time_s: float,
958
+ timeout_ms: int,
959
+ *,
960
+ flat: Literal[True],
961
+ flags: int = 0,
962
+ ) -> Dict[str, LabOneResultAny]:
963
+ """Poll all Events available before and within an given time period.
964
+
965
+ Continuously check for value changes (by calling pollEvent) in all
966
+ subscribed nodes for the specified duration and return the data. If
967
+ no value change occurs in subscribed nodes before duration + timeout,
968
+ poll returns no data. This function call is blocking (it is
969
+ synchronous). However, since all value changes are returned since
970
+ either subscribing to the node or the last poll (assuming no buffer
971
+ overflow has occurred on the Data Server), this function may be used
972
+ in a quasi-asynchronous manner to return data spanning a much longer
973
+ time than the specified duration. The timeout parameter is only
974
+ relevant when communicating in a slow network. In this case it may be
975
+ set to a value larger than the expected round-trip time in the
976
+ network.
977
+
978
+ Args:
979
+ recording_time_s: Recording time in [s]. The function will block
980
+ during that time.
981
+ timeout_ms: Poll timeout in [ms]. Recommended value is 500ms.
982
+ flags: Poll flags.
983
+ DEFAULT = 0x0000: Default.
984
+ FILL = 0x0001: Fill holes.
985
+ THROW = 0x0004: Throw EOFError exception if sample
986
+ loss is detected (only possible in
987
+ combination with DETECT).
988
+ DETECT = 0x0008: Detect data loss holes.
989
+ flat: Specify which type of data structure to return.
990
+ Return data either as a flat dict (True) or as a nested
991
+ dict tree (False). Default = False.
992
+
993
+ Returns:
994
+ A dict with the polled events. (Empty if no event
995
+ occurred within the given timeout)"""
996
+
997
+ def poll(
998
+ self,
999
+ recording_time_s: float,
1000
+ timeout_ms: int,
1001
+ flags: int = 0,
1002
+ flat: bool = False,
1003
+ ) -> Dict[str, LabOneResultAny]:
1004
+ """Poll all Events available before and within an given time period.
1005
+
1006
+ Continuously check for value changes (by calling pollEvent) in all
1007
+ subscribed nodes for the specified duration and return the data. If
1008
+ no value change occurs in subscribed nodes before duration + timeout,
1009
+ poll returns no data. This function call is blocking (it is
1010
+ synchronous). However, since all value changes are returned since
1011
+ either subscribing to the node or the last poll (assuming no buffer
1012
+ overflow has occurred on the Data Server), this function may be used
1013
+ in a quasi-asynchronous manner to return data spanning a much longer
1014
+ time than the specified duration. The timeout parameter is only
1015
+ relevant when communicating in a slow network. In this case it may be
1016
+ set to a value larger than the expected round-trip time in the
1017
+ network.
1018
+
1019
+ Args:
1020
+ recording_time_s: Recording time in [s]. The function will block
1021
+ during that time.
1022
+ timeout_ms: Poll timeout in [ms]. Recommended value is 500ms.
1023
+ flags: Poll flags.
1024
+ DEFAULT = 0x0000: Default.
1025
+ FILL = 0x0001: Fill holes.
1026
+ THROW = 0x0004: Throw EOFError exception if sample
1027
+ loss is detected (only possible in
1028
+ combination with DETECT).
1029
+ DETECT = 0x0008: Detect data loss holes.
1030
+ flat: Specify which type of data structure to return.
1031
+ Return data either as a flat dict (True) or as a nested
1032
+ dict tree (False). Default = False.
1033
+
1034
+ Returns:
1035
+ A dict with the polled events. (Empty if no event occurred within
1036
+ the given timeout)"""
1037
+
1038
+ def pollEvent(self, timeout_ms: int) -> Dict[str, LabOneResultAny]:
1039
+ """Poll a single Event.
1040
+
1041
+ An event are one or multiple changes that occurred in
1042
+ one single subscribed node. This is a low-level function
1043
+ to obtain a single event from the data server connection.
1044
+ To get all data waiting in the buffers, this command should
1045
+ be executed continuously until an empty dict is returned.
1046
+
1047
+ The `poll()` function is better suited in many cases, as it
1048
+ returns the data accumulated over some time period.
1049
+ Args:
1050
+ timeout_ms: Poll timeout in [ms]. Recommended value is 500ms.
1051
+
1052
+ Returns:
1053
+ A dict with the polled event. (Empty if no event
1054
+ occurred within the given timeout)"""
1055
+
1056
+ def precompensationAdvisor(self) -> PrecompensationAdvisorModule:
1057
+ """Create a PrecompensationAdvisorModule object.
1058
+
1059
+ This will start a thread for running an asynchronous module.
1060
+
1061
+ Returns:
1062
+ Created module instance."""
1063
+
1064
+ def programRT(self, dev: str, filename: str) -> None:
1065
+ """Program RT.
1066
+ Only relevant for a HF2 device.
1067
+
1068
+ Args:
1069
+ dev: Device identifier e.g. 'dev99'.
1070
+ filename: File name of the RT program."""
1071
+
1072
+ def quantumAnalyzerModule(self) -> QuantumAnalyzerModule:
1073
+ """Create a QuantumAnalyzerModule object.
1074
+
1075
+ This will start a thread for running an asynchronous module.
1076
+
1077
+ Returns:
1078
+ Created module instance."""
1079
+
1080
+ def record(self) -> RecorderModule: ... # Deprecated arguments not included
1081
+
1082
+ """Create a Record Module object.
1083
+
1084
+ This will start a thread for running an asynchronous module.
1085
+
1086
+ Returns:
1087
+ Created module instance."""
1088
+
1089
+ def revision(self) -> int:
1090
+ """Get the revision number of the Python interface of Zurich Instruments.
1091
+
1092
+ Returns:
1093
+ Revision number."""
1094
+
1095
+ def scopeModule(self) -> ScopeModule:
1096
+ """Create a ScopeModule object.
1097
+
1098
+ This will start a thread for running an asynchronous module.
1099
+
1100
+ Returns:
1101
+ Created module instance."""
1102
+
1103
+ @overload
1104
+ def set(self, path: str, value: Any) -> None:
1105
+ """Overloaded function.
1106
+
1107
+ Set a single node value. `path` is the node path
1108
+ and `value` the value to set.
1109
+
1110
+ Args:
1111
+ path: Node path string.
1112
+ value: The value to set in case of a single node set
1113
+ (items is the node path).
1114
+ """
1115
+
1116
+ @overload
1117
+ def set(self, items: Union[List[Tuple[str, Any]], Tuple[Tuple[str, Any]]]) -> None:
1118
+ """Set multiple nodes. `items` is a list of path/value pairs.
1119
+
1120
+ A transaction is used to optimize the data transfer.
1121
+
1122
+ Args:
1123
+ items: A list of path/value pairs
1124
+ """
1125
+
1126
+ def set(
1127
+ self,
1128
+ items_or_path: Union[Union[List[Tuple[str, Any]], Tuple[Tuple[str, Any]]], str],
1129
+ value: Optional[Any] = None,
1130
+ ) -> None:
1131
+ """Overloaded function.
1132
+
1133
+ 1. `set(self, items: _MultipleNodeItems)`
1134
+
1135
+ Set multiple nodes. `items` is a list of path/value pairs.
1136
+
1137
+ A transaction is used to optimize the data transfer.
1138
+
1139
+ 2. `set(self, path: str, value: Any)`
1140
+
1141
+ Set a single node value. `path` is the node path
1142
+ and `value` the value to set.
1143
+
1144
+ Args:
1145
+ items_or_path: A list of path/value pairs or the node path string.
1146
+ value: The value to set in case of a single node set
1147
+ (items is the node path).
1148
+ """
1149
+
1150
+ def setByte(self, path: str, value: Any) -> None:
1151
+ """Set the value as byte array (string) for a specified node.
1152
+
1153
+ The command blocks until the data server has acknowledgement
1154
+ the set request.
1155
+
1156
+ Args:
1157
+ path: Path string of the node.
1158
+ value: Value of the node."""
1159
+
1160
+ def setComplex(self, path: str, value: complex) -> None:
1161
+ """Set the value as complex double for a specified node.
1162
+
1163
+ The command blocks until the data server has acknowledgement
1164
+ the set request.
1165
+
1166
+ Args:
1167
+ path: Path string of the node.
1168
+ value: Value of the node."""
1169
+
1170
+ def setDebugLevel(self, severity: Literal[0, 1, 2, 3, 4, 5, 6]) -> None:
1171
+ """Enables debug log and sets the debug level.
1172
+
1173
+ Resets the debug levels for individual sinks.
1174
+
1175
+ Args:
1176
+ severity: Debug level (trace:0, debug:1, info:2, status:3,
1177
+ warning:4, error:5, fatal:6)."""
1178
+
1179
+ def setDebugLevelConsole(self, severity: Literal[0, 1, 2, 3, 4, 5, 6]) -> None:
1180
+ """Enables debug log and sets the debug level for the console output.
1181
+ Args:
1182
+ severity: Debug level (trace:0, debug:1, info:2, status:3,
1183
+ warning:4, error:5, fatal:6)."""
1184
+
1185
+ def setDebugLevelFile(self, severity: Literal[0, 1, 2, 3, 4, 5, 6]) -> None:
1186
+ """Enables debug log and sets the debug level for the file output.
1187
+ Args:
1188
+ severity: Debug level (trace:0, debug:1, info:2, status:3,
1189
+ warning:4, error:5, fatal:6)."""
1190
+
1191
+ def setDebugLogpath(self, path: str) -> None:
1192
+ """Sets the path where logfiles are stored.
1193
+
1194
+ Note, it will restart logging if it was already enabled
1195
+ via setDebugLevel().
1196
+
1197
+ Args:
1198
+ path: Path to directory where logfiles are stored."""
1199
+
1200
+ def setDeprecated(
1201
+ self, items: Union[List[Tuple[str, Any]], Tuple[Tuple[str, Any]]]
1202
+ ) -> None:
1203
+ """DEPRECATED: superseded by set(...).
1204
+
1205
+ Set multiple nodes.
1206
+
1207
+ Args:
1208
+ items: A list of path/value pairs."""
1209
+
1210
+ def setDouble(self, path: str, value: float) -> None:
1211
+ """Set the value as double for a specified node.
1212
+
1213
+ The command blocks until the data server has acknowledgement
1214
+ the set request.
1215
+
1216
+ Args:
1217
+ path: Path string of the node.
1218
+ value: Value of the node."""
1219
+
1220
+ def setInt(self, path: str, value: int) -> None:
1221
+ """Set the value as integer for a specified node.
1222
+
1223
+ The command blocks until the data server has acknowledgement
1224
+ the set request.
1225
+
1226
+ Args:
1227
+ path: Path string of the node.
1228
+ value: Value of the node."""
1229
+
1230
+ def setString(self, path: str, value: str) -> None:
1231
+ """Set the value as string for a specified node.
1232
+
1233
+ The command blocks until the data server has acknowledgement
1234
+ the set request.
1235
+
1236
+ Args:
1237
+ path: Path string of the node.
1238
+ value: Value of the node."""
1239
+
1240
+ def setVector(
1241
+ self,
1242
+ path: str,
1243
+ value: Union[
1244
+ np.ndarray,
1245
+ List[Union[int, float, complex]],
1246
+ Tuple[Union[int, float, complex], ...],
1247
+ str,
1248
+ ],
1249
+ ) -> None:
1250
+ """Set the value for a specified vector node.
1251
+
1252
+ The command is different from the other set commands and is
1253
+ Optimized for vector transfer. It blocks until the device
1254
+ itself has acknowledged the complete vector data set.
1255
+
1256
+ Args:
1257
+ path: Path string of the node.
1258
+ value: Vector ((u)int8, (u)int16, (u)int32, (u)int64, float, double)
1259
+ or string to write."""
1260
+
1261
+ def streamingModule(self) -> StreamingModule:
1262
+ """Create a StreamingModule object.
1263
+
1264
+ This will start a thread for running an asynchronous module.
1265
+
1266
+ Note: This is an experimental module. The interface to this
1267
+ module and structure of the output data are subject to change
1268
+ at any time.
1269
+
1270
+ Returns:
1271
+ Created module instance."""
1272
+
1273
+ def subscribe(self, path: Union[str, List[str]]) -> None:
1274
+ """Subscribe to one or several nodes.
1275
+
1276
+ Fetch data with the poll command.
1277
+ In order to avoid fetching old data that is still in the
1278
+ buffer, execute a sync command before subscribing to data streams.
1279
+
1280
+ Args:
1281
+ path: Path string of the node. Use wild card to
1282
+ select all. Alternatively also a list of path
1283
+ strings can be specified."""
1284
+
1285
+ def sweep(self) -> SweeperModule: # Deprecated arguments not included
1286
+ """Create a Sweeper Module object.
1287
+
1288
+ This will start a thread for running an asynchronous module.
1289
+
1290
+ Returns:
1291
+ Created module instance."""
1292
+
1293
+ def sync(self) -> None:
1294
+ """Synchronize all data paths.
1295
+ Ensures that get and poll commands return data which
1296
+ was recorded after the setting changes in front of
1297
+ the sync command. This sync command replaces the
1298
+ functionality of all syncSet, flush, and echoDevice commands.
1299
+
1300
+ Warning:
1301
+ This blocks until all devices connected to the data
1302
+ server report a ready state! This can take up to a minute."""
1303
+
1304
+ def syncSetDouble(self, path: str, value: float) -> float:
1305
+ """Synchronously set the value as double for a specified node.
1306
+
1307
+ Synchronously means that the command is blocking until
1308
+ the device has acknowledged the set request.
1309
+
1310
+ Args:
1311
+ path: Path string of the node.
1312
+ value: Value of the node.
1313
+
1314
+ Returns:
1315
+ Acknowledged value by the device."""
1316
+
1317
+ def syncSetInt(self, path: str, value: int) -> int:
1318
+ """Synchronously set the value as integer for a specified node.
1319
+
1320
+ Synchronously means that the command is blocking until
1321
+ the device has acknowledged the set request.
1322
+
1323
+ Args:
1324
+ path: Path string of the node.
1325
+ value: Value of the node.
1326
+
1327
+ Returns:
1328
+ Acknowledged value by the device."""
1329
+
1330
+ def syncSetString(self, path: str, value: str) -> str:
1331
+ """Synchronously set the value as string for a specified node.
1332
+
1333
+ Synchronously means that the command is blocking until
1334
+ the device has acknowledged the set request.
1335
+
1336
+ Args:
1337
+ path: Path string of the node.
1338
+ value: Value of the node.
1339
+
1340
+ Returns:
1341
+ Acknowledged value by the device."""
1342
+
1343
+ def unsubscribe(self, path: Union[str, List[str]]) -> None:
1344
+ """Unsubscribe data streams.
1345
+
1346
+ Use this command after recording to avoid buffer overflows
1347
+ that may increase the latency of other command.
1348
+
1349
+ Args:
1350
+ path: Path string of the node. Use wild card to
1351
+ select all. Alternatively also a list of path
1352
+ strings can be specified."""
1353
+
1354
+ def update(self) -> None:
1355
+ """Check if additional devices are attached.
1356
+
1357
+ Only revelant for connections to an HF2 Data Server.
1358
+ This function is not needed for servers running under windows
1359
+ as devices will be detected automatically."""
1360
+
1361
+ def version(self) -> str:
1362
+ """Get version string of the Python interface of Zurich Instruments."""
1363
+
1364
+ def writeDebugLog(
1365
+ self, severity: Literal[0, 1, 2, 3, 4, 5, 6], message: str
1366
+ ) -> None:
1367
+ """Outputs message to the debug log (if enabled).
1368
+
1369
+ Args:
1370
+ severity: Debug level (trace:0, debug:1, info:2, status:3,
1371
+ warning:4, error:5, fatal:6). message: Message to output to the log.
1372
+ """
1373
+
1374
+ def zoomFFT(self) -> ZoomFFTModule: # Deprecated arguments not included
1375
+ """Create a zoomFFT Module object.
1376
+
1377
+ This will start a thread for running an asynchronous module.
1378
+
1379
+ Returns:
1380
+ Created module instance."""
1381
+
1382
+ @property
1383
+ def host(self) -> str:
1384
+ """The host used for the active connection.
1385
+
1386
+ .. versionadded:: 22.08"""
1387
+
1388
+ @property
1389
+ def port(self) -> int:
1390
+ """The port used for the active connection.
1391
+
1392
+ .. versionadded:: 22.08"""
1393
+
1394
+ @property
1395
+ def api_level(self) -> Literal[0, 1, 4, 5, 6]:
1396
+ """The ziAPI level used for the active connection.
1397
+
1398
+ .. versionadded:: 22.08"""
1399
+
1400
+ class ziDiscovery:
1401
+ """Class to find devices and get their connectivity properties."""
1402
+
1403
+ """Class to find devices and get their connectivity properties."""
1404
+
1405
+ def __init__(self) -> None: ...
1406
+ def find(self, dev: str) -> str:
1407
+ """Return the device id for a given device address.
1408
+
1409
+ Args:
1410
+ dev: Device address string e.g. UHF-DEV2000.
1411
+
1412
+ Returns:
1413
+ Device id."""
1414
+
1415
+ def findAll(self) -> List[str]:
1416
+ """Return a list of all discoverable devices.
1417
+
1418
+ Returns:
1419
+ List of all discoverable devices."""
1420
+
1421
+ def get(self, dev: str) -> Dict[str, LabOneResultAny]:
1422
+ """Return the device properties for a given device id.
1423
+
1424
+ Args:
1425
+ dev: Device id string e.g. DEV2000.
1426
+
1427
+ Returns:
1428
+ Device properties."""
1429
+
1430
+ def setDebugLevel(self, severity: Literal[0, 1, 2, 3, 4, 5, 6]) -> None:
1431
+ """Set debug level.
1432
+
1433
+ Args:
1434
+ severity: debug level."""
1435
+
1436
+ def compile_seqc(
1437
+ code: str,
1438
+ devtype: str,
1439
+ options: Union[str, List[str]],
1440
+ index: int,
1441
+ samplerate: Optional[float] = None,
1442
+ sequencer: Optional[str] = None,
1443
+ wavepath: Optional[str] = None,
1444
+ waveforms: Optional[str] = None,
1445
+ filename: Optional[str] = None,
1446
+ ) -> Tuple[bytes, Dict[str, Any]]:
1447
+ """Compile the sequencer code.
1448
+
1449
+ This function is a purely static function that does not require an
1450
+ active connection to a Data Server.
1451
+
1452
+ .. versionadded:: 22.08
1453
+
1454
+ Args:
1455
+ code: SeqC input
1456
+ devtype: target device type, e.g., HDAWG8, SHFQC
1457
+ options: list of device options, or string of
1458
+ options separated by newlines as returned by node
1459
+ /dev.../features/options.
1460
+ index: index of the AWG core
1461
+ samplerate: target sample rate of the sequencer
1462
+ Mandatory and only respected for HDAWG. Should match the
1463
+ value set on the device:
1464
+ `/dev.../system/clocks/sampleclock/freq`.
1465
+ sequencer: one of 'qa', 'sg', or 'auto'.
1466
+ Mandatory for SHFQC.
1467
+ wavepath: path to directory with waveforms. Defaults to
1468
+ path used by LabOne UI or AWG Module.
1469
+ waveforms: list of CSV waveform files separated by ';'.
1470
+ Defaults to an empty list. Set to `None` to include
1471
+ all CSV files in `wavepath`.
1472
+ filename: name of embedded ELF filename.
1473
+
1474
+ Returns:
1475
+ Tuple (elf, extra) of binary ELF data for sequencer and extra
1476
+ dictionary with compiler output.
1477
+
1478
+ Note:
1479
+ The same function is available in the `zhinst-seqc-compiler`
1480
+ package. `zhinst.core.compile_seqc` will forward the call to
1481
+ `zhinst.seqc_compiler.compile_seqc` if a compatible version of
1482
+ this package is installed. A version is compatible if major and
1483
+ minor package versions match, and the revision of
1484
+ `zhinst-seqc-compiler` is greater or equal to the revision of
1485
+ `zhinst-core`. A warning will be issued if the versions do not
1486
+ match."""