You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These examples show you how to interact with National Instruments devices using MATLAB.
4
+
These examples show you how to interact with [National Instruments](http://www.ni.com) devices using [MATLAB](http://www.mathworks.com/).
5
5
The focus is [Vidrio's](http://scanimage.vidriotechnologies.com/display/SIH/ScanImage+Home) free [DAQmx](https://www.ni.com/dataacquisition/nidaqmx.htm) wrapper, `dabs.ni.daqmx`.
6
6
Also supplied are some contrasting examples using The Mathworks [Data Acquisition Toolbox](https://www.mathworks.com/help/daq/).
7
-
Since this is already well described, there are fewer of these examples.
8
7
All examples require a Windows machine.
9
8
10
9
11
10
### The `dabs.ni.daqmx` wrapper
12
-
The MATLAB Data Acquisition Toolbox is the most common way of handling data acquisition in MATLAB.
13
-
However, with NI hardware you can also use the free `dabs.ni.daqmx` wrapper that is part of [ScanImage](http://scanimage.vidriotechnologies.com/).
11
+
The MATLAB [Data Acquisition Toolbox](https://www.mathworks.com/products/daq.html) is the most common way of handling data acquisition in MATLAB.
12
+
However, with NI hardware you can also use the free `dabs.ni.daqmx` wrapper that is part of [ScanImage](http://www.vidriotechnologies.com/).
14
13
This is a thin, object-oriented wrapper that provides access to almost the full DAQmx API.
15
14
16
15
In addition to `dabs.ni.daqmx`, ScanImage also supplies an [FPGA](http://www.ni.com/fpga/) interface wrapper (`dabs.ni.rio`) which can be used to run a [bitfile](http://www.ni.com/white-paper/9640/en/) compiled using LabVIEW FPGA on any [NI RIO](http://www.ni.com/academic/students/learn-rio/what-is/) FPGA target.
@@ -22,15 +21,15 @@ This currently supports only a small subset of the NI VISA API.
22
21
This repository contains a bunch of NI DAQmx examples using both the MATLAB DAQ toolbox and the `dabs.ni.daqmx` wrapper.
23
22
The examples provided here overlap with those provided by Vidrio in `dabs.ni.daqmx.demos`, but are more up to date and more extensively commented.
24
23
The `DAQmx_ANSI_C_examples` directory is for convenience and contains copies of some of the examples installed along with DAQmx.
25
-
Some examples use more advanced MATLAB features, these are covered by example code in the `basicConcepts` directory.
24
+
The `basicConcepts` directory illustrates some of the more advanced programming concepts which crop up.
26
25
27
26
28
27
## Installation
29
28
30
29
* Download [ScanImage](http://scanimage.vidriotechnologies.com/display/SIH/ScanImage+Home) and add its root directory to your MATLAB path.
31
-
* Install the supported version of DAQmx. For example, ScanImage 5.2 [requires v15.5](http://scanimage.vidriotechnologies.com/display/SI2016/Software+Version+Compatibility)
30
+
* Install the supported version of DAQmx. For example, ScanImage 5.2 [requires v15.5](http://scanimage.vidriotechnologies.com/display/SI2016/Software+Version+Compatibility).
32
31
* Add the examples in this repository to your path or `cd` to the `code` directory to run the examples.
33
-
* You may [create simulated devices](http://www.ni.com/tutorial/3698/en/) in [NI MAX](http://digital.ni.com/public.nsf/allkb/71544521BDE34FFB86256FCF005F4FB6) to run with the examples on a machine with no NI hardware connected.
32
+
* You may [create simulated devices](http://www.ni.com/tutorial/3698/en/) in [NI MAX](http://digital.ni.com/public.nsf/allkb/71544521BDE34FFB86256FCF005F4FB6) to run the examples on a machine with no NI hardware connected.
34
33
Triggers do not work in simulated mode: they fire immediately.
35
34
Simulated mode also works in a virtual machine.
36
35
@@ -47,10 +46,11 @@ For each example, first look at the help text (e.g. `help vidrio.AO.softwareTime
47
46
```
48
47
49
48
There are further comments in-line so open the example in an editor to learn more.
50
-
Example have been tested with an NI PCI-6229.
51
-
Many have also been verified to work with a simulated NI PCIe-6341.
52
-
You may get errors with certain combinations of cards and examples.
53
-
e.g. With a PCI-6115 certain buffered examples will complain that the sample rate is too low.
49
+
Examples have been tested with an NI [PCI-6229](http://www.ni.com/en-us/support/model.pci-6229.html) and [PXIe-6341](http://www.ni.com/documentation/en/pxi-multifunction-io-module/latest/pxie-6341/overview/).
50
+
Many examples have also been verified to work with a simulated NI PCIe-6341.
51
+
Not all examples work on all boards (e.g. the [re-triggerable example](https://github.com/tenss/MatlabDAQmx/blob/master/code/%2Bvidrio/%2Bmixed/DO_retriggerable.m) requires an [X-Series board](http://www.ni.com/xseries/)).
52
+
You may simply get errors with certain combinations of cards and examples.
53
+
e.g. With a PCI-6115, certain buffered examples will complain that the sample rate is too low so you will need to modify this.
54
54
55
55
56
56
## Key Contents
@@ -78,7 +78,7 @@ e.g. With a PCI-6115 certain buffered examples will complain that the sample rat
78
78
*`vidrio.mixed.AOandAI_OO` - Interactive continuous AI and AO using object-oriented programming.
79
79
*`vidrio.mixed.AOandAI_OO_sharedClock` - Interactive continuous AI and AO with shared clock between AO and AI.
80
80
* For retriggerable tasks see `vidrio.mixed.DO_retriggerable` and `vidrio.mixed.AO_retriggerable`
81
-
81
+
*`vidrio.sync` is a demo package showing how to synchronise two DAQ devices and why you need to do so.
82
82
83
83
### Hints
84
84
The use of `try`/`catch` blocks should ensure the DAQmx tasks always shut down cleanly.
@@ -90,7 +90,7 @@ If they do not:
90
90
*[Using NI-DAQmx in Text Based Programming Environments](http://www.ni.com/tutorial/5409/en/)
91
91
*[DAQmx C Reference help](http://zone.ni.com/reference/en-XX/help/370471AE-01/) and [C functions listing](http://zone.ni.com/reference/en-XX/help/370471AE-01/TOC3.htm)
92
92
* Vidrio DAQmx [docs](http://scanimage.vidriotechnologies.com/display/API/Hardware+Support+Package+%28dabs%29+-+ni+-+daqmx) and [demos](http://scanimage.vidriotechnologies.com/display/API/Hardware+Support+Package+%28dabs%29+-+ni+-+daqmx+-+demos)
93
-
93
+
* See [SimpleMScanner](https://github.com/tenss/SimpleMScanner) for basic 2-photon scanning software written using the techniques shown here.
0 commit comments