Timers and switch case

Question very Simple.

I want to use a business structure that alternates between two different results based on a timer that expires.  For example:

5 sec-> true case

5 sec case-> false

Repeat steps.

I will write data to the file so any method that would cause the VI to sleep for the duration of 5 seconds wouldn't be ideal.

Any ideas?

I guess you can be interested in this kind of logic. It is sufficient to pull in your vi and run it.

Good luck.

Tags: NI Software

Similar Questions

  • How to track down where a specific enum is used in a switch case statement?

    Hi all

    I have an application of simulation of machine quite complex state that I add a 'mode' feature for. Some States in the application, rather than the blocks by default of running code, a VI a VI class for each mode will be instead (for example for modes A and B, initialization status has now Initialization_modeA and Inilitalization_modeB). This results in many cases structures everywhere, and I can't figure out how to ensure that, when adding a new mode, I have add the case of this mode of each switch case. Is it as simple as having a default case with a pop-up box? Or is it possible OOP I can handle this?

    Go right on what you told us, you could have each mode inherited from a common ancestor that defines a set of common States (or methods in this case). Whenever you want to add a new method, you can create a new class and override simply each method with this specific class has to do. Instead of having a State of init for each mode, you only then a common State of init, which would then distribute the code correct init based on what class you are using.

  • Brother MFC-7420. Usually, it works on Windows 7, it will not print and I have to unload the coil and switch off the printer before Relighting.

    I use a Brother MFC-7420. Usually, it works under Windows 7, but from time to time (maybe 1 in 20 times) he will not print and I have to unload the coil and switch off the printer before Relighting. It is not always the case, but it is enough times to be a nuisance.

    Ideas, people?

    Hello

    This problem occurs when you make changes to the computer?

    Method 1: Diagnose and automatically fix problems printing and printer

    http://support.Microsoft.com/mats/printing_problems/

    Method 2: Refer to this link: I can not print from my computer via the USB port.

     
     

    If you have problems, I haveinstall updated printer drivers, see this link:
    http://www.brother-USA.com/downloads/default.aspx?PgId=5&R3ModelID=MFC7420

    Refer to this: update the drivers for hardware that does not work properly.

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    See also: printer in Windows problems
    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

    I hope this helps!

  • Are there other ways to make more than 1 kaycode instead of doing one thing to switch-case

    OK, naked with me, because my English is not so good. And I'm still not a professional have

    I did a dance game. A game that objects will fly up to the target and you must press the right keys for them. I know this is kind of the issue on several keypress thing. But I tried to search on them. I still can't understand. And... because I'm almost done my project, but the abovemultiple-keys -How-to-do- it, I might have to recreate everything, start from 0.

    I made a function to put on screen the CSM and managed by a class.

    Then, I made a function to detect if the target hit to the right position and you press the right keys.

    Also, if you press the wrong score will be decressed.

    I "did not only a fuction detect keys and tell what to do.

    So my question is "Is there other ways to make more than 1 kaycode instead of doing one thing to switch-case, for example?"

    It is a part of my code.

    var p1:Number=37;// 37Left(Left)
    ///
    
    function makeLvl(e:Event):void
    {
              if (sTime < sTempo)
              {
                   
                        sTime++;
              }
              else
              {
            
                        sTime = 0;
                        if (SelectedLvl[sArrow] != 0)
                        {
                                  var currentArrow:MovieClip;//this will hold the current arrow
                                  if (SelectedLvl[sArrow] == 1)
                                  {
                                            //place a left arrow onto the stage
                                            currentArrow = new A1();
                                            //set the _x value of the arrow so that it is in the
                                            //right place to touch the receptor
                                            currentArrow.x = 120;
                                            //set the arrow's y coordinate off of the stage
                                            //so that the user can't see it when it appears
                                            currentArrow.y = 400;
                                            currentArrow.arrowCode = p1 ;
                                            addChild(currentArrow);//add it to stage
                                  }
    ////
    
    
    
    touchL = false;
    
    ////
    
    for (var i:int = 0; i<numChildren; i++)
              {
                        var target:Object = getChildAt(i);
                        if (target.arrowCode != null && target.hitTestObject(mcReceptor))
                        {//if the object is an arrow and the receptor is touching it
                                  if (target.arrowCode == p1)
                                  {//if left arrow
                                            touchL = true;
                                  }
    mcTxt.txtScore.text = 'Score:  ' + score;
              mcTxt.txtCombo.text = 'Combo:  ' + combo;
              mcTxt.txtScoreString.text = scoreString;
    }
    ////
    stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeys);
    function checkKeys(e:KeyboardEvent):void
    {
              //if the left key is down and no left arrows are touching the receptor
              if (e.keyCode == p1 && ! touchL)
              {
                        changeHealth(-10);//make the health go down
                        combo = 0;
                        scoreString = 'Bad';
              }
    beginCode();
    ////
    
    
    
    

    I try to put a table and display the number to fit it in, but no luck.

    Maybe I used the wrong table?

    Any ideas? Any suggestions? -Please...

    Thank you so much.

    This may be more advanced than what you're ready for, but it is a way to do

    http://blog.Iconara.NET/2008/03/30/separating-event-handling-from-event-filtering/

    I actually did this with a 'chain of responsibility', where each link has a reminder of determineResponsibility and the handleResponsibility callback. If it does not have responsibility (because she is not responsible), it sends the request on the following link in the chain, which manages or does not work. If you are not familiar with a reminder, it is a variable of type function so that you can change what the function is called repeatedly.

    To clarify, you must provide the first link in the chain, a reference to the event, then call something like a method process() with a reference to the event. This would call determineResponsibility(), which would look at the event to see if the features of the event are what you want. If it returns true, it would be called handleResponsibility(). If it returns false, you would call process() on the following link. The advantage of this design is that you can add and delete links to manage the changing needs of your system. For example, if the character hits something that disables the good movement until the user presses the arrow to the left, remove the link to the right arrow until the user presses the left arrow, then turn on again.

    Post edited by: Amy Blankenship

  • Builder and switch problem?

    / * Okay guys .my problem is there are a 3 cases of first and second case I get entries and in the third and fourth cases I need to call a method that is in another class .this method does some calculations that must both user values enter in first case and 2 e case

    My problem is how I'm going to call my constructor in third case.if I say (it's not logic so) investmentM = new investments (principal, interestRate); I usually calculate correctly.well I found a way of my method to calculate the result correctly but at that moment, when I turn back on the menu at this time, he reset the values and mess up everything.if I get all values in a case its ok but I need to get them from case 1 and case 2.
    in case 3 and case 4 I just did up to these manufacturer it may give you an idea what my problem is.i stuck there.do you guys have an idea of what could be the solution?

    Thank you.
    */
    switch(choice)
              {
    case 1:
                   double principal=1.0;
                   double interestRate=0.1;
                   Investment investmentM;
                   
                   
              System.out.print("Please enter the starting balance : ");
              principal=sr.nextDouble();
              System.out.print("Please enter the interest rate : ");
              interestRate=sr.nextDouble();
              System.out.print("\n");
              
              investmentM.setPrincipal(principal);
              investmentM.setInterestRate(interestRate);
              investmentM=new Investment(principal,interestRate);
               
                    
              
              
              
              break;
              case 2:
                   int    numberOfYears=1;
                   int    numberOfTimes=1;
              
                   System.out.print("Please enter the number of years : ");
                   numberOfYears=sr.nextInt();
                   System.out.print("Please enter the number of times : ");
                   numberOfTimes=sr.nextInt();
                   
                   Investment investmentA;
    
                   investmentA=new Investment(numberOfYears,numberOfTimes);
                   investmentA.setNumberOfYears(numberOfYears);
                   investmentA.setNumberOfTimes(numberOfTimes); 
                   
              
              case 3:
                   
                   Investment fi=new Investment(principal,interestRate,numberOfYears,numberOfTimes);
                   
                   investmentA.getFutureValueMontly();
    menu();
    break;
    case 4:
                   Investment f=new Investment(principal,interestRate,numberOfYears,numberOfTimes);
                   
                   fi.getFutureValueAnnual();
    
                   
              break;
    }

    878144 wrote:
    My problem is how I'm going to call my constructor in third case.if I say (it's not logic so) investmentM = new investments (principal, interestRate); I usually calculate correctly.well I found a way of my method to calculate the result correctly but at that moment, when I turn back on the menu at this time, he reset the values and mess up everything.if I get all values in a case its ok but I need to get them from case 1 and case 2.
    .. do you guys have any idea of what could be the solution?

    Yes: Do not use a switch statement to control this. It is clearly a sequential process, so force the user to enter the values first, and then ask them what they want to do with them.

    I would also break this process in steps to methods, but this has more to do with style.

    Winston

  • right click on google for, open a new tab and switch to it immediately

    When I select a Word and choose in google for right click, firefox opens a new tab and switch to it immediately. I don't want firefox to go immediately to the tab I maybe other words to highlight and click on google search for it.

    so, how do you not move immediately to the tabs in firefox open the right click on google for? also as a note in my options on the tab firefox immediately switch to tab is disabled and I use the latest version.

    You can set the Boolean pref browser.search.context.loadInBackground true on the topic: config page.

  • can I have both versions installed and switch between the two

    Can I have two different versions of firefox are installed and switch between them? If so, how do I set up.

    Yes, I have several versions of firefox are installed. Firefox 3.6 is always taken in charge and course, there is the beta, the Aurora and the roads every night. I'm guessing that the other default channels install in clean places out there rather than overwrite your current installation, if not choose the custom installation option.

    This is something advanced, generally used by developers etc.

    CARE do not uninstall and take an option to remove personal settings, but that is written, as that attempts to remove all the profile data for all versions Firefox installed, you will lose the passwords and bookmarks etc..

    Use unique profiles - where Firefox stores your bookmarks, passwords and other user data for each version, or you will have problems.

  • switch case as C

    Hi all

    Is it possible to use the loop as a switch case in C. Suppose that one of my numbers to generate processes, like 1, 2, 3 4 all n, so if it generates 2 I want to perform the task mentioned in the event 3, so 2 then he must perform the tasks mentioned in the event 2. Please help me in this issue

    Here

  • How to switch on and Switch Off LED using lab view

    How to switch on and Switch Off LED using lab view, I need to Switch on and off material LED, not the soft LED.

    I need to know the different ways to Switch On and Off the LED

    Hello

    I need to control the LED on my laptop which is to have labview, kindly tell the different ways that my laptop a serial port, is possible to control using that.

  • After a microsoft error message, my laptop keyboard has sudenly has started to misbehave - characters are two-way and in case added places after the original character. Clues?

    After a microsoft error message, my laptop keyboard has sudenly has started to misbehave - characters are two-way and in case added places after the original character. Clues?

    Care to be more detailed?  What version of Windows?  What is the brand and model of the laptop?  How old was he?  Have you contacted the provider support?  What has changed on your PC between when it was last and now?

  • Problem with the event and the case of Structure

    Hi all,

    I get the problem in my program, I'm using the two structure one is the same and other structure box.

    In the structure of the case, I had the button as an entry to the SPL and the case structure as the output of the structure of the case.

    And in the same, then I had the two text box (num control A and B) in that I had put the event changes its value. Then, even I put the value has

    num or num B control control control this corrosponding num value will save seeing num C. Now the problem is when I click on

    the theLEB button does not blink until or if you don't put the value of one of the corrosponding num control.i didn't post my file in version 8.5 and 8.6 Please find tha.

    Hello

    It should work like that or I misunderstood what you want to do.

    If Boolean is true, boolean 2 is true, at the same time, you can change the value of A so C or B then C.

    See attachment

  • difference between hubs and switches

    What is the difference between hubs & switches?

    Hello and welcome to the forums!

    There is a subject existing publication from years back. Please click the link below.

    FAQ of hubs and switches

    You can also try to search for similar topics by typing the keyword in the search field above the page.

  • Need router and switches for simple network tips...

    I have to get a new router and switch to an office with 9 computers, 1 printer, and a server.  They are all Mac computers. Two Mac computers are running Windows XP through Parrallels (not sure if it matters).  All computers have just need access to the Internet (through the router), access to the printer and 5 of them on the server.  A few more important details: the router will be located about a quarter of a mile away (where we could get a broadband Internet access) but will have a fiber optic cable running to the office, where will be the selector. In the building off site where the router, we would like to have a backup disk to send important files at the end of each day (or set up to do this automatically later).  The optical fiber has capacity of the card.  We want that the router must be connected only (wireless).  Any suggestion that router and switch combo would be enough?  Thank you!

    You can use a RVS4400 router that has a gigabit capacity with 4 ports, connected to the gigabit switch.

  • Profile of user runs as an administrator for the daily work and this account is corrupt and switch every time on a portable temporary file is opened (created)

    User profile runs as an administrator for the daily work and this account is corrupted and switch every time on my laptop, just open a temp file (created), I downloaded a driver to run my cell phone as a modem while he is on vacation. and the problem started after downloading this software,

    Hi johnnyroque

    Thanks for posting on Microsoft Answers.

    Try to use the following steps to enable the built-in Administrator account and further, then the steps and links to fix a corrupted profile.

    Please start on the mode of the Windows recovery environment (WINRE).

    -To start the computer into WinRE mode, insert the Vista CD in the CD tray, restart the computer.
    -When you are prompted to "press any key to boot from the CD-ROM..." Press ENTER.
    -Select the language by default, click Next.
    -Select "repair your computer".
    http://www.Flickr.com/photos/freeed/363935713/in/set-72157594490796701/
    -Select command prompt, and then type the following commands:

    NET user administrator / Active: Yes
    NET user {user account name} {new user password}

    Note: Please enter the user name and the password without the braces of the flower.

    -Restart the computer normally.

    //////////////////////////////////////////////////////////////////////////////

    To fix a see corrupted profile link below:
    http://windowshelp.Microsoft.com/Windows/en-us/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    Please post back and let us know if it helped to solve the problem - thanks Ken
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Order of port re-auth authentication and switch / stop of the session

    Hi all

    We are implementing an ISE (1,4) and met regarded questions on the agenda of the authentication and a stop of the session after posture in line. We got mab, dot1x as authentication order (priority of authentication is set to dot1x, mab). We have configured a reauthentication in the ports of the switch. Windows uses begging all-connect NAM (see 4.2) to dot1x and posture. During the re-authentication, either all-connecting NAM or switch does not start an eapol start and switch allows the session to the MAB, where - as when seen dot1x and mab authentication switch order generates eapol start. The switches are 3750 (15.0 (2) SE8).

    Any possibility we could force the switch/NAM agent sent an eapol start during re-auth?

    Regarding the posture, posture once conform for an endpoint (after dot1x authentication passes) following a judgment of the ISE manual session for an endpoint, switch creates a new session in ISE changes and switch the State of the unknown port to posture. Posture ise AC client still shows status of complaint of posture in the endpoint. It seems do not know about the stop of the session. During NAM endpoint agent session performs a re-auth component however posture remains unchanged "in line".

    Does anyone have experience this problem?.

    Thanks in advance.

    Concerning

    GA

    Hi Gaj-

    I had the similar problem in the past and for setting the following attribute:

    Termination-action-AVPair attribute modifier = 1

    Give that a go and let us know if you still have any questions.

    Thank you for evaluating useful messages!

Maybe you are looking for