================================================================================================= ACCES I/O Linux USB API Version 1.0 Released 12/2008 ================================================================================================= The ACCES I/O Linux USB API provides an API that application programs running under a Linux operating system to utilize the functionality provided by any ACCES I/O data aquisition product with a USB interface to a host computer. The API should run under any standard Linux kernel greater than or equal to version 2.6. The API functions available are described in the ACCES I/O Software Reference Manual. (You can also look at the source code to see what they are) NOTE: Although the source code to the API is provided, it is not necesary to look at or modify it. You only need to make calls to the APIs functions, and include the API as part of your make/build process. The files included with this release, 'aiotest.c', and 'Makefile' give an example of how to do this. The API uses the open source library 'libusb' from www.libusb.wiki.sourceforge.net as it's USB interface to the USB subsystem in Linux. Libusb is a user-space API that allows applications to interface with USB devices without having to write or interface directly with kernel mode/device drivers. The ability to do all standard USB operations is provided by libusb. Libusb itself interfaces with the standard Linux USB Host Controller which is the actual USB device driver. This release of the ACCES I/O USB API includes libusb version 1.0 but any version greater than or equal to 1.0 should work. The version MUST be greater than or equal to 1.0 because that is where the asynchronous I/O capability was introduced into the library and the ACCES I/O USB API uses that capability. NOTE : that in the source forge source tree when the this ACCES I/O API was released the version of libusb 1.0 that was available was named 1.0, but actually was called libusb 0.9.3 when the release was un-tar'ed. The final version of 1.0 had not yet been released, but the ACCES I/O USB API has been fully tested and verified to be stable using 0.9.3. The figure below illustrates how your application program and the API fit together to communicate with an ACCES I/O product. -----------LINUX Workstation ----------------- IIDO_Sample.c (replace with your application) | libusb | Linux USB Host Controller | USB-Hardware ------------------------------------------- | | USB cable | ----------------------- ACCES I/O Product ------------------------ The release of the API contains the following : README.txt - the file you are reading now ReleaseNotes.txt - contains comments about the release(you should read this) aioUsbApi.h - header file for the API itslef aioUsbApi.c - C source file for the API itself makeAtoD - Makefile for the API and test program USB-IIDO-16.hex - firware for the Acces I/O IIDO-16 product USB-IIRO-16.hex - firware for the Acces I/O IIRO-16 product acces.rules - udev rules file for hotplug of ACCES I/O products acceloader.sh - script called by hot plug system to load firwmware into ACCES I/O product fxload - standard EZ_USB utility to load firmware EZ_USB devices (for x86 machines) (Acces I/O products). If this version does not run on your machine download a version from the WEB that will. There are many sites where you can get it. Google 'fxload' to see them. IIDO_Sample.c - sample test program This is a sample program that provides examples of how read or write DIO bytes of the boards (control the outputs means write to them) runIDIOSample - script to set libusb environment variable and run sample program libusb.h - header file for libusb libusb-0.9.3.tar.bz2 - libusb 1.0 (ignore the version number 0.9.3) To use use this API follow the steps below : IMPORTANT NOTE : 1) You must complete steps 1-14 BEFORE connecting an ACCES I/O product to your computer since some of these setup the Linux hot-plug functionality for the ACCES I/O products 2) Make sure that /proc/decv/usb is mounted at boot time. This is needed by the script that is called by udev, and that loads the firmware into the Acces Devices when they are connected. Some Linux distributions do this be default, but if not you must do this by putting the appropriate mount command in your /etc/fstab file. 1. Copy the file 'idiousb-rX.Y-Z ' where you want to install the API (e.g. yourDir) X.Y is the release number, e.g. 1.1. Z is the date the release was made for example idiousb-r.1-2-18-09 2. cd yourDir 3. tar -xzvf idiousb-rX.Y-Z NOTE : a backup copy of the release tar file is included in the tar file 4. cp fxload /sbin 5. tar -xczf libusb-0.9.3.tar.bz2 6. cd libusb-0.9.3 7. ./configure 8. make 9. make install 10. cd yourDir 11. cp acces.rules /etc/udev/rules.d 12. cp accessloader.sh /usr/share/usb 13. cp USB-AI16016.hex /usr/share/usb 14. make clean -f makeIDIO 15. Connect the ACCES I/O product to your workstation 16 ./runIDOsample IMPORTANT NOTE : You must complete steps 1-13 BEFORE the first time you unpack the release before connecting an ACCES I/O product to your computer since some of these setup the Linux hot-plug functionality for the ACCES I/O products After that you only need to do step 14 and 16 and connect the device before you run the sample program For questions and/or support contact ACCES I/O at 858-550-9559