Vision assistant in a while loop

Hello gentlemans, i'm quite new to LabView and Vision assistant. My goal is to detect a car plate from a color image. I succesfully find the ROI by using the two blue rectangles at the edge of italian's car plates, and it works. But then I have to OCR the actual plate, I can do it with success but some pictures require a certain Threshold, others another... So I though, i can run the Vision assistant into a while loop to try different thresholds, when I got a 'valid' plate (7 digits) I simply quit the loop. The parameters are defined by clusters, but it looks like is using always the FIRST value, regardless of the changing threshold. index goes from 0 to 20, and my intention is to have the threshold ranging from 0..100, 0..105, 0..110 and so on. Can you spot something wrong in the attached VI image?? Thanks a lot for any help! Mauro Cucco
Attachments:
vi_ocr.png ‏31 KB

Hi Octopus
I belive that this problem originates in that the Vision Assistant handles the images references.
In normal LabVIEW programming every time you have a wire branch or a SubVI new copies of the data is created. For images this is not the case because an image often consume a lot of space in the memory. So for an Image LabVIEW edits the image in the  memory instead of creating a copy.
In this case your algorithm works the first time, but then the second time it will try to do the OCR on the last result of the OCR rather than the original image.
To avoid this you need to use the function IMAQ copy, to create a copy of the original image before sending it to the OCR function. See below:
Best Regards
Anders Rohde
Applications Engineer
National Instruments Denmark

Similar Messages

  • Acquiring data from instruments and wiring it to a while loop

    Hello,
    I am very new to labVIEW and was thrown into a project.  Essentially what I am trying to accomplish is to acquire data from my four sensors and use that data to compute drag.  In order to compute the drag, an initial guess at what the drag is must be given and then calculations are carried out in a while loop that converges on a solution once the difference between the current drag output and the previous drag estimate falls below a certain percentage.  I am continuously acquiring data so I need some sort of way to incoporate a timer to allow time for the while loop to converge and then output the drag value.  Right now I am generating a signal since I do not have the sensors hooked up and labVIEW will not let me connect the signal generator to the while loop and gives me an error that I have connected two terminals of different types.
    If I could figure out how to wire my DAQ assistants to the while loop I could figure everything else out
    Thank You,
    Ellen

    Hi Ellen,
    I might need a little more information before I can help you. How are you simulating your signals? If you're using the DAQ assistant express VI, are you simulating hardware in MAX? Or are you using the simulate signal express VI?
    Alos, what VIs or functions do you have inside the while loop that you are trying to connect to?
    Perhaps posting a screenshot would be useful. I'm sure we will be able to solve your problem.
    Here is a help page that you might find useful.
    http://zone.ni.com/devzone/cda/tut/p/id/4656
    Joel G
    Applications Engineer
    National Instruments UK & Ireland

  • Stop multiple while loops in Vision Aquisition

    Hi,   I want to close multiple while loops with one stop button. I'm using the Vision Acquisition software for recording from multiple cameras and I want to close this recording from all cameras simultaneously. Since I'm knew to LABView I don't know how to do this. I'll include my VI here and maybe someone can help me.  Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Aquire Images 2 with Cameras.vi ‏410 KB

    A local variable should be enough for your implementation. Look at the following article:
    Stopping Parallel While Loops in LabVIEW With One Stop Button
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • I am using Pattern matching using vision assistant . its able to detect the temple which created while configuration

    Hi all , 
             i am using vision assistant to do patten matching . its able to find the pattern with created template in vision assistant .
            if i load some other pattern is not detecting .. 
             i have attached my vi file 
    Attachments:
    PM_light.vi ‏266 KB

    Hi all , 
             i am using vision assistant to do patten matching . its able to find the pattern with created template in vision assistant .
            if i load some other pattern is not detecting .. 
             i have attached my vi file 
    Attachments:
    PM_light.vi ‏266 KB

  • Vision Assistant 2014 (and DLL inside of LV) repeatedly crashes while reading multiline OCR

    I am working on an OCR application. With certain files (not all) the multiline function just crashes. No questions asked.  I set the ROI area to the targeted text and without fail it causes a crash.
    Is anyone aware of this problem, and if so is there a solution?
    Additional information:  My .abc file is from scratch with default settings and trained characters. Nothing in it should be causing the crash.  Images are simple scanned jpg files.
    Edit: I tested it. Crash still happens without any character set loaded, and no changes to threshold, size, or read options.

    I cut out an offending section of one of the files. It is attached.  To replicate the error:
    1. Load image
    2. Identification -> OCR/OCV
    3. New Character Set File...
    4. Select entire text.
    NI Vision Assistant 2014, 64 bit. 
    Edit: Posted this before I saw your request   On the "Full sized" image, it crashes always - even when it is called from inside of LabVIEW (the DLL crashes then).  It is how I noticed the bug - my program kept crashing.  Tor this image, it seems to only crash for me inside of the training assistant, but is again reliable.
    Attachments:
    crash.png ‏731 KB

  • Problem with DAQ in while loop and Graphs

    Hello,
    I'm new here so I apologize if I posted this on the wrong board  
    This is my "situation":
    I need to make a simple PID controller which takes information (process variable) from an outside source (a NI's DAC connected through the USB port ) which is accomplished using NI-DAQ as an input, and the PID's output goes to the second NI-DAQ which is also connected using DAC to an actuator which in my case regulates the air pressure. (VI attached)
    My problem is the following.
    Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.
    -If I place them in separate loops, I have the problem of passing information between the Input NI-DAQ and the PID, and also between the PID and the Output NI-DAQ.
    -If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).
    The timing settings for the DAQ's N samples, 100 samples to read at the rate of 1k (I also tried with Continuous samples and many different combinations of Samples to Read an Rate but without success).
    Should I wire them with the same dt(s)?
    The other thing I need to do (I'm also writing it here in order not to open new topics) is show the following 3 signals on a Graph (process variable (dynamic data type)(range 4mA - 20mA), PID output (double)(range 4mA - 20mA), and the Set Point (double)(range 0 to inf))
    Firstly, is it possible to show the first two on a scale from 0 to 100 without changing the PID's output which needs to be 4-20?
    Secondly, which graph should I use if I have different data types? (I tried the Waveform Chart, and succeeded in showing the first two; the third just messes everything up)
    I would also have to make a legend explaining which signal is which (I see that this is possible with the Mixed Signal Graph).
    I know this is probably too much to ask, but I'd be grateful for any help
    Thank you in advance
    Attachments:
    PID while.vi ‏100 KB

    My problem is the following. Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.
    -If
    I place them in separate loops, I have the problem of passing
    information between the Input NI-DAQ and the PID, and also between the
    PID and the Output NI-DAQ.
    This is the best option---Use QUEUE or Functional global or something else to tranfer the data to and fro
    How  do I make that QUEUE or Functional global?
    -If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).
    Have
    you tried increasing the buffer? Is the acquisition happening
    parallelly (means to say the first DAQ not wired (error terminal) to
    second DAQ)
    Well the buffer is, at least how I understood it, the option Number of Samples when in Continuous Samples mode. Concerning the parallel acquisition, do you mean I should wire the error ports of both of the DAQs?

  • How do I create a start/stop button for each separate while loop within my program, when each of them does a different task?

    I have a multimeter VI with separate while loops to accomplish the different tasks of reading  voltage, current, etc. Each while loop has a stop button, but I need a button that will have to be pressed in order for the while loop to even start. I tried putting another while loop around the present one, but it still has to run once before it will stop. I want the user to have to press the button before it runs, because they interfere with each other.
    I am just learning so patience and your kind assistance is greatly appreciated!
    ElectroKate

    iZACHdx wrote:
    Hello,
    I'm not entirely clear with everything you have going on and what you want your final functionality to be, but you can use sequence structures to prevent a loop from starting until the user presses a button like this:
    -Zach
    I have to ask, why is an NI employee using examples using sequence frames? The same thing could be accomplished using data flow by simply wiring the value of the first stop button out of teh first while loop and connecting it to the second loop. This would then use data flow to control the sequence. Why show new users bad programming methods?
    As to the original question I would concur with altenbach on using an event structure.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How do i stop a while loop

    I'm new to labview and I'm having a problem stopping a while loop (running windows XP/2000 with the student edition of labview express 7).
    I'm doing a data acquisition program where I'm constantly reading in voltage and comparing it to a set point value, when the input voltage goes above the set point, i want the while loop to stop. How do I do this? I already have an LED going on when the criteria is met, but I'm not sure how to actually stop the loop (i.e. change the iteration value from true to false-i guess). If anyone can please assist me with this I would very much appreciate it.
    I've included my program too.
    Attachments:
    CO_Detection_Monitoring_System_Modified.vi ‏60 KB

    Hello Everyone-
    I've just posted a message about stopping a while loop and it was answered accurately and quickly- thanks to LV_Pro and PauloM- thanks much- its nice too see that there are many helpful people out there! Unfortunately, I have 2 more questions to ask of the forum.
    My application is almost completed- I just need to add an elapsed time counter that will tell me how long it took for my LED to trigger (from my set point-i.e. when from 0:00:00 until when my loop stopped).
    Now I've found a perfect elapsed time counter on the NI web site contributed from Mike Hall from Ohmeda Medical- the page is here.... http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=D37E2493DC333076E034080020E74861&p_node=DZ52032&p_source=external
    So my first question is, it looks like I can just extend the while loop box in my 'CO detector... .vi' and paste just the code from the 'elapsed time.vi' while loop into my loop and I will be set- but do I need to change my wait until next multiple to be a 1000 too in my program? Probably, but I'm not sure hence the question- or other ideas would appreciated.
    My second question is now that my application is complete (after I add the elapsed time above), I need to exactly duplicate this process for 7 other DAQ inputs (i.e. right now I'm using only 1 of 8 analog inputs on the FP-AI110). So should I make my 'CO detector.. .vi' a separate program (I remember reading something about this in one of the posts earlier).
    Any help is very appreciated.
    Thank you again,
    Daniel
    Attachments:
    CO_Detection_Monitoring_System_Modified.vi ‏60 KB

  • While loop

    I am new to Java and need some assistance with the following program:
    Write a program that asks for the user's name and then writes that name to the monitor with either "Ms." or "Mr." in front, depending if the name is for a female or male. Assume that the only female names are
    * Amy
    * Buffy
    * Cathy
    and that the only male names are
    * Elroy
    * Fred
    * Graham
    All other names will be echoed without a title. The program continues looping until the user hits "enter" without first typing a name.
    C:\>java Title
    Enter a name:
    Amy Johnson
    Ms. Amy Johnson
    Enter a name:
    Fred Smith
    Mr. Fred Smith
    Enter a name:
    Zoltan Jones
    Zoltan Jones
    Enter a name:
    C:\>
    Hints: Use a Scanner to read user input. Uses a while loop that tests the length of the input line. Use startsWith() to test the names.
    Here's what I have so far:
    import java.util.*;
    public class TitleApplier
          * @param args
         public static void main(String[] args)
              Scanner scan = new Scanner (System.in);
              System.out.println ("Please enter your name:");
              String name = scan.nextLine();
              while (name.startsWith("A"))
                   System.out.println ("Ms. ".concat (name));
                   if (name.startsWith ("B"))
                        System.out.println ("Ms. ".concat (name));
                   if (name.startsWith ("C"))
                        System.out.println ("Ms. ".concat (name));
                   if (name.startsWith ("E"))
                        System.out.println ("Mr. ".concat (name));
                   if (name.startsWith ("F"))
                        System.out.println ("Mr. ".concat (name));
                   if (name.startsWith ("G"))
                        System.out.println ("Mr. ".concat (name));
                   else
                        System.out.println (name);
    Here are the problems are I am having:
    I am asked to use a while loop that tests the length of the input, I am not sure how I would go about doing that.
    When I enter Amy the program keeps looping, but it does not do that for any other name.
    When I enter any of the other names, I get two outputs one with a title and one right below that with out the title. Is there a way to get one output, the one with the title?

    ChavezOA wrote:
    I am asked to use a while loop that tests the length of the input, I am not sure how I would go about doing that.
    When I enter Amy the program keeps looping, but it does not do that for any other name. You need to familiarize yourself with logic statments... specifically the use of or "||" also and "&&"... (condition1) || (condition2) || ...
    When I enter any of the other names, I get two outputs one with a title and one right below that with out the title. Is there a way to get one output, the one with the title?As already stated, you have independent "if" statements, you need to link them together somehow...
    if() {
      //what ever
      else if() {
        //what ever
      else if() {
        //what ever
      }

  • Using a DAQ value in a location outside of the While Loop it is placed in

    I am writing a program that records the speed of a car and then is supposed repeat the action through the use of an actuator.  I was able to write the program to the point where I am saving the data into a .txt file and will be able to read it back out.  My problem is that I need to use a dbl value that I am calculating from the output of a DAQ Assistant block that is contained inside a while loop in another part of the program to compare current speed vs. recorded speed then output an action.  Everytime I try to draw a connection outside of the while loop, the actual value is not read outside of the loop.  I cannot put the other part of the program into the while loop because the while loop only performs every .1 to 1 second and I need the output to the actuator to be a continous string delievered to the serial port.  I also cannot create another DAQ Assistant block that reads the same port outside of the while loop.  I have thought about using a jumper to another input on the input card, but I would prefer not to use the extra space.
    So generally speaking, I'm wondering if there is a way to read a value obtained from a DAQ Assistant block outside of the while loop it is contained in.
    Thanks to anyone that can help!!!
    Travis

    Cheers,
    I am not 100% sure what your problem is but how about writing the red value into the local variable and reading it outside of the loop? Or enqueue the value into the queue and dequeue it in the other loop (Producer/Consumer Structure (Data))?
    Br,
    Jick

  • Is there a way to cycle a while loop on its own and only controlled by the number of cycles?

    Hello everyone, 
    Newcomer here, recenlty just took core 1 and 2 the past couple of months
    is there a way to cycle my while loop so that the daq assist receives the same outputs from the list box table? So pretty much I need the VI to be able to read the voltages and time values from the list box and then execute them, I've manage to do this, but then I need it to stop for a given time and then execute again the same voltages. This would be controlled by a control for "number of cycles" input. 
    Can someone tell me why my "Emergency Stop" button doesn't stop the VI?
    Why is my data logging only outputing one result if I have it to read ever min?
    My wave form graph isnt plotting the temperature results, does it have somthing to do with the while loop?
    I know this is a lot of questions, I'm just trying to solve this and learn from it.
    Attachments:
    TEST RIG 11 10-28-13.vi ‏298 KB

    You took core 1 and 2!!!  Please tell me NI didn't teach it.  I'm not trying to harp on you too bad because I think the instructor is more to blame.  You have many wires going the wrong direction, multple loops doing nothing, and one loop that will never stop so even if all the others did there would be no way to stop your program, a Stop button that is read only once at the start of the application and then is never read again (so stop will never work).  You have the inner loop running forever, but even if it did stop it would run the outer loop forever, your enums should be typedefed, uninitialized shift registers when not needed, dynamic data types, far too many express VIs...ouch.
    To answer your question.  If you have a while loop that needs to run 5 times, why not use a for loop? Then wire a 5 to the N terminal.  If you do have to use a while loop for what ever reason, use the i terminal as a condition to stop.  It will start at 0 and count up so a value of 4 means it will be executing the 5 time.  If the value equals 5 then stop.  Get the Array size of the Listbox and set your for loop to run for each item.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Circular linked list while loop

    i have a circular linked list and i'd like a while loop to iterate though all of them. my problem is that it always excludes the last node. i know why, it's due to the fact that "current.next != alive" skips it from ever accessing the last node. i can't seem to solve it. note that the last node in the list points to the first node (alive):
                   while(current.next != alive )
                        prev = prev == null ? prev = alive : prev;
                        //identify the name with it's matching node
                        if(name.equals(current.name.toLowerCase()))
                             prev.next = current.next;
                             dead = current;
                             current = current.next;
                             dead.next = null;
                             while(dead.next != null)
                                  dead = dead.next;
                        else
                             prev = current;
                             current = current.next;     
                   }

    //this class assists the client in managing a game of assassinations. it does so by providing options such as verifying a target's existence, getting the list of dead people, getting the lsit of alive people, and moving people from the alive to dead list
    public class AssassinManager
         private AssassinNode alive;
         private AssassinNode alive_tail;
         private AssassinNode dead;
         //pre: must send a string array
         //post: nodes are created
         public AssassinManager(String[] names)
              dead = null;
              alive = new AssassinNode(names[0]);
              AssassinNode current = alive;
              System.out.println(names[0] + " is first, " + names[(names.length-1)] + " is last\n\n");
              for(int i = 1; i < names.length; i++)
                   while(current.next != null)
                        current = current.next;
                   current.next = new AssassinNode(names);
              alive_tail = current.next = new AssassinNode(names[(names.length - 1)], alive);
         //post: outputs all the people still alive
         public void printKillRing()
              AssassinNode last = null, current = alive;
              while(current.next!= alive)
                   System.out.println(current.name + " is stalking " + current.next.name);
                   last = current.next;
                   current = current.next;
              System.out.println(current.name + " is stalking " + alive.name);
         //post: outputs a list of the dead people
         public void printGraveyard()
              AssassinNode last = null, current = dead;
              while(dead != null)
                   System.out.println(current.name + " was killed by " + current.killer);
                   last = current.next;
                   current = current.next;
         //pre: must send a string name
         //post: will return true/false depending on the input if the name is in the killing ring (alive)
         public boolean killRingContains(String name)
              AssassinNode current = alive;
              name = name.toLowerCase();
              while(current.next!= alive)
                   if(name.equals(current.name.toLowerCase()))
                        return true;
                   current = current.next;
              return false;
         //pre; must send a string name
         //post: will return true/false if the name is in the graveyard list
         public boolean graveyardContains(String name)
              AssassinNode current = dead;
              name = name.toLowerCase();
              while(dead != null && current.next != null)
                   if(name.equals(current.name.toLowerCase()))
                        return true;
                   current = current.next;
              return false;
         //post: checks if game is over by seeing if there is more than 1 player
         public boolean gameOver()
              AssassinNode current = alive;
              if(current.next == null)
                   return true;
              return false;
         //post: outputs the winner's name
         public String winner()
              AssassinNode current = alive;
              if(current.next == null)
                   return alive.name;
              return null;
         //pre: must send a string name that exists is alive
         //post: will remove the user from the alive list and add it to the killed list
         public void kill(String name)
              //check if person exists to remove them from alive list
              if(killRingContains(name.trim()) == true)
                   AssassinNode prev = null, current = alive, dead = this.dead;
                   name = name.toLowerCase();
                   while(current != null)
                        System.out.println(current.name);
                        if(name.equals(current.name.toLowerCase()))
                             prev = prev == null ? alive_tail : prev;
                             prev.next = current.next;
                             //dead = dead == null ? current : dead;
                             //while(dead.next != null)
                                  //dead = dead.next;
                             if(prev.next == alive)
                                  break;
                             current = prev.next;
                        else
                             if(current.next == alive)
                                  break;
                             prev = current;
                             current = current.next;
    }Edited by: ixxalnxxi on Apr 27, 2008 12:58 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Writing text file in while loop

    Here is my question about writing text data to a file in a while loop...worded best I can.
    I have an Init case where I have the user choose a file path and name. I take the ref out and then I have data that is being written to the file. The loop will take 40,000 pieces of data write them to the file and go back to the get data case to collect another 40,000 data points. But when I open the file, I only get a file as big as 430KB. I'm not sure but can somone show me an example of pulling analog data from a DAQ Assist, doing a calculatoin on it, writing it to a file and repeating that by adding it to the same file at the end of the previous data?
    Solved!
    Go to Solution.

    Take a look at the attached VI's.  Did you have your data set to append?  This could be your problem.
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Save Data SM.vi ‏15 KB
    File Path Prompt.vi ‏15 KB

  • Handling events in a while loop

    In a while loop, I need to stop the loop after a change of state from false to true or true to false or I can do this by detecting a certain string from the serial port. Seems like I should be able to do this simply by using a counter which is edge triggered. Please Help.

    I would love to help but you have provided very little for me to go on.
    RE: your boolean, if you recall the previous state and compare to the current using an exclusive OR operation, It should return a true when the previous and current values are different.
    On the string thing, you could compare the read string with a constant and get a true when they match.
    The above are simply lame ideas that may be of use. If you could go into greater detail, I may be of greater assistance.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Add to new values to an existing 1D array in a while loop

    Hello,
    I have a while loop that collects data from a DAQ Assistant and stores it into a 1D array. The number of loops is set by the user. I am trying to average the data from each iteration of the loop. So far I am only able to get the array to overwrite the previous array values with the new ones.
    if Number of loops = 3
    First Iteration                      Second Iteration                         Third Iteration                           New 1D Array        [Divide by Loop #
    4.97                                      4.99                                               4.98                                            14.94                       for the average]
    4.97                                      4.99                                               4.98                                            14.94
    4.96                                      4.98                                               4.97                                            14.91
    4.98                                      5.00                                               4.99                                            14.97
    4.97                                      4.99                                               4.98                                            14.94
    I would like to make this as general as possible as the loop number will vary depending on the user input. 
    Solved!
    Go to Solution.

    sgtpppr685 wrote:
    I like the creative solution you have provided however, I am trying to keep the average at each element so that I can graph the average at each point. Therefore, I need the average to be a 1D array of the same initial length, not a scalar. 
    I am trying to avoid using shift registers.
    1. Do you mean you want the average after each iteration as well?  This can be done pretty easily by moving the division inside my loop.  Perhaps I am misunderstanding you though.
    2. Why avoid shift registers?  They are amazing and effective.  They are an essential LabVIEW tool imo   Plus they work wonderfully for your current problem.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

Maybe you are looking for