Skip to content

Commit 7facae3

Browse files
authored
Merge pull request #26 from bjarthur/bja/v196b
add support for NI-DAQmx 19.6
2 parents 0e8d7e9 + d5dbc89 commit 7facae3

File tree

5 files changed

+16662
-9688
lines changed

5 files changed

+16662
-9688
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name = "NIDAQ"
22
uuid = "66b72792-1abf-55ab-8064-6e9051317175"
3+
version = "0.5.0"
34

45
[compat]
5-
julia = "0.7.0"
6+
julia = "0.7, 1"
67

78
[extras]
89
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

README.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ Instruments card of course.
2020
Installation
2121
============
2222

23-
First download and install NI-DAQmx version [18.6](http://www.ni.com/en-us/support/downloads/drivers/download/unpackaged.ni-daqmx.291872.html) (
24-
or for julia v6, [17.1.0](http://www.ni.com/download/ni-daqmx-17.1/6836/en/);
25-
or for Julia v5, [16.0.0](http://www.ni.com/download/ni-daqmx-16.0/6120/en/);
26-
or for Julia v4, [15.1.1](http://www.ni.com/download/ni-daqmx-15.1.1/5665/en/);
27-
or for Julia v3, [14.1.0](http://www.ni.com/download/ni-daqmx-14.1/4953/en/),
23+
First download and install NI-DAQmx version
24+
[19.6](https://www.ni.com/en-us/support/downloads/drivers/download/packaged.ni-daqmx.333268.html) (or
25+
[18.6](http://www.ni.com/en-us/support/downloads/drivers/download/unpackaged.ni-daqmx.291872.html);
26+
or for Julia 0.6, [17.1.0](http://www.ni.com/download/ni-daqmx-17.1/6836/en/);
27+
or for Julia 0.5, [16.0.0](http://www.ni.com/download/ni-daqmx-16.0/6120/en/);
28+
or for Julia 0.4, [15.1.1](http://www.ni.com/download/ni-daqmx-15.1.1/5665/en/);
29+
or for Julia 0.3, [14.1.0](http://www.ni.com/download/ni-daqmx-14.1/4953/en/),
2830
[14.0.0](http://www.ni.com/download/ni-daqmx-14.0/4918/en/), or
2931
[9.6.0](http://www.ni.com/download/ni-daqmx-9.6/3423/en/)) from National
3032
Instruments. Then on the Julia command line:
@@ -361,33 +363,44 @@ to set `BUILD_LLVM_CLANG=1` in Make.user, and compile Julia from source.
361363
Find `NIDAQmx.h`, which usually lives in
362364
`C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include`.
363365

364-
Then,
366+
Edit this header file as follows:
367+
368+
+ For NI-DAQmx v19.6 in `NIDAQmx.h` change `__int64 int64` to `long long int int64`
369+
and `unsigned __int64 uInt64` to `unsigned long long uInt64`.
370+
+ For NI-DAQmx v9.6.0 in `NIDAQmx.h` change
371+
`defined(__linux__)` to `defined(__linux__) || defined(__APPLE__)`.
372+
373+
Then run Clang to produce the corresponding Julia files:
365374

366375
```
367376
julia> using Clang
368-
julia> context = wrap_c.init()
369-
julia> context.common_file = "common.jl"
370-
julia> context.headers = ["NIDAQmx.h"]
371-
julia> run(context)
372-
$ mv NIDAQmx.h src/NIDAQmx_V<version>.h
377+
julia> wc = init(; headers = ["NIDAQmx.h"],
378+
output_file = "NIDAQmx.jl",
379+
common_file = "common.jl",
380+
clang_includes = vcat(CLANG_INCLUDE),
381+
clang_args = map(x->"-I"*x, find_std_headers()),
382+
header_wrapped = (root, current)->root == current,
383+
header_library = x->"NIDAQmx",
384+
clang_diagnostics = true)
385+
julia> run(wc)
373386
$ mv NIDAQmx.jl src/functions_V<version>.jl
374387
$ mv common.jl src/constants_V<version>.jl
388+
$ rm LibTemplate.jl ctypes.jl
375389
```
376390

377-
The following manual edits are then necessary:
391+
Finally, the following manual edits are necessary:
378392

379-
+ For NI-DAQmx v9.6.0 in `NIDAQmx.h` change
380-
`defined(__linux__)` to `defined(__linux__) || defined(__APPLE__)`.
381393
+ In `constants_V<version>.jl`
382-
+ comment out `const CVICALLBACK = CVICDECL`,
394+
+ delete `const CVICALLBACK = CVICDECL`,
395+
+ in NI-DAQmx v19.6 add `struct CVITime; lsb::uInt64; msb::int64; end`
383396
+ in NI-DAQmx v17.1.0 comment out `const CVIAbsoluteTime = VOID`
384397
+ change `const bool32 = uInt32` to `const bool32 = Bool32`.
385-
+ in NI-DAQmx v15.1.1 and greater comment out `using Compat`
398+
+ in NI-DAQmx v15 to v18 comment out `using Compat`
386399
+ In `functions_V<version>.jl`
387-
+ globally search for `Ptr` and replace with `Ref`, then globally
400+
+ in NI-DAQmx v18 and earlier, globally search for `Ptr` and replace with `Ref`, then globally
388401
search for `CallbackRef` and replace with `CallbackPtr`.
389402
+ globally search for `Cstring` and replace with `SafeCstring`
390-
+ (for Julia 0.7 support) replace `type` with `_type`
403+
+ for Julia 0.7 support, replace `type` with `_type`
391404

392405

393406
Author

0 commit comments

Comments
 (0)