How would I implement a FOR loop in real time?

I am using a cRIO and would like to have several processes running in parallel.  A main functin will have a loop in it which will count up and an certain time intervals pass data to a parallel process.  I am not sure how LV will check the current time value and determine if it is time to send the parallel process information (it will send the parallel process a command to start at time X and stop at time Y).  I see the code in C as:
for (i; i <= 60; i++)
     if (i==30)
        Function(1); //send "1" to function to  start action, equivalent of setting a variable in LV and continuously reading that variable in the parallel function
     if(i==45)
        Function(0); //send "0" to function to stop condition
    delay(1second);
I am confused about how to create a loop that has a predetermined (changeable) time period that allows me to compare the timer to set times (i.e. 30 and 45) and perform a function if they are equal.  I can handle that compare part but I am not sure how to implement the loop.  Any help would be greatly appreciated.

Hi,
Why don't you use "Elapsed time.vi" ? Compare it with the time you require. Also you can use register event function to let the other process know a certain condition has occurred.
Gaurav k:smileyhappy:
Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.

Similar Messages

  • I have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    i have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    Hi fais,
    Following through with what JB suggested. The steps involved in replacing the inner for loop with a while loop are outlined below.
    You can replace the inner for loop with a while by doing the following.
    1) Right-click of the for loop and select "Repalce" then navigate to the "while loop".
    2) Make sure the tunnels you where indexing on with the for loop are still indexing.
    3) Drop an "array size" node on your diagram. Wire the array that determines the number of iterations your for loop executes into this "array size".
    4) Wire the output of the array size into the new while loop.
    5) Set the condition terminal to "stop if true".
    6)Drop an "OR" gate inside the while loop and wire its output to the while loops condition terminal.
    7) C
    reate a local of the boolean "stop" button, and wire it into one of the inputs of your OR gate. This will allow you to stop the inner loop.
    8) Drop a "less than" node inside the inner while loop.
    9) Wire your iteration count into the bottom input of the "less than".
    10) Wire the count (see step 4 above) into the top input of the less than. This will stop the inner loop when ever the inner loop has processed the last element of your array.
    Provided I have not mixed up my tops and bottoms this should accomplish the replacement.
    I will let others explain how to takle this task using the "case solution".
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can I repeat a for loop, once it's terms has been fulfilled???

    Well.. I've posted 2 different exceptions about this game today, but I managed to fix them all by myself, but now I'm facing another problem, which is NOT an error, but just a regular question.. HOW CAN I REPEAT A FOR LOOP ONCE IT HAS FULFILLED IT'S TERMS OF RUNNING?!
    I've been trying many different things, AND, the 'continue' statement too, and I honestly think that what it takes IS a continue statement, BUT I don't know how to use it so that it does what I want it too.. -.-'
    Anyway.. Enought chit-chat. I have a nice functional game running that maximum allows 3 apples in the air in the same time.. But now my question is: How can I make it create 3 more appels once the 3 first onces has either been catched or fallen out the screen..?
    Here's my COMPLETE sourcecode, so if you know just a little bit of Java you should be able to figure it out, and hopefully you'll be able to tell me what to do now, to make it repeat my for loop:
    Main.java:
    import java.applet.*;
    import java.awt.*;
    @SuppressWarnings("serial")
    public class Main extends Applet implements Runnable
         private Image buffering_image;
         private Graphics buffering_graphics;
         private int max_apples = 3;
         private int score = 0;
         private GameObject player;
         private GameObject[] apple = new GameObject[max_apples];
         private boolean move_left = false;
         private boolean move_right = false;
        public void init()
            load_content();
            setBackground(Color.BLACK);
         public void run()
              while(true)
                   if(move_left)
                        player.player_x -= player.movement_speed;
                   else if(move_right)
                        player.player_x += player.movement_speed;
                   for(int i = 0; i < max_apples; i++)
                       apple.apple_y += apple[i].falling_speed;
                   repaint();
                   prevent();
                   collision();
              try
              Thread.sleep(20);
              catch(InterruptedException ie)
              System.out.println(ie);
         private void prevent()
              if(player.player_x <= 0)
              player.player_x = 0;     
              else if(player.player_x >= 925)
              player.player_x = 925;     
         private void load_content()
         MediaTracker media = new MediaTracker(this);
         player = new GameObject(getImage(getCodeBase(), "Sprites/player.gif"));
         media.addImage(player.sprite, 0);
         for(int i = 0; i < max_apples; i++)
         apple[i] = new GameObject(getImage(getCodeBase(), "Sprites/apple.jpg"));
         try
         media.waitForAll();     
         catch(Exception e)
              System.out.println(e);
         public boolean collision()
              for(int i = 0; i < max_apples; i++)
              Rectangle apple_rect = new Rectangle(apple[i].apple_x, apple[i].apple_y,
    apple[i].sprite.getWidth(this),
    apple[i].sprite.getHeight(this));
              Rectangle player_rect = new Rectangle(player.player_x, player.player_y,
    player.sprite.getWidth(this),
    player.sprite.getHeight(this));
              if(apple_rect.intersects(player_rect))
                   if(apple[i].alive)
                   score++;
                   apple[i].alive = false;
                   if(!apple[i].alive)
                   apple[i].alive = false;     
         return true;
    public void update(Graphics g)
    if(buffering_image == null)
    buffering_image = createImage(getSize().width, getSize().height);
    buffering_graphics = buffering_image.getGraphics();
    buffering_graphics.setColor(getBackground());
    buffering_graphics.fillRect(0, 0, getSize().width, getSize().height);
    buffering_graphics.setColor(getForeground());
    paint(buffering_graphics);
    g.drawImage(buffering_image, 0, 0, this);
    public boolean keyDown(Event e, int i)
         i = e.key;
    if(i == 1006)
    move_left = true;
    else if(i == 1007)
         move_right = true;
              return true;     
    public boolean keyUp(Event e, int i)
         i = e.key;
    if(i == 1006)
    move_left = false;
    else if(i == 1007)
         move_right = false;
    return true;
    public void paint(Graphics g)
    g.drawImage(player.sprite, player.player_x, player.player_y, this);
    for(int i = 0; i < max_apples; i++)
         if(apple[i].alive)
              g.drawImage(apple[i].sprite, apple[i].apple_x, apple[i].apple_y, this);
    g.setColor(Color.RED);
    g.drawString("Score: " + score, 425, 100);
    public void start()
    Thread thread = new Thread(this);
    thread.start();
    @SuppressWarnings("deprecation")
         public void stop()
         Thread thread = new Thread(this);
    thread.stop();
    GameObject.java:import java.awt.*;
    import java.util.*;
    public class GameObject
    public Image sprite;
    public Random random = new Random();
    public int player_x;
    public int player_y;
    public int movement_speed = 15;
    public int falling_speed;
    public int apple_x;
    public int apple_y;
    public boolean alive;
    public GameObject(Image loaded_image)
         player_x = 425;
         player_y = 725;
         sprite = loaded_image;
         falling_speed = random.nextInt(10) + 1;
         apple_x = random.nextInt(920) + 1;
         apple_y = random.nextInt(100) + 1;
         alive = true;
    And now all I need is you to answer my question! =)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    package forums;
    import java.util.Random;
    import javax.swing.Timer;
    import javax.imageio.ImageIO;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class VimsiesRetardedAppleGamePanel extends JPanel implements KeyListener
      private static final long serialVersionUID = 1L;
      private static final int WIDTH = 800;
      private static final int HEIGHT = 600;
      private static final int MAX_APPLES = 3;
      private static final Random RANDOM = new Random();
      private int score = 0;
      private Player player;
      private Apple[] apples = new Apple[MAX_APPLES];
      private boolean moveLeft = false;
      private boolean moveRight = false;
      abstract class Sprite
        public final Image image;
        public int x;
        public int y;
        public boolean isAlive = true;
        public Sprite(String imageFilename, int x, int y) {
          try {
            this.image = ImageIO.read(new File(imageFilename));
          } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException("Bailing out: Can't load images!");
          this.x = x;
          this.y = y;
          this.isAlive = true;
        public Rectangle getRectangle() {
          return new Rectangle(x, y, image.getWidth(null), image.getHeight(null));
      class Player extends Sprite
        public static final int SPEED = 15;
        public Player() {
          super("C:/Java/home/src/images/player.jpg", WIDTH/2, 0);
          y = HEIGHT-image.getHeight(null)-30;
      class Apple extends Sprite
        public int fallingSpeed;
        public Apple() {
          super("C:/Java/home/src/images/apple.jpg", 0, 0);
          reset();
        public void reset() {
          this.x = RANDOM.nextInt(WIDTH-image.getWidth(null));
          this.y = RANDOM.nextInt(300);
          this.fallingSpeed = RANDOM.nextInt(8) + 3;
          this.isAlive = true;
      private final Timer timer = new Timer(200,
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            repaint();
      public VimsiesRetardedAppleGamePanel() {
        this.player = new Player();
        for(int i=0; i<MAX_APPLES; i++) {
          apples[i] = new Apple();
        setBackground(Color.BLACK);
        setFocusable(true); // required to generate key listener events.
        addKeyListener(this);
        timer.setInitialDelay(1000);
        timer.start();
      public void keyPressed(KeyEvent e)  {
        if (e.getKeyCode() == e.VK_LEFT) {
          moveLeft = true;
          moveRight = false;
        } else if (e.getKeyCode() == e.VK_RIGHT) {
          moveRight = true;
          moveLeft = false;
      public void keyReleased(KeyEvent e) {
        moveRight = false;
        moveLeft = false;
      public void keyTyped(KeyEvent e) {
        // do nothing
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        //System.err.println("DEBUG: moveLeft="+moveLeft+", moveRight="+moveRight);
        if ( moveLeft ) {
          player.x -= player.SPEED;
          if (player.x < 0) {
            player.x = 0;
        } else if ( moveRight ) {
          player.x += player.SPEED;
          if (player.x > getWidth()) {
            player.x = getWidth();
        //System.err.println("DEBUG: player.x="+player.x);
        Rectangle playerRect = player.getRectangle();
        for ( Apple apple : apples ) {
          apple.y += apple.fallingSpeed;
          Rectangle appleRect = apple.getRectangle();
          if ( appleRect.intersects(playerRect) ) {
            if ( apple.isAlive ) {
              score++;
              apple.isAlive = false;
        g.drawImage(player.image, player.x, player.y, this);
        for( Apple apple : apples ) {
          if ( apple.isAlive ) {
            g.drawImage(apple.image, apple.x, apple.y, this);
        g.setColor(Color.RED);
        g.drawString("Score: " + score, WIDTH/2-30, 10);
      private static void createAndShowGUI() {
        JFrame frame = new JFrame("Vimsies Retarded Apple Game");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(new VimsiesRetardedAppleGamePanel());
        frame.pack();
        frame.setSize(WIDTH, HEIGHT);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args) {
        SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              createAndShowGUI();
    }Hey Vimsie, try resetting a dead apple and see what happens.

  • How would you implement equals ()

    For complex classes with many data members, my dilema is:
    1. equals should return true only if all fields of the two objects are
    equals.
    2. equals should return true if the key(s) of the two objets are equal.
    For instance, we have the Class Person, that contains dozens of
    data: ID, name, age, job, salary, children, more 1000 items.
    Person is like a record in a DB table. There can not be two persons
    with the same ID.
    In this case, how would you implement equals, and why?
    thanks

    What I'm trying to say is: what is equality foryou?
    Two objects are equal if all there contents areequals
    or is it enough
    to compare their keys?
    In the latter case, there can happen, by somereason,
    that we can end
    up with two objects with the same keys, but all the
    rest of
    the contents different.i think you meant to say that:
    In the latter case, there can happen, by somereason,
    that we can end
    up with two objects with different keys, but
    all the rest of the contents the same.and the answer is, and listen carefully, it totally
    depends on the application you are writing. there
    is no hard definition of equality where custom classes
    are concerned... that is the answer.If this question arises, you should revisit your design.
    If two entities have equal keys, they should be considered to be equal. Otherwise the attributes you call keys are in the fact normal attributes and no keys.

  • How to get out of for loop in eclipse debugging

    How to get out of for loop in eclipse debugging for java classes ?
    I am in a for loop in a code. i want to get out of it ...but how ?

    is changing the behaviour of a running class like that really going to be any use for debugging? what's the actual problem?

  • How to make the exchange of data between 2 while loop in real time

    hello
    I have 2 while loop
    the 1st while loop includes the data acquisition program
    the 2nd while loop includes the control program
    my question is how to make the exchange of data between 2 while loop in real time
    I tried with the local variable and direct wiring between the 2 while loop
    it does not work (there is a delay)
    Solved!
    Go to Solution.

    Bilalus,
    Queues are only good to transfer data if your application isn't deterministic. Since you are using Real Time, I am assuming that your application requires determinism. If you are using Timed Loops and you use queues to transfer data between your loops, you are losing determinism. In this case, you need to use the RT FIFO functions. 
    Warm Regards,
    William Fernandez
    Applications Engineering
    National Instruments

  • AE CS6: How to Ram preview or playback in smooth real-time everytime?

    Hi guys,
    I would  like to know how to Ram preview or playback in smooth real-time everytime? I'm using a videohive template and adding in my footages to the media holder comps. The AE template is complex I guess.
    Hee's the problem, everytime I make a change to text, add a footage replacement or make any change at all, I have to completely render and wait a long time to see my final product in "Real-time"/smooth. Is there someway that I can render out the whole thing once and even though I make a change the entire video will play smoothly without rendering time? 
    PC Specs:
    HP 510t
    Windows 8 Pro x64 bit
    16GB Ram
    i7 2600 CPU @3.4 GHz
    GTX 660Ti

    Proxies don't affect rendering beyond the point of reducing the resolution and thus the nuimer of pixels that need to be processed, but since the retain the effect properties at full resolution, e.g. a large blur still renders just as slow. They are more a means of reducing file I/O bandwidth while working really.... As I said, the best way to optimize this would probably be to restructure the project so parts that don't change reside in separate pre-compositions and can use the disk cache.
    Mylenium

  • How can I boot my PXI controller into real-time without a floppy disk?

    My PXI controller is in a lab which has intense magnetic fields that could corrupt the floppy disk used to boot the PXI controller into the LabVIEW Real-Time (RT) Operating System. How can I boot the PXI controller into real-time directly from the hard drive?

    If you are using LabVIEW 5.1.2 Real-Time (RT), launch Remote System Explorer and select Disks >> Create Format Hard Drive Disk. If you have LabVIEW 6 RT, launch the Measurement and Automation Explorer (MAX) and select Tools >> RT PXI Disk Utilities >> Create Format Hard Drive Disk (LabVIEW RT 6 has not be released yet). Once you have created the disk, boot the PXI controller with the Format Hard Drive Disk, and this will format the PXI's hard drive and install the real-time OS boot loader. Now you can reboot the PXI without a floppy disk and configure the PXI using Remote System Explorer or MAX. Be aware that this will remove all information from the hard drive, including other operating systems.

  • How do i configure a FOR loop to have the behavior of the step Loop Type: Pass/Fail count?

    Hello,
    I'm using the Pass/Fail count set to one Pass to capture an event generated by my DUT.  I originally used a numerical compare step with the Looping type of Pass/Fail count to accomplish this.  Unfortunately the implementation changed and now I need to execute a few steps that can not be combined within one code module as before. Nor can these steps be put into a subroutine.  One of the steps executes a .NET asembly and I haven't figured out how to pass the reference to the subroutine.  When the subroutine is intered the reference is lost and the methode does not execute correctly.
    I have an evaluation function the exits the loop when the expected conditions are met. Everything works except for the Overall Pass/Fail result of the For loop.  If the loop exits due to the first numerical compare test passing, I want the loop overall execution to report as "Passed".  If the loop reaches it's predetermined number of iterations, the overall result needs to report as "Failed".  It would also be nice to have the radio button functionality of "Record Result of Each iteration".  Some conditions require a wait over a minute for the event to occur and I don't want to generate needless data for the report.
    Currently I get the pass/fail status for each For loop iteration, but only "Done" for each loop iteration.  I don't want the initial few failures to cause the test to fail.
    Does anyone know how to do this? Suggestions?
    Thanks,

    I have 2 steps in the loop that can not be combined into one step. This forces me to implement the behavior in some form of loop.  A While Loop could be an option.  I would need to pass the Step.Result.Status from the Multiple Numerical compaire step to the condition of the While Loop.  I tried to use the Step.TS.ID without success.  Some form of reference to the numerical compare step would be needed. I'm using a For Loop as I do want to limit the number of iterations of the loop.  In the case where the loop iterations are reached, the event I am trying to detect did not occur at the correct time and a failure needs to be reported.
    I came up with something based on my comments in the second post:
    1) To start with I configured a Locals.ForLoop_5 variable.  This is used to set the limit on the loop iterations and for comparison after the loop has finished executing. More on that later.
    2) The first step inside the loop invokes a method within a .NET assembly that has been packed in a DLL This method gets the required data from the DUT and stores it to a text file.
    3) The next step is the Multiple Numeric Limit step.  This step invokes a VI that extracts the data from the text file.  This step has been customized in several ways.
      i)  In Run Options, the Results Recording Option was disabled.  This prevents recording of "Failed" while the loop executes when waiting for the event to happen.
      ii) In Run Options, the Step Failure Causes Sequence Failure is unchecked.  Same reasoning as i)  These steps are not true failures.
      iii) A Post Action is configured to go to the nexxt step after the For Loop End step On Condition True with the logic of Step.Result.Status == "Passed".  This causes the loop to exit when the first "Passed" is encountered which corrolates with the event I'm trying to detect. On Conditon Fail remains set to default.
    4)  The step after the For Loop End is an expression step with everythin set to default except for the Status Expression logic set to: Locals.Loopindex < Locals.ForLoop_5 ? (Step.Result.Status = "Passed") : (Step.Result.Status = "Failed"). This step performs the overall Pass/Fail reporting for the For Loop.  If the number of loop iterations is less than the maximum it could have only gotten there by the previous logic triggered by the numerical compare passing, therefore "Passed".  If the loop index has reached the limit, then the event was not detected, therefore Failed.
    I have tested this work around with success, it just a pain to now have to implement this on my 40 some odd For Loops.
    If there is a better way, I'd still like to hear it.

  • 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

  • How do i implement this while loop

    I need to implement this while loop, i tried it using the case structure but i am not able to do it, i am getting a error saying that Missing alignment to tunnel , Case Structure : Unwired selector...
    the while loop is :
    while ((eps>EPSTol)&(iter<iterMAX))
       Ew = Ew.*(sqrt (F./Fr));         
       Ew (find (isnan (Fr))) = 0;       
       Fr = normalise (Fr);
       eps = chi2 (F, Fr);
    end
    can you please help me on this....
    Attachments:
    untitled.jpg ‏1909 KB

    It's been said many times before, but it bears repeating;
    DO NOT POST BITMAPS TO THE FORUM. DO NOT CHANGE THE EXTENSION OF A FILE TO .jpg, .gif, OR ANYTHING ELSE JUST TO GET IT PAST THE FILTERS.THE FILTERS ARE THERE FOR A REASON.
    You will not be able to connect the output of your OR function to the case structure. That would create a circular condition, which you cannot have. Think about it. You want to execute the True case if the output of the Boolean operation is true, but you cannot evaluate the Boolean operation until you have the value generated by the True case. You must have an initial value for eps in order to be able to evaluate the Boolean operation. A shift register (or feedback node) should be used for the eps value, and you can initialize the shift register (or feedback node) to set the initial condition. Example:
    It's also worth saying this: To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
    Attachments:
    Example_VI_BD.png ‏5 KB

  • Would you implement GRC for just 2500 users

    Hi
    I've tried searching but my brain hurts so I'll probably get a roasting for asking a stupid and basic question
    If you have a 4.6C system with around 2.5k users in it how would you establish the cost effectiveness of buying and implementing RAR 5.3 (AC10) initially?
    Okay, I've hidden under the desk ready for abuse!
    Cheers
    David

    David Berry wrote:
    You would start with 10 singles to sort out and, by the time you had analysed who had what in which user group there would be 30 shiny new singles bobbing up and down and eager to go to PRD.
    Exactly that is why I don't like them and why they also popup all over the place when you remediate a single role used by several composites and you don't know what the dependencies are.
    You should only split roles because of Org-Levels.
    The music (as far as authority-checks are concerned) are in the singles (with generated profiles).
    Luckily (or not when remote enabled and the user can influence input parameters) newer concepts allow you substitute the org-level with programatic validations (for example "Business Partner" assignment of the "Person" mapped to the sy-uname).
    I have 3 million users in a system with only 3 roles. How is that for a ratio?
    GRC has a great value for backend config, support, development, etc such as other ABAP based authorization object concepts and you can map services and other applications to "actions" as if they were transactions, and you can do this logical system independently.
    It is still tempting, but not really a hard requirement to be able to control the access and combinations in a limnited number of systems. It is certainly independent of the number of users!
    A good build is always better - which is what GRC RAR will ultimately tell you anyway...
    Cheers,
    Julius
    ps: The "blue boxes" are like this:
    {quote} David said that composite roles are a dog's breakfast {quote}
    Result =
    David said that composite roles are a dog's breakfast

  • How to define function within for loop pls help?????

    Hi this is the problem i have a class, and within that class there is an actionPerformed function, in this class i also create an instance of another class, this other class also contains an actionPerformed function, which wis executed if a jButton has been pressed, when I try to place this actionPerfromed function within a for loop of a function i get an error saying illegal start of experssion, and that the class should be defined abstract as it does not define actionPerformed, when i take it out of the for loop it compliles fine, i need the function to be placed within the for loop because it needs to know the variable of the for loop, is there anyway around this? Thanks, below is the code:
    public class DisplayTransitions extends JFrame implements ActionListener
    public void add()
    for(int i = 0; i < char2.size(); i ++)
    mPanel.add(tim[i] = new JButton("Time"));
    tim.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
         if (ae.getSource() == tim[i])
              timeIncr();

    This is your for loop using an anonymous inner class for the listener:
                for (int i = 0; i < char2.size(); i++) {
                    mPanel.add(tim[i] = new JButton("Time"));
                    tim.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    if (ae.getSource() == tim[i]) {
    timeIncr();
    Learn more about anonymous inner classes from a good Java book or the Java tutorial (try http://java.sun.com/docs/books/tutorial/java/javaOO/QandE/nested-answers.html).

  • How do I break a for loop (inside) and a while loop (outside) at the same time by a control button

    I have a while loop (outside) and a for loop (inside) and a control button within the for loop.  I want to stop the program by click the botton without finishing the for loop.  How can I do that?
    Thank you in advance.

    HI Please find attached snapshot Regards, Santosh
    Message Edited by SanRac on 12-17-2009 05:12 AM
    Message Edited by SanRac on 12-17-2009 05:13 AM
    Attachments:
    Snap1.png ‏4 KB

  • ? on How to Load Variable Within For Loop

    Hello,
    I'm a PL/SQL newbee so I apologize up front if this is a basic question. In summary, I'm trying to build a field name within a FOR LOOP and also load this field with it's associated data from an input record and finally load the data to the output record and pipe the row. I can successfully build the field name but don't know how to load it with data from the input record.
    Here is a sample from the code.
    The input table is shown with the 6 different Fnma codes. Instead of checking each code for data, I want to build the field name, load this field name with data from the input record and move the data to the output record.
    CURSOR cur_loan(prod_date_in IN DATE) IS
    Select
    Ln.Ln_No,
    Ln.Prod_Date,
    Ln.Ln_Fnma_Ftr1_Cd,
    Ln.Ln_Fnma_Ftr2_Cd,
    Ln.Ln_Fnma_Ftr3_Cd,
    Ln.Ln_Fnma_Ftr4_Cd,
    Ln.Ln_Fnma_Ftr5_Cd,
    Ln.Ln_Fnma_Ftr6_Cd,
    from LOAN Ln
    where PROD_DATE = '16-FEB-11';
    Here is the FOR LOOP that successfully builds the field name in l_feat_code_name. Then I "assume" by moving this field to l_output that l_output will contain the actual data, not the field name. However, it appears to contain the field name instead of the data.
    FOR l_To IN 1 .. 6
    LOOP
    l_feat_code_name := ('l_loan_rec.ln_fnma_ftr'||l_to||'_cd');
    l_output := l_feat_code_name;
    IF (l_output is not null or
    l_output <> ' ') THEN
    l_out_rec.Inv_Type := l_Fnma_Cd;
    l_out_rec.feat_code := l_output;
    l_out_rec.Src_Delete_Flag := l_src_delete_flag_n;
    PIPE ROW(l_svc_ln_rec);
    END IF;
    END LOOP;
    How can I move the data itself into the l_out_rec.feat_code output record? Thanks in advance.

    Hi,
    l_output is defined as follows:
    l_output varchar2(20) ;
    I appreciate your example.
    Again, after I build l_feat_code_name it contains the column name from the input record, Ln_Fnma_Ftr1_Cd, ....Ftr2...., .....Ftr3..... and so on up to Ftr6. However, I also need the **data value** of Ln_Fnma_Ftr1_Cd, ....Ftr2...., .....Ftr3..... and so on up to Ftr6. My question is how to get the data value. You see below when I move l_feat_code_name to l_output I'm expecting l_output to contain the **data value**. Instead, when I display it in DBMS_output, it shows the column name.
    CURSOR cur_loan(prod_date_in IN DATE) IS
    Select
    Ln.Ln_No,
    Ln.Prod_Date,
    Ln.Ln_Fnma_Ftr1_Cd,
    Ln.Ln_Fnma_Ftr2_Cd,
    Ln.Ln_Fnma_Ftr3_Cd,
    Ln.Ln_Fnma_Ftr4_Cd,
    Ln.Ln_Fnma_Ftr5_Cd,
    Ln.Ln_Fnma_Ftr6_Cd,
    from LOAN Ln
    where PROD_DATE = '16-FEB-11';
    Here is the FOR LOOP that successfully builds the field name in l_feat_code_name. Then I "assume" by moving this field to l_output that l_output will contain the actual data, not the field name. However, it appears to contain the field name instead of the data.
    FOR l_To IN 1 .. 6
    LOOP
    l_feat_code_name := ('l_loan_rec.ln_fnma_ftr'||l_to||'_cd');
    l_output := l_feat_code_name;
    IF (l_output is not null or
    l_output ' ') THEN
    l_out_rec.Inv_Type := l_Fnma_Cd;
    l_out_rec.feat_code := l_output;
    l_out_rec.Src_Delete_Flag := l_src_delete_flag_n;
    PIPE ROW(l_svc_ln_rec);
    END IF;
    END LOOP;

Maybe you are looking for

  • The TV show could not be used because the original file could not be found

    "The TV show “Blah-blah ep.23” could not be used because the original file could not be found. Would you like to locate it?" I know this problem is listed (and unanswered) from quite a few users in the forums for song files, but I haven’t found any t

  • HT201302 my computer wont autoplay when I connect iphone

    i have tried accessing the autoplay menu but it doesnt show in here either. also I have checked the drivers and it says that there is no driver present. have tried auto searching for them but it comes back and says no driver update available. have ju

  • Exporting non-looping (single frame) swf file

    I am using a third-party application to create a "page-flipping" version of a book. For quality reasons, I want to export the pages of the document as swf files. When I import the resulting swf files to the application, they flicker at the default fr

  • Spell Checking

    Is spell checking available in the Lightroom 5 Book Module?

  • What software version is needed to use icloud on imac?

    I want to use icloud to share info between my imac and the new ipad. I know I need to update my software...I currently have MacOSX 10.5.8 so I'm wondering what version I need to update to in order to use icloud on my imac. I can't update to Mountain