Skip to content

Commit 915a6b9

Browse files
kalidkeclaude
andcommitted
Rename package from NIDAQmx.jl to DAQmx.jl
- Rename module from NIDAQmx to DAQmx - Rename NIDAQError → DAQmxError, NIDAQWarning → DAQmxWarning - Rename NIDAQmxVersion → DAQmxVersion - Update all documentation, tests, and scripts - Add trademark disclaimer for NI-DAQmx This avoids both: 1. Registry name similarity with existing NIDAQ package 2. Potential trademark concerns with using "NIDAQmx" in package name Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 838d987 commit 915a6b9

22 files changed

+168
-157
lines changed

CLAUDE.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
NIDAQmx.jl is a Julia wrapper for National Instruments NI-DAQmx driver, providing type-safe access to NI data acquisition hardware. The package uses parametric types for tasks and Julia enums instead of raw constants.
7+
DAQmx.jl is a Julia wrapper for National Instruments NI-DAQmx driver, providing type-safe access to NI data acquisition hardware. The package uses parametric types for tasks and Julia enums instead of raw constants.
88

99
## Development Commands
1010

@@ -15,10 +15,13 @@ julia --project -e 'using Pkg; Pkg.test()'
1515
# Run only mock tests (no hardware required)
1616
julia --project test/test_mock.jl
1717

18+
# Run only hardware tests (requires NI-DAQmx library and hardware)
19+
julia --project test/test_hardware.jl
20+
1821
# Build documentation
1922
julia --project=docs docs/make.jl
2023

21-
# Regenerate bindings from NIDAQmx.h (requires Clang.jl and NI-DAQmx SDK)
24+
# Regenerate bindings from DAQmx.h (requires Clang.jl and NI-DAQmx SDK)
2225
julia --project=gen gen/generator.jl
2326
```
2427

@@ -32,7 +35,7 @@ Task{K<:TaskKind} where K in {AnalogInputKind, AnalogOutputKind, DigitalInputKin
3235
Type aliases: `AITask`, `AOTask`, `DITask`, `DOTask`, `CITask`, `COTask`
3336

3437
### Source Organization
35-
- `src/generated/` - Auto-generated from NIDAQmx.h via Clang.jl (types.jl, constants.jl, functions.jl)
38+
- `src/generated/` - Auto-generated from DAQmx.h via Clang.jl (types.jl, constants.jl, functions.jl)
3639
- `src/library.jl` - Library loading and version detection
3740
- `src/errors.jl` - Error handling with `@check` macro that wraps all DAQmx calls
3841
- `src/types.jl` - Task types, channel types, and Julia enums (TerminalConfig, Edge, SampleMode, etc.)
@@ -48,13 +51,16 @@ Type aliases: `AITask`, `AOTask`, `DITask`, `DOTask`, `CITask`, `COTask`
4851
- **Task finalizers**: Tasks register finalizers to auto-cleanup handles via `DAQmxClearTask`
4952
- **Channel functions return task**: Functions like `add_ai_voltage!` return the task for method chaining
5053
- **Library availability**: `is_library_available()` checks if NI-DAQmx is installed; tests and code paths adapt accordingly
54+
- **Convenience constructors**: Task types have convenience constructors that create task + add channel in one call: `AITask("Dev1/ai0")`, `AOTask("Dev1/ao0")`, `DITask("Dev1/port0/line0")`, `CITask("Dev1/ctr0"; method=:count_edges)`
5155

5256
### Generated Bindings
5357
The `gen/` directory contains Clang.jl configuration. Bindings are pre-generated and committed; regeneration requires:
5458
1. NI-DAQmx SDK installed with header file
5559
2. Update paths in `gen/generator.toml` if needed
5660
3. Run `julia --project=gen gen/generator.jl`
5761

62+
**Note on Ref/Ptr types**: Generated functions use `Ref{T}` for output parameters but the ccall uses `Ptr{T}`. When calling these functions, pass `Ref` values which Julia automatically converts to pointers. For `Ptr{TaskHandle}` specifically, use `Base.unsafe_convert(Ptr{TaskHandle}, handle_ref)`.
63+
5864
### Testing Strategy
5965
- `test/test_mock.jl` - Tests type definitions, enums, error handling, and API patterns without hardware
6066
- `test/test_hardware.jl` - Integration tests requiring NI-DAQmx hardware (skipped if library unavailable or no devices detected)

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "NIDAQmx"
1+
name = "DAQmx"
22
uuid = "bc903ccc-f951-4f60-9748-ff64248ad6aa"
33
authors = ["klidke@unm.edu"]
44
version = "0.1.0"

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
# NIDAQmx.jl
1+
# DAQmx.jl
22

3-
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://LidkeLab.github.io/NIDAQmx.jl/stable/)
4-
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://LidkeLab.github.io/NIDAQmx.jl/dev/)
5-
[![Build Status](https://github.com/LidkeLab/NIDAQmx.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/LidkeLab/NIDAQmx.jl/actions/workflows/CI.yml?query=branch%3Amain)
6-
[![Coverage](https://codecov.io/gh/LidkeLab/NIDAQmx.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/LidkeLab/NIDAQmx.jl)
3+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://LidkeLab.github.io/DAQmx.jl/stable/)
4+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://LidkeLab.github.io/DAQmx.jl/dev/)
5+
[![Build Status](https://github.com/LidkeLab/DAQmx.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/LidkeLab/DAQmx.jl/actions/workflows/CI.yml?query=branch%3Amain)
6+
[![Coverage](https://codecov.io/gh/LidkeLab/DAQmx.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/LidkeLab/DAQmx.jl)
77

8-
A Julia wrapper for National Instruments NI-DAQmx driver, providing type-safe access to NI data acquisition hardware.
8+
A Julia wrapper for the NI-DAQmx driver, providing type-safe access to NI data acquisition hardware.
9+
10+
NI-DAQmx is a trademark of National Instruments. This project is not affiliated with or endorsed by National Instruments.
911

1012
## Installation
1113

1214
```julia
1315
using Pkg
14-
Pkg.add(url="https://github.com/LidkeLab/NIDAQmx.jl")
16+
Pkg.add("DAQmx")
1517
```
1618

1719
Requires NI-DAQmx driver to be installed on your system.
1820

1921
## Quick Start
2022

2123
```julia
22-
using NIDAQmx
24+
using DAQmx
2325

2426
# List available devices
2527
devs = devices()
@@ -48,7 +50,7 @@ write(task, sin.(2π .* (0:99) ./ 100))
4850
## Documentation
4951

5052
- [API Reference](api_overview.md) - Complete function and type documentation
51-
- [Full Documentation](https://LidkeLab.github.io/NIDAQmx.jl/dev/) - Guides and examples
53+
- [Full Documentation](https://LidkeLab.github.io/DAQmx.jl/dev/) - Guides and examples
5254

5355
## License
5456

api_overview.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NIDAQmx.jl API Reference
1+
# DAQmx.jl API Reference
22

33
Julia wrapper for National Instruments NI-DAQmx driver, providing type-safe access to NI data acquisition hardware.
44

@@ -10,7 +10,7 @@ Julia wrapper for National Instruments NI-DAQmx driver, providing type-safe acce
1010

1111
## Key Concepts
1212

13-
NIDAQmx.jl uses parametric task types (`Task{K}`) where `K` indicates the task kind (analog input, digital output, etc.). This enables type-safe dispatch and compile-time guarantees about valid operations. Tasks automatically clean up handles via finalizers. Julia enums replace raw DAQmx constants for terminal configuration, edges, and sample modes.
13+
DAQmx.jl uses parametric task types (`Task{K}`) where `K` indicates the task kind (analog input, digital output, etc.). This enables type-safe dispatch and compile-time guarantees about valid operations. Tasks automatically clean up handles via finalizers. Julia enums replace raw DAQmx constants for terminal configuration, edges, and sample modes.
1414

1515
## Types
1616

@@ -20,10 +20,10 @@ NIDAQmx.jl uses parametric task types (`Task{K}`) where `K` indicates the task k
2020
Task{K<:TaskKind}
2121
```
2222

23-
A NIDAQmx task parameterized by kind for type-safe dispatch.
23+
A DAQmx task parameterized by kind for type-safe dispatch.
2424

2525
**Fields:**
26-
- `handle::TaskHandle`: The underlying NIDAQmx task handle
26+
- `handle::TaskHandle`: The underlying DAQmx task handle
2727
- `name::String`: The name of the task
2828

2929
**Type Aliases:**
@@ -334,15 +334,15 @@ get_all_channel_properties(task, channel_name) -> Dict
334334
### Library Information
335335

336336
```julia
337-
library_version() -> NIDAQmxVersion
338-
cached_library_version() -> Union{NIDAQmxVersion, Nothing}
337+
library_version() -> DAQmxVersion
338+
cached_library_version() -> Union{DAQmxVersion, Nothing}
339339
is_library_available() -> Bool
340340
```
341341

342342
### Error Handling
343343

344344
```julia
345-
check_error(code) # Throws NIDAQError for negative codes
345+
check_error(code) # Throws DAQmxError for negative codes
346346
get_error_message(code) -> String
347347
get_extended_error_info() -> String
348348
```
@@ -352,7 +352,7 @@ get_extended_error_info() -> String
352352
### Analog Input Acquisition
353353

354354
```julia
355-
using NIDAQmx
355+
using DAQmx
356356

357357
# Create task and configure
358358
task = AITask("Dev1/ai0"; terminal_config=RSE)
@@ -368,7 +368,7 @@ stop!(task)
368368
### Continuous Analog Output
369369

370370
```julia
371-
using NIDAQmx
371+
using DAQmx
372372

373373
task = AOTask("Dev1/ao0")
374374
configure_timing!(task; rate=10000.0, sample_mode=ContinuousSamples, samples_per_channel=10000)
@@ -386,7 +386,7 @@ stop!(task)
386386
### Digital I/O
387387

388388
```julia
389-
using NIDAQmx
389+
using DAQmx
390390

391391
# Read digital port
392392
di_task = DITask("Dev1/port0")
@@ -400,7 +400,7 @@ write(do_task, UInt8[0xFF])
400400
### Counter Input (Edge Counting)
401401

402402
```julia
403-
using NIDAQmx
403+
using DAQmx
404404

405405
task = CITask("Dev1/ctr0"; method=:count_edges, edge=Rising)
406406
configure_implicit_timing!(task; sample_mode=ContinuousSamples)
@@ -412,7 +412,7 @@ stop!(task)
412412
### Triggered Acquisition
413413

414414
```julia
415-
using NIDAQmx
415+
using DAQmx
416416

417417
task = AITask("Dev1/ai0")
418418
configure_timing!(task; rate=10000.0, samples_per_channel=1000)
@@ -427,7 +427,7 @@ stop!(task)
427427
### Multi-Channel Acquisition
428428

429429
```julia
430-
using NIDAQmx
430+
using DAQmx
431431

432432
task = AITask()
433433
add_ai_voltage!(task, "Dev1/ai0"; terminal_config=RSE)

dev/scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NIDAQmx Development Scripts
1+
# DAQmx Development Scripts
22

33
Scripts for testing and debugging NI-DAQmx hardware.
44

dev/scripts/list_devices.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Pkg
66
Pkg.activate(joinpath(@__DIR__, "..", ".."))
77

8-
using NIDAQmx
8+
using DAQmx
99

1010
println("=" ^ 60)
1111
println("NI-DAQmx Device Discovery")

dev/scripts/test_channels.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
using Pkg
1515
Pkg.activate(joinpath(@__DIR__, "..", ".."))
1616

17-
using NIDAQmx
17+
using DAQmx
1818
using Printf
1919

2020
# Configuration

docs/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3-
NIDAQmx = "bc903ccc-f951-4f60-9748-ff64248ad6aa"
3+
DAQmx = "bc903ccc-f951-4f60-9748-ff64248ad6aa"
44

5-
[sources.NIDAQmx]
5+
[sources.DAQmx]
66
path = ".."

docs/make.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using NIDAQmx
1+
using DAQmx
22
using Documenter
33

4-
DocMeta.setdocmeta!(NIDAQmx, :DocTestSetup, :(using NIDAQmx); recursive=true)
4+
DocMeta.setdocmeta!(DAQmx, :DocTestSetup, :(using DAQmx); recursive=true)
55

66
makedocs(;
7-
modules=[NIDAQmx],
7+
modules=[DAQmx],
88
authors="klidke@unm.edu",
9-
sitename="NIDAQmx.jl",
9+
sitename="DAQmx.jl",
1010
format=Documenter.HTML(;
11-
canonical="https://LidkeLab.github.io/NIDAQmx.jl",
11+
canonical="https://LidkeLab.github.io/DAQmx.jl",
1212
edit_link="main",
1313
assets=String[],
1414
prettyurls=get(ENV, "CI", "false") == "true",
@@ -22,6 +22,6 @@ makedocs(;
2222
)
2323

2424
deploydocs(;
25-
repo="github.com/LidkeLab/NIDAQmx.jl",
25+
repo="github.com/LidkeLab/DAQmx.jl",
2626
devbranch="main",
2727
)

docs/src/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# API Reference
22

33
```@meta
4-
CurrentModule = NIDAQmx
4+
CurrentModule = DAQmx
55
```
66

77
```@index
@@ -197,7 +197,7 @@ get_all_channel_properties
197197
## Library Information
198198

199199
```@docs
200-
NIDAQmxVersion
200+
DAQmxVersion
201201
library_version
202202
cached_library_version
203203
is_library_available

0 commit comments

Comments
 (0)