Table of Contents

Measurement Computing USB-TEMP-AI

Initial Testing

2016/07/28 13:50

For generic programming, we are going to want to use the UL library.

Looking in this FTP site for code: ftp://lx10.tx.ncsu.edu/pub/Linux/drivers/USB/

Requires libusb, found an online page suggesting check this:

rpm -qa | grep -i libusb
libusb1-1.0.9-0.6.rc1.el6.x86_64
libusb-0.1.12-23.el6.x86_64

Prerequisites

  1. Installed these packages
    sudo yum install libusb-devel libudev-devel libusb1 libusb1-devel 
  2. Grabbed this
    mkdir ~/code
    cd ~/code
    git clone git://github.com/signal11/hidapi.git
  3. Compile and install
    cd ~/code/hidapi/
    ./bootstrap
    ./configure
    make
    sudo make install
  4. Install the udev rules for the system
    1. Now located in the MCCLinuxDrivers directory
    2. Copy the files into the udev configuration
      sudo cp ~/src/MCCLinuxDrivers/6*-mcc.rules /etc/udev/rules.d/
      sudo chmod 644 /etc/udev/rules.d/6*-mcc.rules
      sudo chown root:root /etc/udev/rules.d/6*-mcc.rules
    3. Restart udev
      sudo /sbin/udevadm control --reload
      sudo /sbin/udevadm control --reload-rules

Measurement Computing Library

  1. Download code <code> cd ~/code git clone https://github.com/wjasper/Linux_Drivers.git </code>
  2. Build and install
    cd ~/src/MCCLinuxDrivers/USB/mcc-libusb
    make
    sudo make install
    sudo ldconfig
  3. Had to add /usr/local/lib to an ldconfig script
    1. Modify /etc/ld.so.conf.d/lvisf.conf
      sudo nano /etc/ld.so.conf.d/lvisf.conf
    2. Append this line to the file if it isn't already there into /etc/ld.so.conf.d/lvisf.conf
      /usr/local/lib
    3. It looks like this for me now — David Lloyd Rabine 2016/07/28 15:07
      /home/lvis/src/spectrum/shared/linux/pc64/lib
      /home/lvis/src/MIC3753/linux_driver_source_3.2.7.0_64bit/libs
      /opt/lvisf/src/lvisF/build/lib/msgService
      /opt/lvisf/src/lvisF/build/lib/shmem
      /usr/local/lib
  4. Now run ldconfig to get the library to be in our path
    sudo ldconfig

Functionality Test

  1. To where the code is installed at the moment
    cd /home/lvis/src/MCCLinuxDrivers/USB/mcc-libusb
  2. Run the test program
    ./test-usb-temp-ai
  3. Appears to work! 8-)
    [lvis@lvisf-centos65 mcc-libusb]$ ./test-usb-temp-ai
    USB TEMP-AI is found.
    
    USB-TEMP-AI Testing
    ----------------
    Hit 'b' to blink LED
    Hit 'c' to calibrate
    Hit 'd' to test DIO
    Hit 'e' to exit
    Hit 'f' for burnout status
    Hit 'g' to get serial number
    Hit 'i' for information
    Hit 'R' to reset
    Hit 'r' to measure temperature (RTD)
    Hit 'p' read the CJC
    Hit 's' to get status
    Hit 'S' to measure temperature (Semiconductor)
    Hit 't' to measure temperature (Thermocouple)
    Hit 'T' to measure temperature (Thermistor)
    Hit 'x' to measure temperature (Thermocouple) multiple channels
    g
    Serial Number = 00107479
    p
    CJC 0 = 29.86 degress Celsius or 85.75 degrees Fahrenheit.
    r
    Sampling RTD
    Enter channel number [0-7]: 0
            1.  2-wire with 1 sensor.
            2.  2-wire with 2 sensors.
            3.  3-wire. 
            4.  4-wire.
    Enter connector type [1-4]: 
    4
    Connection-type = 4 wire.
    R0 = 0.000000     A = 1.000000e+00     B = 0.000000e+00     C = 0.000000e+00
    Channel: 0  -9999.00 degrees Celsius or -17966.20 degrees Fahrenheit.
    Channel: 0  -9999.00 degrees Celsius or -17966.20 degrees Fahrenheit.
    Channel: 0  -9999.00 degrees Celsius or -17966.20 degrees Fahrenheit.
    Channel: 0  -9999.00 degrees Celsius or -17966.20 degrees Fahrenheit.