Introduction
This USB DAQ Driver is compatible with the NI USB-6008/6009 devices and runs on the Raspberry Pi®. It allows the user to acquire data from an analogue input channel in either a continuous or finite manner, whilst streaming this data to a web service compatible with LabVIEW and Data Dashboard for LabVIEW. The driver is also capable of controlling a user selectable digital line from the Web Service.
Requirements
- NI USB-6008/6009 running the DAQmx Base Firmware (Instructions available here)
- Powered USB Hub (if using a model before the 512MB version of Raspberry Pi® for the NI USB-6008/6009)
- Raspberry Pi® running Wheezy Raspbian
Installation Instructions
- Copy the attached files to your home directory on the Raspberry Pi®, preferably via FTP or a USB stick
- Ensure your Raspberry Pi® is connected to the internet, it requires Lighttpd to run the web services which it must download and configure
- Run “sudo sh install.sh”
- Connect your USB-600x to the Raspberry Pi®, you may require a powered hub to provide enough power (unless you have the 512MB revision)
Note: If you are already running a web server on your Raspberry Pi®, you will need to set Lighttpd to run on a port other than 80, edit this in the lighttpd.conf file on the line server.port = 80.
Please note that you will have to change the discovery port when you use Data Dashboard for LabVIEW if this is the case.
Running
Run the programs located in /usr/local/bin/natinst/rpi
, you must run these as root:
a. ./600x – Allows you to select the analogue channel you wish to continuously read from and the digital out line you want to control the output of. This is the demo shown at NIDays UK 2012
Usage: ./600x -c 0 -t 10000 -l 6
-c : Channel Number, 0 indexed that you wish to read from
-t : Timeout in ms, timeout of the device before erroring
-l : Digital line to output on, 1 indexed for Port 0 only
Example: ./600x -c 0 -t 10000 -l 6
Acquire data on channel 0 and link to the digital line 6 on port 0
b. ./aiondemand – Allows you to read a set number of samples on demand and output to the console and web services as requested.
Usage: ./aiondemand -c 0 -s 500 -t 10000 -v -w
-c : Channel Number, 0 indexed that you wish to read from
-s : Samples to fetch, limited to 500 or less when on demand
-t : Timeout in ms, timeout of the device before erroring
-v : Verbose, output to terminal window
-w : WebServices, output to Web Service for Data Dashboard
Example: ./aiondemand -c 0 -s 500 -t 10000 -v -w
Acquire 500 samples on demand on AI channel 0 and output this to Terminal and Web Services
Run Data Dashboard on the iPad and add a new Web Service. Add in the IP Address of your Raspberry Pi® and select port 80 (if you changed the port in the Lighttpd conf file, change it here too)
There is an example Data Dashboard file included here (the one used at NIDays UK 2012).
Raspberry Pi® is a trademark of the Raspberry Pi® Foundation