40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  TCS elog  Not logged in ELOG logo
Entry  Tue May 10 00:55:08 2011, Won, Computing, Hartmann sensor, Matlab Compiler and Matlab Compiler Runtime 
    Reply  Wed May 11 18:44:54 2011, Aidan, Computing, Hartmann sensor, Matlab Compiler and Matlab Compiler Runtime 
Message ID: 147     Entry time: Wed May 11 18:44:54 2011     In reply to: 144
Author: Aidan 
Type: Computing 
Category: Hartmann sensor 
Subject: Matlab Compiler and Matlab Compiler Runtime 

Installing MCR

I located the MCRInstaller on our distribution of MATLAB on the Ubuntu machine (/MATLAB_R2009b/toolbox/compiler/deploy/glnxa64/MCRInstaller.bin). I ran the installer, as root,and followed the default options to install it. Next I updated the .bashrc file to include the necessary pointers to various libraries:


export LD_LIBRARY_PATH=/home/controls/base-3-14-11/lib/linux-x86_64:/MATLAB_R2009b/runtime/glnxa64:/MATLAB_R2009b/bin/glnxa64
export MCR_ROOT=/opt/MATLAB/MATLAB_Compiler_Runtime
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCR_ROOT/v79/runtime/glnxa64:$MCR_ROOT/sys/os/glnxa64:$MCR_ROOT/v79/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/native_threads:$MCR_ROOT/v79/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/server:$MCR_
export XAPPLRESDIR=$MCR_ROOT/v79/X11/app-defaults
Running test_HS binary from Adelaide on Ubuntu distribution


I've downloaded the test_HS binary from the SVN and added the ~/test_images/ directory as recommended by Won. I then ran the code by entering ./test_HS ~/test_images/


The code ran successfully through the serial_cmd access and the image acquisition process and only crashed when it tried to access the variable mes_message. This indicates a run-time error, not a compilation error. If you examine lines 751 and 752 of HS_Camera.m you can see the typo (mes_meesage vs mes_message) in the code that is the source of the error:

751                 mes_meesage = ['Intensity too high: ',fobj.name];
752                 cam.inform_messenger('ImageNotValid',mes_message);

Here's the output:


controls@princess_sparkle:~/Hartmann_Sensor_SVN/users/won/compiled_code/test_HS/test_HS/distrib$ ./test_HS ~/test_images/
The camera is accessible.

G E N E R A L   C A M E R A   S E T T I N G S:

Camera Model No.:               DS-22-01M60-11E
Camera Serial No.:              04437062
Sensor Serial No.:              0411218

Tap 1 Gain:                     0
Tap 2 Gain:                     0

Firmware Design Rev.:           03-81-00070-03  Sep 30 2004
DSP Design Rev.:                17.3

Pretrigger:                     0      
Video Mode:                     Normal Operating Mode
Data Mode:                      12 bit 
Binning Mode:                   1x1

Gain Mode:                      1x Output Gain Mode
Output Configuration:           2 Tap
Exposure Control:               enabled
Exposure Mode:                  2      

SYNC Frequency:                 8 Hz
Exposure Time:                  123646.66 uSec


executing /opt/EDTpdv/take -s 1 -l 10 -f /home/controls/test_images/test ...
??? Undefined function or variable "mes_message".

Error in ==> HS_Camera>HS_Camera.read_raw at 752

Error in ==> HS_Camera>HS_Camera.read_from_folder at 668

Error in ==> HS_Camera>HS_Camera.read_from_fg at 721

Error in ==> HS_Camera>HS_Camera.read_images at 590

Error in ==> test_HS at 9




Build an application that uses HS classes

I wrote a simple script test_HS.m that takes and saves 10 images using the camera, averages the images and finds centroids. Thus the script requires the class files HS_Base, HS_Camera, HS_Image, and HS_Centroids.

I added those four class files by right-clicking Other Files (found below Main function) then choosing Add File, then clicked the build icon.


ELOG V3.1.3-