@@ -20,11 +20,13 @@ Instruments card of course.
20
20
Installation
21
21
============
22
22
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/ ) ,
28
30
[ 14.0.0] ( http://www.ni.com/download/ni-daqmx-14.0/4918/en/ ) , or
29
31
[ 9.6.0] ( http://www.ni.com/download/ni-daqmx-9.6/3423/en/ ) ) from National
30
32
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.
361
363
Find ` NIDAQmx.h ` , which usually lives in
362
364
` C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include ` .
363
365
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:
365
374
366
375
```
367
376
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)
373
386
$ mv NIDAQmx.jl src/functions_V<version>.jl
374
387
$ mv common.jl src/constants_V<version>.jl
388
+ $ rm LibTemplate.jl ctypes.jl
375
389
```
376
390
377
- The following manual edits are then necessary:
391
+ Finally, the following manual edits are necessary:
378
392
379
- + For NI-DAQmx v9.6.0 in ` NIDAQmx.h ` change
380
- ` defined(__linux__) ` to ` defined(__linux__) || defined(__APPLE__) ` .
381
393
+ 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 `
383
396
+ in NI-DAQmx v17.1.0 comment out ` const CVIAbsoluteTime = VOID `
384
397
+ 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 `
386
399
+ 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
388
401
search for ` CallbackRef ` and replace with ` CallbackPtr ` .
389
402
+ 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 `
391
404
392
405
393
406
Author
0 commit comments