Must load a Matrix or array with 90 individual 16 bit numbers, then do matches with Vision inspection result.

What is the best way to load 90 16 bit numbers into an array or matrix, and then compare those 90 values to a Vision system result?
The operator manually enters the value into a display, assigns the value to a memory location (Bin #) and clicks "Enter".
Each of the 90 locations will have a stored value in it.
A Vision system inspection will transmit a result that matches one of the 90 entries, so we then have to try to match the value and determine which bin to sort the result to.
We are learning a lot about LabView, but not fast enough.
Thank you in advance for your help.
Sincerely,
Rich

Rich
It seems like you just want to create a histogram of the image. There is an IMAQ Histogram VI (Vision and Motion >> Image Processing >> Analysis). This allows you to define the max and min values along with how many "number of classes" (or bins). I believe this may accomplish what you are looking to do. As a note, there is also an IMAQ Histograph VI in the same pallet.
Cameron T
Applications Engineer
National Instruments

Similar Messages

  • Updating and Loading a  Matrix Row with Mix of DB and Non DB fields

    Hi
    I'm using SAPB1 2005 SP1 PL14 with B1DE 1.3
    I have a matrix on a form that was generated by the UDO Form Generator. The Matrix contains data associated from a Document Lines table.
    The underlying table and (therefor the matrix as well) only had 1 user field (column)
    I've added a set of additional (read only) columns to the matrix together with supporting non db user datasources for each column. I've bound the new columns to the user datasources.
    The new columns are only informational and should display data associated with the actual db field (column) in the matrix.
    I require assistance / advice with 2 requirements:
    <i>Requirement 1.
    When loading the matrix, I'd like the non DB columns to be populated with data associated with the actual DB field.</i>
    <i>Requirement 2.
    When Adding / Updating the actual DB field in the matrix, I'd like the Non DB columns to be populated with the assocaited data.</i>
    I've managed to get requirement 2 working by using a matrix onValidate Event. (not sure if this is the best approach?)
    Any idea how I can achieve requirement 1 ?
    Cheers,
    Ben

    Hi Trinidad,
    Putting the additaional columns in the table will result in me storing redundant info in the specific table.
    The values are already stored in other related tables and I'd just like to display them as additional info fields.
    .Ben

  • Sort array with equal elements

    Hi, I'm a new one.
    I have a problem to sort 2d array with equal elements (it has 5000000 of elements from 1-255) for example:
    1 2 1 1 3 4 5 5 6 1 2 3 (value from 1-255)
    2 2 1 1 3 3 3 3 4 4 4 1 (value from 1-255)
    And I need make array or matrix 255 rows vs 255 colomns, and count how many equal elements for example:
      1  2 3 4 5 6
    1 0 1 0 1 0 0
    2 0 1 0 1 0 0
    3 1 0 1 0 0 0 
    4 0 0 1 0 0 0
    5 0 0 2 0 0 0
    6 0 0 0 1 0 0
    I'll be happy if someone could help me

    I understand that it's very complicated explain.
    I build 2d array from two 1darray each of them has values 1-255. So right now i must constract array or matrix 255x255 where must calculat how many times value from (1-255) for one array in another array and write this sum for each value 1-255. I try to show it
    1 2                         so I need array 3x3; for first row for value 1 I have two times value 3 and one time value 2
    2 2                                                                                    2 I have two times value 1 and one time value 2 and one time value 3
    3 2                                                                                    3 I have two times value 2 and one time value 3 
    3 2              so my result matrix will be      1   2  3
    3 3                                                       1  0  1  2
    2 3                                                       2  2  1  1
    2 1                                                       3  0  2  3
    2 1
    1 3
    1 3
    Maybe its more clear

  • Pages not loading anymore. I have tried reinstalling with the same results

    I have iWork 09 on my MBP with the i7 (1 version back from the current model with the Thunderport). Software worked fine for many months but now when I try to start Pages or Keynote I get an error message saying it can not load the library. I tried to uninstall the software and reboot then reinstalled it and did an update to the app with the same results.

    Deleting the program's preference list is the #1 trouble-shooting step with any misbehaving application. Go to HD > Users > (your account) > Library > Preferences, delete the com.apple.iwork.pages.plist, empty the Trash & then restart Pages. Repeat with Numbers & Keynote. This needs to be done for each user.
    There are two things to do that solve a lot of problems with the iWork ’08 &/or ’09 apps in Snow Leopard.
    First, use the
    Mac OS 10.6.6 combo updater. This fixes a problem with fonts that is not fixed using the delta update (10.6.1 > 10.6.2). Because of font & other issues with 10.6.7, I prefer to stick with 10.6.6. You can find the 10.6.7 combo updater
    here  
    Second, make sure your iWork applications are updated. For iWork '08 that is Pages 3.0.3 & Numbers 1.0.3. For iWork '09 it's Pages 4.0.5 & Numbers 2.0.5. If you're not running the latest versions & Software Update says your software is up to date, make sure the applications are where the installer initially put them. The updaters are very picky. If the location is not where the updater is programmed to look or if the folder doesn't have the name the updater looks for, it will not work. The applications cannot be renamed or moved. They must be in the iWork '08 or iWork '09 folder in Applications. That iWork folder must be named iWork '08 or iWork '09. If it doesn't have the '08 or '09 Software Update won't find them & the updaters won't work.
    Also, when deleting iWork, you need to make sure you get all of the components.
    The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user.
    Yvan Koenig has written an AppleScript that removes the files. You can find it on
    his iDisk in For_iWork > iWork '09 > uninstall iWork '09.zip.

  • How to create a array with variables dimensions?

    I try to create a array like that:
    Object[][] data;
    data = new Object[] [];
    But that's doesn't work!
    Apparently I must specify the dimension of my array
    So I have done like that :
    Object[][] data;
    data = new Object[3] [3];
    And that work!
    But the problem is when I need to add extra elements to my array.
    If I write :
    data[4][1] = "123";
    I have the error message :
    java.lang.ArrayIndexOutOfBoundsException
    So, how can I defined a array with variables dimensions OR how can I add a dimension to a array?

    if you have:
    Object[][] data;
    data = new Object[3] [3];you end yo getting ArrayIndexOutOfBoundException if you try to point to some other Indexes. You can increase the size by doing new:
    Object[][] data;
    data = new Object[4] [3];and then copy the old Arrays to this one... this is heavy.
    Other thing to consider then is using some other datastructure, such as Vector, which grows along you add elements to it.
    P_trg

  • Multi-dimensional arrays with non-specified dimension

    Hi all,
    I'm trying to write a method to create a multi-dimensional array of
    Integer, based on another one, taken as parameter. I would like the
    method to work for an array of a non-specified dimension, that is,
    it could take as parameter a Integer[], or a Integer[][], or a
    Integer[][][] and so on.
    The idea is to have as a result an array with the original elements
    doubled.
    Here is my recursive function:
        public static Object[] f(Object[] a) {
             // the array to be returned is created with the
             // same size as the original
            Object[] r = new Object[a.length];
            for (int i=0; i<a.length; i++) {
                Object elem = a;
    Object newElem = null;
    if (elem instanceof Object[]) {
    // Recursive case
    newElem = f((Object[]) elem);
    } else if (elem instanceof Integer) {
    // Base case
    newElem = new Integer(((Integer)elem).intValue() * 2);
    r[i] = newElem;
    return r;
    This method returns an array with the same structure (that is, same
    dimensions) of the array taken in the constructor. In the recursive
    case, it just calls the function to the inner arrays. In the base
    case, where I have an Integer, it creates a new Integer, whose
    value is the old multiplied by 2.
    Then I initialize an array:
        public static void main(String args[]) throws Exception {
            Integer[][] a = new Integer[][] {
                new Integer[] {
                    new Integer(0), new Integer(2)
                new Integer[] {
                    new Integer(1), new Integer(4), new Integer(3)
      // And try to call the function like this:
            Integer [][] b = (Integer [][]) f(a);
        }   And I get a java.lang.ClassCastException: [Ljava.lang.Object;
    I don't understand the reason of this exception, because the
    object returned is a Integer[][]. Isn't it?
    And since I don't have a compiler error in the cast, that means
    that Object[] and Integer[][] are not inconvertible. Right?
    Could anyone explain me why this is wrong and/or give me some
    ideas to do what I'm trying to do?
    Thanks a lot,
    Angela

    I retract my previous statement about using
    reflection. Use "Object[] r =(Object[])a.clone()"
    to create a new array of the same type.You don't need temporary array variable here.
    You could simply use argument a instead of r.
    (But this my gotcha is derived from your clever rep.)Well, this isn't a temporary variable, its the return variable, which is different. If you don't want the original matrix changed, you have to clone the argument.

  • Fill Array with all possible combinations of 0/1

    Hi,
    i'm looking for a fast way to fill an array, respectively an int[8], with all possible combinations of 0 and 1 (or -1 and 1, shouldn't make a difference).
    I kind of know how to do it using multiple loops but I assume there is a more elegant or at leaster "better" practice.
    Thanks,
    nikolaus
            static int cnt = 0;
         public static void main(String[] args) {
              int[] element = new int[]{1,1,1,1,1,1,1,1};
              Integer[] x = new Integer[2];
              x[0] = 1;
              x[1] = -1;
              for(int i7:x){
                   element[7] = i7;
                   for(int i6:x){
                        element[6] = i6;
                        for(int i5:x){
                             element[5] = i5;
                             for(int i4:x){
                                  element[4] = i4;
                                  for(int i3:x){
                                       element[3] = i3;
                                       for(int i2:x){
                                            element[2] = i2;
                                            for(int i1:x){
                                                 element[1] = i1;
                                                 for(int i0:x){
                                                      element[0] = i0;
                                                      cnt++;
              }Edited by: NikolausO on Oct 30, 2008 4:21 AM
    Edited by: NikolausO on Oct 30, 2008 4:22 AM

    pm_kirkham wrote:
    No I replied to message number 5. as the ' (In reply to #5 )' above my post indicates, which was in reply to (a reply) to Sabre150's post which wasn't using enhanced loops, nor has any obvious place where you could use that approach to fill the array.
    Though you could pass in an array of the values to fill the array with, and loop over those, instead of using 0 or 1, at which point Sabre's approach becomes the same as your OP, but without the manual unrolling:
    import java.util.Arrays;
    public class NaryCombinations {
    public interface CombinationHandler {
    void apply (int[] combination) ;
    public static void main(String[] args) {
    calculateCombinations(new int[]{-1, 0, 1}, 4, new CombinationHandler () {
    public void apply (int[] combination) {
    System.out.println(Arrays.toString(combination));
    public static void calculateCombinations (int[] values, int depth, CombinationHandler handler) {
    recursivelyCalculateCombinations(values, 0, depth, handler, new int[depth]);
    private static void recursivelyCalculateCombinations (int[] values, int index, int depth,
    CombinationHandler handler, int[] combination) {
    if (index == depth) {
    handler.apply(combination);
    } else {
    for (int value : values) {
    combination[index] = value;
    recursivelyCalculateCombinations(values, index + 1, depth, handler, combination);
    Which looks to use the same basic approach to the generalization I created shortly after posting the original.
    public class Scratch1
         * A 'callback' to be invoked with every combination
         * of the result.
        public interface Callback
             * Invoked for each combination.
             * <br>
             * Each call is passed an new instance of the array.
             * @param array the array containing a combination.
            void processArray(int[] array);
        public Scratch1(final int[] array, final Callback callback, final int... values)
            if (callback == null)
                throw new IllegalArgumentException("The 'callback' cannot be 'null'");
            if (array.length < 1)
                throw new IllegalArgumentException("The array length must be >= 1");
            if ((values == null) || (values.length < 1))
                throw new IllegalArgumentException("The 'values' must have be at least of length 2");
            callback_ = callback;
            values_ = values.clone();
            array_ = array;
        public Scratch1(final int order, final Callback callback, final int... values)
            this(new int[order], callback, values);
         * Generates every possible value and invokes the callback for each one.
        public void process()
            process(0);
         * Internal method with no logical external use.
        private void process(int n)
            if (n == array_.length)
                callback_.processArray(array_.clone());
            else
                for (int v : values_)
                    array_[n] = v;
                    process(n + 1);
        private final Callback callback_;
        private final int[] values_;
        private final int[] array_;
        public static void main(String[] args) throws Exception
            final Callback callback = new Callback()
                public void processArray(int[] array)
                    System.out.println(java.util.Arrays.toString(array));
            new Scratch1(6, callback, 2, 1, 0).process();

  • Populate input array with spreadsheet values

    Is it possible to populate an input array with values from a text or spreadsheet file? If so, how is it done?
    Solved!
    Go to Solution.

    Hi Joseph,
    "to be more exact":
    load the [text] file and use "spreadsheet string to array" (older LV versions) or use "read spreadsheet file" (LV8+)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Detect load completion from an array of images

    I have an array with 6 items. I have a for loop that dynamically builds a movie clip and loads the images. I'm trying to get an action/function to start only when the last image is finished loading I have the onLoadComplete working, but I cant seem to figure out how to get it to work on the last image and then activate an action/function?
    Wil I need to find another way of looping them using the onloadcomplete as a singnal to load the on image and then the other?
    Can anybody help?

    Thank you Kglad! I was able to get the script working. If I could bother you with a minor problem with the script? its with the depths. I had better controll over depths in AS3, but I need to write in AS2. Any way with the script, before I added the tweens I was able to stack the images one ontop of the other, and then set the depth of the banner_mc above the images, but when I go to tween them they are infront of the banner. How can I get that banner on top (of everything else)?
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var MCL:Number
    var listener:Object = new Object()
    napolpics = new Array()
    napolpics = [
                                   "estimates_1_sm.jpg",
                                   "directions_1_sm.jpg",
                                   "partners_3_sm.jpg",
                                   "home_4_lg.jpg",
                                   "estimates_2_sm.jpg",
                                   "about_4_lg.jpg"
    MC_Tween = new Array
    MC_Tween = []
    for (var i=0; i < napolpics.length; i++)
              var imagesLoaded:Number=0;
              var container:MovieClip = this.createEmptyMovieClip("big_"+i, this.getNextHighestDepth());
              MC_Tween.push(container);
              var mcLoader:MovieClipLoader = new MovieClipLoader();
              mcLoader.addListener(this);
              mcLoader.loadClip(napolpics[i], container);
              container._y=75;
              container._x=10;
              container.height=161;
              container.width=194;
              this.onLoadComplete = function(mc:MovieClip)
                                  imagesLoaded++;
                                  if(imagesLoaded==napolpics.length)
                                            var tweenit=setTimeout(callyourfunction, 3000);
                                            MCL= MC_Tween.length-1
    function TweenImages()
              trace (MCL)
              var fadeit = new Tween(MC_Tween[MCL], "_X", Strong.easeInOut, MC_Tween[MCL]._x, 300, 4, true);
              fadeit.onMotionFinished=function()
                        MCL--
                        if(MCL>-1){var tweenit=setTimeout(TweenImages, 3000);}
                        else{clearTimeout(tweenit)}

  • Search Array with multiple values

    Hello,
    I've been helped with the prototype below by blemmo (thanks).
    It allows me to search my array using one property == a
    value.
    Now, I'd like to use it to:
    if ((prop1 == val1) &&(prop2 == val2) &&
    (prop3 == val3) {
    // search array for all values in array with the values of
    val1, val2 and val3
    Also, a way to search if one of the prop and val's are blank,
    ie...
    ((prop1 == val1) &&(prop2 == val2) && (prop3
    == val3)
    where prop2 and val2 are "undefined"
    so the search will only search for the prop and val that are
    not "undefined"
    make since? Don't know where to start.
    help and thanks in advance.

    it is an array like this.. but with more properties... also,
    is it better to use XML to load large arrays or is it ok to use
    actionscript in the file.
    which is faster to load? say if I had an array of 150
    elements?
    myArray = [{myname:"bob", county:"skagit", city:"Sedro
    Woolley", id:1,
    pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg"},
    {myname:"bob", county:"skagit", city:"Sedro Woolley", id:1,
    pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg"

  • HT203234 Can´t load my songs in Garageband with my ipad2

    Can´t load my songs in Garageband with my ipad2, i think garageband needs a important update. After i record all channel in my Song, garageband complettly crashed and i must restart Garageband after crash. Every Song i produced are not loadeable, please check that problem. I love to produce songs with Garageband, that a important problem, if this problem doesn´t crack the case, never use Garageband again... Or i did buy a demo Garageband for my ipad 2 for 4.99 euro .... :-(

    I Also had a similar problem except i can play my music on itunes 7.4 but not on the new version of itunes. all it does when i open itunes is it bounces up and down and then quits by itself. so i deleted the new itunes and loaded back the old one and it worked perfectly fine.

  • Dimension an array with BigInteger?

    Hi,
    I'm wondering if it is possible to dimension an HUGE array with BigInteger..
    my idea is if it is possible to the equivalent of e.g.
    boolean b[] = new boolean[new BigInteger("12345678987654322346567")];Thanks!

    No. The number in [] must be of type int (or promoted to int):
    See: http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#46168
    "The type of each dimension expression within a DimExpr must be an integral type, or a compile-time error occurs. Each expression undergoes unary numeric promotion (�5.6.1). The promoted type must be int, or a compile-time error occurs; this means, specifically, that the type of a dimension expression must not be long."

  • Iceberg reader will not load fully, it comes up with a blank white page. What can i do to read my books?

    Iceberg reader will not load fully, it comes up with a blank white page. How am i ment tonread my books?
    If not is there anyway i can get a refund to buy the books on ibooks?

    Soapie wrote:
    Iceberg reader will not load fully, it comes up with a blank white page. How am i ment tonread my books?
    If not is there anyway i can get a refund to buy the books on ibooks?
    The only Iceberg app I can find in the app store is a social networking app, not an e-reader. I don't see how you could buy books for it.
    UPDATE: I see that it isn't available in the US app store. To contact the developer find it in your App Store and there will be a link to the developer's support site.

  • Lots of blank space when printing array with only last element printed

    I have a slight problem I have been trying to figure it out for days but can't see where my problem is, its probably staring me in the face but just can't seem to see it.
    I am trying to print out my 2 dimensional array outdie my try block. Inside the trying block I have two for loops in for the arrays. Within the second for loop I have a while to put token from Stringtokeniser into my 2 arrays. When I print my arrays in this while bit it prints fine however when I print outside the try block it only print the last element and lots of blank space before the element.
    Below is the code, hope you guys can see the problem. Thank you in advance
       import java.io.*;
       import java.net.*;
       import java.lang.*;
       import java.util.*;
       import javax.swing.*;
       public class javaflights4
          public static final String MESSAGE_SEPERATOR  = "#";
          public static final String MESSAGE_SEPERATOR1  = "*";
          public static void main(String[] args) throws IOException
             String data = null;
             File file;
             BufferedReader reader = null;
             file = new File("datafile.txt");
             String flights[] [];
                   //String flightdata[];
             flights = new String[21][7];
             int x = 0;
                   //flightdata = new String[7];
             int y = 0;
             try
                reader = new BufferedReader(new FileReader(file));   
                //data = reader.readLine();   
                while((data = reader.readLine())!= null)   
                   data.trim();
                   StringTokenizer tokenised = new StringTokenizer(data, MESSAGE_SEPERATOR1);
                   for(x = 0; x<=flights.length; x++)
                      for(y = 0; y<=flights.length; y++)
                         while(tokenised.hasMoreTokens())
                            //System.out.println(tokenised.nextToken());
                            flights [x] [y] = tokenised.nextToken();
                            //System.out.print("*"+ flights [x] [y]+"&");
                   System.out.println();
                catch(ArrayIndexOutOfBoundsException e1)
                   System.out.println("error at " + e1);
                catch(Exception e)
                finally
                   try
                      reader.close();
                      catch(Exception e)
             int i = 0;
             int j = 0;
             System.out.print(flights [j]);
    //System.out.println();

    A number of problems.
    First, I bet you see a lot of "error at" messages, don't you? You create a 21x7 array, then go through the first array up to 21, going through the second one all the way to 21 as well.
    your second for loop should go to flights[x].length, not flights.length. That will eliminate the need for ArrayIndexOutOfBounds checking, which should have been an indication that you were doing something wrong.
    Second, when you get to flights[0][0] (the very first iteration of the inner loop) you are taking every element from the StringTokenizer and setting flights[0][0] to each, thereby overwriting the previous one. There will be nothing in the StringTokenizer left for any of the other (21x7)-1=146 array elements. At the end of all the loops, the very first element in the array (flights[0][0]) should contain the last token in the file.
    At the end, you only print the first element (i=0, j=0, println(flight[ i][j])) which explains why you see the last element from the file.
    I'm assuming you have a file with 21 lines, each of which has 7 items on the line. Here is some pseudo-code to help you out:
    count the lines
    reset the file
    create a 2d array with the first dimension set to the number of lines.
    int i = 0;
    while (read a line) {
      Tokenize the line;
      count the tokens;
      create an array whose size is the number of tokens;
      stuff the tokens into the array;
      set flights[i++] to this array;
    }

  • Problem loading AVI with vision

     I started building a gait analysis program, and got stuck with the following. Whenever I load AVI files into labview (using IMAQ AVI READ FRAME) it displays about a dozen frames, then I get Error 1074395975: IMAQ Vision:  DirectX has timed out reading or writing the AVI file.  When closing an AVI file, try adding an additional delay.  When reading an AVI file, try reducing CPU and disk load. This happens even with the READ AVI EXAMPLE program that came with the vision package. Since LV is the only application, running on a i7, I am pretty sure this is no load problem. I tried changing the avi compressor, and the resolution, without success. Any ideas? 
    Attachments:
    example.avi ‏2386 KB

         These are the CPU and Disk loads while running the AVI (until it crashes, that's about a second of movie play).
         I'll try the activeX example, and see where it gets.
         Thanks.
    Attachments:
    cpu_load.png ‏267 KB
    disk_load.png ‏233 KB

Maybe you are looking for

  • Why is my ipod nano 6th generation no longer syncing all my selected songs?

    I have tried reinstalling itunes, updating the ipod software, and restoring the ipod.  These are songs that have previously been on my ipod.  Any information or guidance would be greatly appreciated.

  • UNSPSC code is not passed for RT catalog item then error !!

    Hi SRM GURUs, We have implemented BBP_CATALOG_TRANSFER BADI. In which if a RT catalog item is not having UNSPSC code then we are passing some generic material group for that particular item. Here the issue is, if a UNSPSC code is not passed for a RT

  • Site Import / Export

    I was looking at a trial version of CS3 and did not consider that I might want to export my MX site defintions (sitecach.dws) to the *.ste site export format. (For some reason, I didn't think it was necessary to do that). Since then, I've been trying

  • Upgrading from asa711-k8.bin to asa 721-k8.bin error

    when i am trying to upgrade to the new image i get this error test(config)# boot config disk0:/asa721-k8.bin ERROR: Unable to set this url, file has non-ASCII characters

  • Why can't I open my program?

    I'm convinced I purchased Adobe Premiere Elements 11 and now cannot open the program.  It does not recognize my serial number.