DAQs and IO Channels
A dabs.resources.DAQ is a data acquisition board. When it is constructed it creates one
dabs.resources.IO resource per physical channel, and those channel resources are what
devices are configured with: a galvo does not hold a channel number, it holds a handle to an
AO.
hRS = dabs.resources.ResourceStore();
hDAQ = hRS.filterByName('vDAQ0');
hAO = hRS.filterByName('/vDAQ0/AO0');
DAQ classes
Class |
Hardware |
|---|---|
|
vDAQ. |
|
National Instruments DAQmx devices. |
|
National Instruments FPGA (RIO) devices. |
|
FlexRIO adapter modules. |
|
Simulated boards for a system with no hardware attached. |
Common members
Member |
Description |
|---|---|
|
The board’s channel resources, by kind. |
|
Dependent. All of the above as one cell array. |
|
The underlying vendor object. |
|
True for a simulated board. |
|
Reset the board. |
|
Every registered user of the board and of its channels. The right call when you need to know what would be disturbed by reconfiguring a board. |
|
Rescan for vDAQ, NIRIO and NIDAQ hardware. |
vDAQ specifics
Member |
Description |
|---|---|
|
The |
|
Bitfile loaded onto the FPGA. |
|
Do not load the bitfile if another MATLAB instance already owns the FPGA. |
|
Board identification. |
|
PCIe link status. Useful when diagnosing bandwidth problems. |
|
FPGA state and other processes using the board. |
|
Load and unload the FPGA. |
|
Open the vDAQ test panel. |
|
Board information as a struct. |
See also
vDAQ® API for creating analog and digital tasks on the vDAQ.
IO classes
All IO resources derive from dabs.resources.IO.
Property |
Description |
|---|---|
|
The board this channel belongs to. |
|
The board’s name. |
|
Numeric index parsed from the channel name. |
|
The channel name without the leading device path. |
|
Last value written or read. |
lastKnownValue fires the lastKnownValueChanged event when it changes, which is how
widgets track a channel without polling it.
hIO.isOnSameDAQ(other) accepts another IO, a DAQ, a device name or an array of any of
these, and reports whether they share a board. Several devices require their channels to be
on the same board, and this is how they check.
Per-type API
Class |
Members |
|---|---|
|
|
|
|
|
Internal analog inputs and the high-speed digitizer inputs. |
|
|
|
|
|
A bidirectional digital line. |
|
|
|
Clock input and output terminals. |
hRS = dabs.resources.ResourceStore();
hAO = hRS.filterByName('/vDAQ0/AO0');
hAO.setValue(1.5); % volts
v = hAO.queryValue();
hDO = hRS.filterByName('/vDAQ0/D0.0');
hDO.setValue(true);
hDO.tristate();
hAI = hRS.filterByName('/vDAQ0/AI0');
samples = hAI.readValue(100);
Warning
Writing directly to a channel that ScanImage has reserved fights with whatever
is driving it. Check hIO.reserved and hIO.userInfo first, and prefer doing this
while ScanImage is idle.