Why wont my probes read outside of the For Loop?

The problem seems that, for some reason the when I try to line a wait time function outside of a while loop after I have used a boolean function, (subtract). What I am trying to do is to reset the time axis on the graph because it wants to spiral into millions of numbers and to keep counting. I want to just take samples of like 100-1000 milliseconds and graph my data pixels against it. I have tried a while loop, that seems to work sometimes. The thing is really weird, it seems as if it wants to work sometimes and in some places but not in others. I have attached some expamples and the VI I am trying to get to work. Notice the problem places are in Red.
Thanks alot guys, (and girls), for any help that y
ou can give me.
Brian
Attachments:
example_for_analysis_by_engineers.vi ‏40 KB
Brians_Display_Image_not_U8_but_U16.vi ‏102 KB

Could you include the other VIs as well (save with options -> development distribution)? It's not possible to run your VI without the sub-VIs.
I haven't fully understood what you are trying to accomplish, but looking at what I've got there are two things that come to mind:
If you are generating data inside the loop, and only want to sample some of it and send that data to a graph then you must make sure that the data flow works. A loop will not output the data you wire out of it until the loop has terminated.
Thre little grey dot you mention in the code is a "coercion dot", it means that the data you wire into the function/VI does not have the same type as the function expects. LV will use the polymorphism functionality to coerce the data to the correct t
ype, an operation that is best avoided, at least if it's a lot of data involved (requires extra memory to do the coercion) or if it may cause an incorrect value to be passed. In your case the image cluster you have wired to the IMAQ function is not based on the type definition the function is using, just replace the cluster with the type defined one you'll get rid of the dot.
MTO

Similar Messages

  • HT1414 why wont iphone4 download ios6 without saying the software was corrupted during download

    why wont iphone4 download ios6 without saying the software was corrupted during download   what do i do n how do i resolve this   i jus need an update as it is on ios4 still and *****  

    im having the same problem. i talked to a friend of mine who is basically a genuis and he said it probably is Apple's server...that so many people are updating and its causing this. i havent found a true answer yet, i tried to call apple support, but that was hopeless. i thought maybe restoring my phone or something, but i dont want to do that and then realize that if i waited til tomorrow or so that i didnt have to. but im stuck just like you guys!

  • Why wont my homesharing let me control the apple tv?

    Why wont my homesharing let me control the apple tv?

    Could be a hardware problem.
    First try a reset which is similar to a computer restart and is done by pressing and holding the home button and the sleep/wake or on/off button simultaneously until you see the Apple logo and then release.

  • 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

  • I have an Iphone 4 and my internet has not worked for a good 10 months, why wont it work? my dad pays for my data plan, so its not that i dont pay my bill. I've even tried to reset my net work settings, and that did not work

    i have an iphone 4 and my internet has not worked for a good 10 months, why wont it work? My dad pays for my data plan, so its not that i dont pay the bill. I've even tried to rest my net work settings, and that did not work. I went to AT&T and they said that the only way to fix it was to buy a new phone, and im not going to buy a new phone with out my upgrade. someone, please help!

    Hey lilmissindian!
    I have an article for you here that will help you troubleshoot this issue:
    iPhone: Troubleshooting a cellular data connection
    http://support.apple.com/kb/ts3780
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • Print a value outside the for loop.

    for (int j=0; j< 4; j++)
              String name = "AAAA";
              String add="BBBB";
              LogManager.logStatus("  NAMe.. ............   "+name);
    LogManager.logStatus("  Name ;;;;;;;;;;;   "+name);I want to how to print the "Name ;;;;;;;;;;; ". after the for loop.

    If i declared as
    private static String name;
    then the output is coming null in 2nd log statement.
    But i need the the print of 2nd log should be same as log in 1st .

  • Why Isn't the for loop executing?

    here's the code,the for loop isn't executing,can anyone trouble shoot?
    import acm.program.ConsoleProgram;
    public class AddIntegerList extends ConsoleProgram {
    public void run(){
         for(int c=0;c<5;c++);{
         println("This is a programe to divide 2 numbers");
    double i = readDouble("enter num1: ");     
    double x = readDouble("enter num2: ");
    double ans = i/x;
    println("The answer to your division Is "+ans+ "");
              } by the way,this Is the first piece of java code that I have written. :D
    Edited by: Parastar on Oct 21, 2009 4:20 AM

    I dont think there should be a semicolon at the end of this
    for(int c=0;c<5;c++); Remove it and try running the program.
    Edited by: A.J.Bharanidharan on Oct 21, 2009 4:53 PM

  • The demand of my application is that i can not replace for loop with a while loop.because i need fixed number of iterations and as far as i know fixed iterations could be only with possible with the for loop.

    the demand of my application is that i can not replace for loop with a while loop.because i need fixed number of iterations and as far as i know fixed iterations could be only with possible with the for loop.
    your recommended second option that i could add true/false case.
    this true/false case must be inside the for loop or outside the for loop?if this case is inside the for
    loop, how can i send stop command from outer while
    loop?
    more over do you have any example for this please?
    thanks"

    You can execute a fixed number of iterations using a while loop by comparing the iteration count to the number of iterations you want and wiring the output of that comparison (e.g. Less Than or Equal To) to the continue (or stop) terminal of your while loop. Which comparison you use depends on personal preference, where you wire the desired count and the interation count, and whether you're using the while loop as Continue if True or Stop if True.
    Ben gave you step-by-step instructions in response to your previous question. Look here for Ben's response.
    Ben's response looks pretty good and detailed to me. It certa
    inly deserved better than a 1-star rating.

  • How to code a parallel 'for loop' and 'while loop' where the while loop cannot terminate until the for loop has finished?? (queues also present)

    I've attached a sample VI that I just cannot figure out how to get working the way that I want.  I've labeled the some sections with black-on-yellow text boxes for clarity during the description that follows in the next few sentences.  Here's what I want:
    1) overall -- i'm intend for this to be a subVI that will do data acquisition and write the data to a file.  I want it to use a producer/consumer approach.  The producer construct is the 'parallel for loop' that runs an exact number of times depending on user input (which will come from the mainVI that is not included).  For now I've wired a 1-D array w/ 2 elements as a test case.  During the producer loop, the data is acquired and put into a queue to be delt with in the consumer loop (for now, i just add a random number to the queue).
    2) the consumer construct is the 'parallel while loop'.  It will dequeue elements and write them to a file.  I want this to keep running continuously and parallel until two conditions are met.
          i. the for loop has finished execution
          ii. the queue is empty.
       when the conditions are met, the while loop will exit, close the queue, and the subVI will finish. (and return stuff to mainVI that i can deal with on my own)
    Here's the problems.
    1)  in the "parallel for loop" I have a flat sequence structure.. I haven't had time to incorporate some data dependency into these two sequential sections, but basically, I just care that the "inner while loop" condition is met before the data is collected and queued.  I think I can do this on my own, but if you have suggestions, I'm interested.
    2)  I can easily get the outer for and while loops to run sequentially, but I want them to run in parallel.  My reasoning for this is that that I anticipate the two tasks taking very different amounts of time. .. basically, I want the while loop to just keep polling the queue to get everything out of it (or I suppose I could somehow use notifiers - suggestions welcome)...  the thing is, this loop will probably run faster than the for loop, so just checking to see that the queue is empty will not work... I need to meet the additional condition that nothing else will be placed in the queue - and this condition is met when the for loop is complete. basically, I just can't figure out how to do this.
    3) for now, I've placed a simple stop button in the 'parallel while loop', but I must be missing something fundamental here, because the stop button is totally unresponsive.  i.e. - when I press it, it stays depressed, and nothing happens.
    suggestions are totally welcome!
    thanks,
    -Z
    Attachments:
    daq01v1.vi ‏59 KB

    I'd actually like to add a little more, since I thought about it a bit and I'm still not quite certain I understand the sequence of events...
    altenbach wrote:
    zskillz wrote:
    So i read a bit more about the 'dequeue element' function, and as I understand it, since there is no timeout wired to the dequeue element function, it will wait forever, thus the race condition I suggested above can never happen!
    Yes, you got it!
    As I've thought about it a bit more, there's a few things that surprise me... first, the reason the 'dequeue element while loop' errors is not because there's nothing in the queue, it's becaues the queue has been released and it's trying to access that released queue...   However the problem I have is this --- Even though there's no timeout wired to the dequeue element, I still would think that the while loop that contains it would continue to run at whatever pace it wanted -- and as i said before.. most of the time, it would find that there is nothing to dequeue, but once in a while, something is there.  however, it seems that this loop only runs when something has been enqueued.  the reason I say this is illustrated in the next code sample MODv2 that's attached below.  I've added a stop button to the "queue size while loop" so the program runs until that is pressed.  I've also added a simple conditional in the "dequeue while loop"  that generates a random number if it a button is pressed... but this button is totally non-responsive... which means to me that the "dequeue while loop" isn't actually continuously running, but only when an element is added to the queue.  this still seems almost like the 'dequeue while loop" waits for a notifier from the queue telling it to run.  can you explain this to me? because it is different from what I expect to be happening.
    rasputin wrote:
    I tried to open your VIs but it doesn't work. LV
    is launched, the dialog box (new, open, configure...) opens and then...
    nothing. Not even an error message. I guess it isn't a problem of LV
    version or a dialog box would appear saying this. Could you, please,
    send a image of the code?
    Thanks,
    Hi Rasputin, I'm using LV8.  I assume that was your problem, but who knows.  I've attached a pic of of altenbach's solution since it's what I needed.
    thanks
    -Z
    Message Edited by zskillz on 10-20-2006 11:49 AM
    Attachments:
    daq01v1MODv2.vi ‏63 KB
    daq01v1MODpic.JPG ‏116 KB

  • Need help with the for loop

    Hello,
    I hope someone can point me in the right direction for my next assignment. I am very new at Java programming. For my next assignment for class I will need expand my previous program which was a mortgage calculator. The first assignment we wrote a program to show the monthly payments of a $200,000 loan at 5.75% for 30 years. Now we have to output all 360 monthly payments with pauses in between so it doesnt scoll off the page. The calculation that we use is:
    month_payments = (principle * monthlyinterest) / (1-Math.pow(1 + monthlyinterest, - months));
    My question is how do I get the correct calculation outputed 360 times. I would like to use the "for loop" to do this. Also what is the correct way to do the pause command? I do not want someone to write the code, I just want some help to where I need to start off, I want to learn this on my own.
    Thanks in advance,
    DC

    for (int i ; i < 10 ; i ++ ) { System.out.println("Come sail away"); }
    or;
    int i = 0;
    while(i < 10)
        i++;
        System.out.println("Come sail away");
    }

  • Less or less than equal in the for loop condition

    Hi,
    What do you prefer, what is more common, which one is more easily readable, less or less than equal in the for loop condition?
    for (int i = 0; i < arr.lenght; i++){..}
    //or
    for (int i = 0; i <= arr.lenght - 1 ; i++){..}I know this is basic programming and nothing to do with Java, so if this forum is not for this purpose, could you please suggest a general programming forum?
    I would really appreciate it as I have many general questions :)
    Thanks in advance,
    lemonboston

    lemonboston wrote:
    Hi,
    What do you preferPersonal preference, which is useless to you
    , what is more common,Based on years of reading open source code, the first
    which one is more easily readable, less or less than equal in the for loop condition?Personal opinion, which is useless to you
    I would really appreciate it as I have many general questions :)If you don't want to think about it yourself (which you should be doing in stead of asking general questions), simply attack it lazily. Both examples achieve exactly the same, but the first one is less to type and to read.

  • [svn:bz-trunk] 21048: moving the locking of MessageService. subscribeLock one level up in the for loop.

    Revision: 21048
    Revision: 21048
    Author:   [email protected]
    Date:     2011-04-08 06:47:21 -0700 (Fri, 08 Apr 2011)
    Log Message:
    moving the locking of MessageService.subscribeLock one level up in the for loop.
    in case of multiple subscribers, we only lock once
    checkintests pass
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/services/MessageService.java

    I have finally been able to replicate the behavior that you are seeing on another computer once the image was large enough.  Here are a few notes about this behavior:
    First. The UI only slows down when the images are large, 16 bit images.  The reason why this is unique to 16 bit images is that they can only be displayed on the front panel as 8 bit images.  The workaround that Weiyuan suggested to change the 16 bit display mapping hints towards the root of the problem...that any time a mouse runs over the indicator, Windows asks the entire image to re-draw (having a separate indicator overlapping the image will create the same behavior).  With a 16 bit image, not only does the image have to re-draw on the screen but the 16 bit pixels need to be mapped to 8 bits.  When setting the 16 bit display mapping to Full Dynamic, this requires mor computation/pixel than 90% dynamic or one of the other mapping schemes.
    This is expected behavior if your program is running and you're trying to display a large 16 bit image.  To fix this behavior there are a couple options:
    Change the 16 bit display mapping to something other than full dynamic.  You can choose which 8 bits to display or if you want to map the bits. 
    Resize the image just for viewing purposes on your front panel (since you aren't going to view every single pixel of you image on the screen). You can use the IMAQ Resample.vi to do this.  This will allow you to take your 1500x1500 pixel image and only display a 500x500 pixel version.
    If you are interested in viewing small details of the large image, consider just displaying a smaller region of interest at a time.
    Let me know if any of these solutions work for you.  Good luck on your application.
    Zach C.
    Field Engineer
    Greater Los Angeles

  • How to speed up my code inside the for loops,

    how to speed up my code inside the for loops using c# WinForm.

    Hi  John,
    Please take a look at the reply from Wyck in the following thread.
    How to speed up for loop?
    His answer is very comprehensive.   Thanks.
    Best regards,
    kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to control the looping time of the for loop in 10 microseconds in labview?

    I need to create a +/- 9 volt square wave with period of 20us using a D/A card (Not NI card). I can write command to the card using outport provide by Labview. Right now, I can generate square wave with 4ms period which is limited by the resolution of the wait until next ms icon I used inside the for loop. Could anyone tell me how to control the execution time of the for loop to about 10 us? Your help would be much appreciated.

    I'm not sure if this will hep, but this answer seems to answer this question
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000029410000&UCATEGORY_0=_30_%24_12_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=microsecond+resolution+1ms&USEARCHCONTEXT_QUESTION_S=0

  • The speed of the "for loop iteration"

    Hi all:
    I have written a short mini program just to test out the speed of a "for loop iteration"
    package generator;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2004</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
      private static long tmp = 0;
      public static int count=0;
      public synchronized long getValue(){
          long value = 0;
        value = 10 * System.currentTimeMillis();
        if(value == tmp){
          value++;
          count++;
        tmp = value;
        return value;
      public static void main(String[] args) {
       for (int i=0;i<1000;i++){
          getValue();
        System.out.println("count is " + count);
    }And i find that on average, count will be a value between 498-500, which probably means that on average the speed of a for loop is around 0.5 ms. But I guess the speed of the "for loop " iteration is also very much CPU dependent, could somebody possibly give me some education on this issue :) ?
    Also, anybody know exactly how System.currentTimeMillis works? For example, how does it get the current time from the OS, etc. let me know.
    Again, Many many thanks...

    Hi all:
    I have written a short mini program just to test out the speed of a "for loop iteration"You will find the overhead of the getValue() call, the increments and most importantly the System.currentTimeMillis() is what you are timing.
        public static void main(String args[])  {
            int ITER = 1000000000;
            long start = System.currentTimeMillis();
            for(int i=0;i<ITER;i++);
            long end = System.currentTimeMillis();
            System.out.println("Iterations per sec="+ITER*1000L/(end - start));
        }Prints the following Iterations per sec=576368876Running on a 1.8 GHz Intel/Windows2000

Maybe you are looking for

  • Getting values from a function module called in a WDA method

    Friends, I am trying to execute a function module from WDA. I have created a service call for the function module. The function module takes values from the user, looks up the corresponding values of another field and returns the values in an interna

  • Edit in Photoshop CC (2014) not transferring back to Lightroom

    After uninstalling and reinstalling LR 5.5 AND Photoshop CC (2014) I was finally able to get images to go from LR to PS, but after editing the TIFs are not reimporting into Lightroom. The images save in the same folder. OS Windows 7 Pro 64-bit Lightr

  • Text determn

    HI, i enter text in so -header say terms of payment 10days did delivery - terms of payment 10days copied from order then did billing - terms of payment 10days copied saved billing. now i went to delivery changed terms of payment to 50 days -but still

  • Images being "magically" replaced by other images

    I am using Aperture 2.4.1 and lately when I open a folder my thumbnails have been changing to different images on their own. Sometimes it happens automatically and sometimes I click on the image. For instance I will click on a photo of a person and t

  • CS5.5: Locked Mask bug is still there

    Using the Select All command on masks, selects all masks, not all unlocked masks. Here's how to replicate it: On one layer, create 3 masks Create a keyframe on all of the masks' paths Move down the time line a little bit. Lock Mask 1 Select Mask 2 Us