nidaqlib.system¶
nidaqlib.system ¶
System discovery — :func:find_devices, :func:list_physical_channels.
See :mod:nidaqlib.system.discovery for behaviour and the
:class:DiscoveryResult / :class:DeviceInfo shapes.
DeviceInfo
dataclass
¶
DeviceInfo(
*,
name,
product_type,
serial_number,
ai_physical_channels,
ao_physical_channels,
di_lines,
do_lines,
ci_physical_channels,
co_physical_channels,
)
Snapshot of one NI device's identity and physical-channel inventory.
Cached on a :class:~nidaqlib.tasks.session.DaqSession at configure
time and surfaced by :meth:DaqSession.snapshot. The
:func:~nidaqlib.system.discovery.find_devices enumeration also
wraps a populated :class:DeviceInfo inside each successful
:class:DiscoveryResult.
DiscoveryResult
dataclass
¶
DiscoveryResult(
*,
ok,
port,
address=None,
baudrate=None,
protocol=None,
device_info=None,
error=None,
elapsed_s=0.0,
)
One enumeration row from :func:find_devices.
Shape-shared across sibling libraries (alicatlib,
sartoriuslib, watlowlib) so cross-instrument tooling can join
on a common discovery record.
Attributes:
| Name | Type | Description |
|---|---|---|
ok |
bool
|
|
port |
str
|
NI device name ( |
address |
str | int | None
|
Always |
baudrate |
int | None
|
Always |
protocol |
ProtocolKind | None
|
Always |
device_info |
DeviceInfo | None
|
Populated only when |
error |
NIDaqError | None
|
Populated only when |
elapsed_s |
float
|
Wall-clock seconds spent enumerating this entry. |
NIDaqDiscoveryResult
dataclass
¶
NIDaqDiscoveryResult(
*,
ok,
port,
address=None,
baudrate=None,
protocol=None,
device_info=None,
error=None,
elapsed_s=0.0,
product_type=None,
serial_number=None,
chassis=None,
physical_module=None,
)
Bases: DiscoveryResult
NI-specific discovery row carrying product / chassis identity.
Subclasses :class:DiscoveryResult without renaming any base fields.
The NI extras (product_type, serial_number, chassis,
physical_module) sit alongside the shape-shared base.
find_devices ¶
Enumerate NI DAQ devices visible to the driver. Never raises.
Returns:
| Name | Type | Description |
|---|---|---|
One |
list[DiscoveryResult]
|
class: |
list[DiscoveryResult]
|
NI hardware is present. On enumeration-level failure (driver |
|
list[DiscoveryResult]
|
missing, system call raises), returns a single |
|
list[DiscoveryResult]
|
with |
Source code in src/nidaqlib/system/discovery.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
list_physical_channels ¶
Return AI physical channel names for device (e.g. "Dev1").
For AO / DI / DO / counter inventories, use :func:find_devices and
inspect the returned :class:DeviceInfo.
Raises:
| Type | Description |
|---|---|
NIDaqBackendError
|
NI rejected the request (e.g. unknown device). |