Skip to content

About

EPICS PVAccess server for cDAQ system from National Instruments

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cDAQ EPICS PVAccess Server. Under Development.

Requires the NI-DAQmx system driver. The Python nidaqmx dependency does not install the system driver. At startup, the server registers the network chassis at 192.168.0.16 if it is not already registered, requesting reservation for this host without overriding another host's reservation.

From this directory, install dependencies and start the server:

uv sync
uv run epicsdev-cdaq --chassis cDAQ1

Alternatively, run python -m epicsdev_cdaq with the dependencies installed. Omitting --chassis serves supported modules in all registered cDAQ chassis. Use --chassis-ip 192.168.0.20 for a different network address, or --chassis-ip '' to disable automatic registration. An already registered --chassis name takes precedence over the IP address. If the IP is already registered under a different name, the server reuses that name instead of registering the device twice. New registrations use --chassis as the name when supplied; otherwise NI-DAQmx chooses the name. The device list is refreshed after registration before discovering modules. Registration is retained on exit. Discovery happens at startup; restart after changing installed modules.

PVs

The default prefix is cdaq:0:; use the positional device prefix and --instance to change it. Inputs are array PVs; outputs have one writable scalar PV per channel, with zero-based indices:

Module PV suffix Values
NI-9213 <module>:TC 16 thermocouple temperatures in degrees C
NI-9201 <module>:AI 8 voltage inputs
NI-9209 <module>:AI Voltage inputs reported by DAQmx
NI-9263 <module>:AO0 through <module>:AO3 One voltage output per PV
NI-9264 <module>:AO0 through <module>:AO15 One voltage output per PV
NI-9401 <module>:DI 8 digital inputs, 0 or 1
NI-9401 (output mode) <module>:DO0 through <module>:DO7 One digital output per PV, 0 or 1

For example, cdaq:0:cDAQ1Mod1:TC. The modules PV lists supported module names. Each module also has :model, :channels (physical channel names in channel index order), and :status PVs. Input errors update status without stopping other modules. Input values remain at their last reading on error; check status before relying on them. Reads are on demand, not synchronized waveform acquisition.

Voltage channels use a -10 to +10 V range. NI-9213 uses built-in cold-junction compensation and type K thermocouples by default; change the type with --thermocouple-type J (B, E, J, K, N, R, S, and T are supported).

Outputs

NI-9401 defaults to input. To configure a whole module as output:

uv run epicsdev-cdaq --chassis cDAQ1 --digital-output cDAQ1Mod4

This replaces that module's :DI PV with writable :DO0, :DO1, etc. PVs. Repeat the option for additional modules. Mixed input/output directions within one module are not supported.

Write a scalar voltage to :AO0, :AO1, etc., or a scalar 0 or 1 to :DO0, :DO1, etc.; arrays and invalid values are rejected. The old :AO and :DO array PVs are no longer provided. Each write uses a single-channel on-demand DAQmx task, closed after the write, and commands only that physical channel; other channels are not written or initialized to zero. For example, cdaq:0:cDAQ1Mod3:AO0 controls the first channel listed in that module's :channels PV. Output PVs report the last successful command, not hardware readback. Initial zero values are placeholders until the first write, indicated by the initial :status = Not written. Status is module-wide: an OK status does not mean every output channel has been written. The server does not write outputs during startup or restore output commands from autosave. Stopping polling does not reset outputs; shutdown behavior follows the device and driver configuration.

Use --timeout to change the DAQmx I/O timeout (default 10 seconds).

Tests

Run hardware-free regression tests with the project dependencies installed:

uv run python -m unittest discover -s tests -v

About

EPICS PVAccess server for cDAQ system from National Instruments

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages