simple counter between 1-11

Hey guys,.

I just need a quick review on meter simple app. The main idea is that when the user clicks the button (+) the meter is incremented + 1 and when the user clicks the button (-) it decrements. In any case the value should be between 1-11 and should be in sequence, which means 1-2-3-4...-11 or conversely oder 11-10-9...-2-1... so I came up with this solution that I join you, but I want to know if there is a much simpler way to do this.

Best regards


Tags: NI Software

Similar Questions

  • Simple counter

    Hi team or,.

    I am trying to program a simple counter, see Appendix vi. Every time the temperature higher than 55 c she should count + 1 if it goes below of-18 + 1 cold cycle. Not sure why the structure of the event, never reached into the tank.
    Can someone help me pls.

    Thank you
    Martin

    DEGBM24 wrote: don't know why the structure of the event, never reached into the tank.

    This is because the value change event is not raised by you write to the Terminal.

    1. you don't need a case of timeout.

    2. you should have a value of Stop change event to stop your loop

    3. you should have a change in the value of your temperature control event

    4. you really should be using shift registers to keep your account of cycle instead of local variables

    5 look at the Boolean value through PtByPt VI.

  • by the way the variable counter between the loops

    I have a question about the passage of a variable counter between different events / while loops and seen an increase in value regardless of the loop is initiated.

    The fundamental problem is that I write file names unique to data collected on a spectrometer, and I would value at the end of the name of the file to increment every time that I collect the data. There are several different ways that I can collect the data, and I'd like the counter to increment when the collections is triggered. The attachment shows essentially what I'm trying to accomplish. Represent it buttons collect two different types of data I collect my instrument, but the counter variable is not passed correctly between the two loops. Is it possible that I can get the incrementing counter so that the two loops read the same value of counter?

    Thanks for your help.

    MICAH

    I can't look at your code since I'm on a phone. But you should really only have / need a structure of the event in a vi. The only exception I can think of is one to manage the events of the user and the other for GUI events. But even in this case there is no reason that I can think to need two.

  • count between two dates.

    Dear friends
    I want to search count between two dates.
    my query is like below.
    SELECT (to_date('19-mar-2012','dd-mm-yyyy')-to_date('01-apr-2012','dd-mm-yyyy')) DOUBLE

    It is as given to-13, but I want in positive mod as not only 13 '-' Sign.

    Simply use the function abs() to your query to get the positive value

    SELECT abs(to_date('19-mar-2012','dd-mm-yyyy')-to_date('01-apr-2012','dd-mm-yyyy')) diff FROM dual
    
  • Simple counter/dashboard (AS3)

    I need this for a simple iPhone app...
    I tried to create a dashboard for my iPhone with Flash CS5 in the Air for the iOS mode. I have add the timer and the timer of 24 seconds, but now I need help so much.
    Problems:
    1. when the timer reaches 0 mins, it only displays: 59, not 00:59
    2. I tried to add a button to the meter of the points, but it seems very complicated in AS3 (not in AS2 :/). I created a TLF read only text named "HomeScore. But it is a nonnumeric string, so I can't add a simple counter.
    4. I need help with the reset (timer and 24 seconds) and Start/Stop buttons (for the timer and 24).
    My code:

    import flash.events.MouseEvent; (true) Seconds.text = "06:00" var timer:Timer = new Timer(1000,360); timer.addEventListener(TimerEvent.TIMER, countdown); timer.start(); function countdown(event:TimerEvent) {     var totalSecondsLeft:Number = 360 - timer.currentCount;     Seconds.text = timeFormat(totalSecondsLeft); } function timeFormat(seconds:int):String {     var minutes:int;     var sMinutes:String;     var sSeconds:String;     if (seconds > 59)     {         minutes = Math.floor(seconds / 60);         sMinutes = String(minutes);         sSeconds = String(seconds % 60);     }     else     {         sMinutes = "";         sSeconds = String(seconds);     }     if (sSeconds.length == 1)     {         sSeconds = "0" + sSeconds;     }     if (sMinutes.length == 1)     {         sMinutes = "0" + sMinutes;     }     return sMinutes + ":" + sSeconds;     if (seconds/60 <= 0  && sSeconds != 0) { return "00" + ":" + sSeconds;}     if (sMinutes = 0 && sSeconds = 0) { return "00:00"} } Possesso.text = "24" var timer2:Timer = new Timer(1000,24); timer2.addEventListener(TimerEvent.TIMER, countdownpossesso); timer2.start(); function countdownpossesso(event:TimerEvent) {     var totalSecondsLeft:Number = 24 - timer2.currentCount;     Possesso.text = timeFormatpossesso(totalSecondsLeft); } function timeFormatpossesso(seconds:int):String {         var sPossesso:String;     if (seconds > 59)     {                 sPossesso = String(seconds % 60);     }     else     {                 sPossesso = String(seconds);     }         if (sPossesso.length == 1)     {         sPossesso = "0" + sPossesso;     }         return sPossesso; } import flash.events.*; HomeScore.text = "02" HomeScore.text = ScoreFormatHome(ScoreHome); var ScoreHome:Number     function ScoreFormatHome(ScoreHome:Number) {     var ScoreHome=1     if (ScoreHome <=9 ) {return "0" + ScoreHome}     if (ScoreHome >=10) {return ScoreHome}     } ButtonplusHome.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler); function fl_MouseOverHandler(HomeAdd:MouseEvent):void {     ScoreHome++; }

    you have too many questions for a single thread, unless you're already pretty savvy:

    1. when the timer reaches 0 mins, it only displays: 59, not 00:59

    use a string formatter function.
    2. I tried to add a button to the meter of the points, but it seems very complicated in AS3 (not in AS2 :/). I created a TLF read only text named "HomeScore. But it is a nonnumeric string, so I can't add a simple counter.

    You can convert strings to numbers using Number().
    4. I need help with the reset (timer & 24 seconds) and Start/Stop buttons (for timer and 24).

    the timer class has you use reset(), start() and stop() methods.  Follow with the start() method reset() method if you want to reset and start.

  • How to make a loop simple counter in labview 7.1?

    I'm trying to teach me how to use labview 7.1, but having trouble finding how to use functions properly. I am trying to create a simple loop to count from 1 to 10 with a delay of 1 second between each number. I would be grateful the help!

    Classes resumed?

    The key words are 'loop' (try a loop FOR the palettte of structures), 'delay' (try a wait (ms) of the range of timing). Use a constant instead of diagram for the "1 second" (or 1000 ms). and use a digital display to show the current number (for example by using an indicator connected to a terminal of the loop iteration FOR). Given that [i] starts from 0, first use a primitive of + 1. Wire a constant at the end of the loop to determine the number of iterations. You should be able to determine the correct value, math or by trial and error.

    Now try to gather all, shouldn't be too difficult. Where have you problems? Have you looked at the examples? Did you do tutorials?

    Once you have a project, post it here and we can propose possible improvements.

  • Simple counter in seconds

    Hello

    In my code, I have a while loop which may or may not take more than x seconds to run. Once the while loop has worked for x seconds I would to provide a series of commands. Therefore, I need a kind of counter. Number of cycles will help me with that? If so, how? If this is not the case, how can I create a counter for this simple task? Thank you.

    Alfredo

    Yes, the number of cycles can be used for this, and other mechanisms. For example, you can use the time to get the seconds. Here are some simple examples:

  • Need a Simple comparison between Analyzer vs capacity see

    Does anyone have a simple list of a page that compares the difference in capabilities between the Analyzer vs journalist licenses/roles?

    Hi Kurt,.

    Here are the main differences between the journalist and the parser - with a Reporter User, you can:

    • Do a simple formatting for charts/graphics.
    • ALTER existing report but may not fundamentally change the displayed data.
    • Cannot filter data that already exists in the report.
    • All changes can be saved for the user to journalist see and not shared with others in their organization.

    Whereas, with a monitor you can:

    • Advanced formatting to charts/graphs.
    • Create a report or dashboard of the Eloqua data model.
    • Filter (slice and dice) on all the data available in the data model.
    • Save new or modified for anyone in their organization to see reports.

    I hope this helps.

    VIC

  • Simple counting the stopwatch will not stop.

    Hello

    I made a simple countdown timer, it works fine but I wish I had the sign next to the number % so it would look like a pre-order. But as I add the '%' sign to the function, the counting stops (100% more) ever and continues to count.

    What Miss me?

    var count: Number = 1;
    var myTimer:Timer = new Timer (10);

    myTimer.addEventListener (TimerEvent.TIMER, count);
    myTimer.start ();

    function countdown(event:TimerEvent):void {}

    myText_txt.text = String ((count) + myTimer.currentCount);

    myText_txt.text = String ((count) + myTimer.currentCount)+'%';


    If (uint (myText_txt.text) > = 100) {}
    myTimer.removeEventListener (TimerEvent.TIMER, count);
    }


    }

    Thank you!

    You should learn to use the trace() function to see why things don't work as expected.   The '%' is converting it to a uint not what you expect.  Trace uint (myText_txt.text) and you'll see why comparing the value of a string uint digital a number isn't going to work.  Try instead the following...

    var count: Number = 1;
    var myTimer:Timer = new Timer (10);

    myTimer.addEventListener (TimerEvent.TIMER, count);

    myTimer.start ();

    function countdown(event:TimerEvent):void {}

    myText_txt.text = String ((count) + myTimer.currentCount) + '% ';

    If (uint (String (+ myTimer.currentCount (County))) > = 100) {}
    myTimer.removeEventListener (TimerEvent.TIMER, count);
    }

    }

  • Using the mouse click simple counter

    Purpose to make a mouse click counter. (a simple button clicker/tally, which keeps the number of clicks a user sets).

    1. Progress-
      1. Done button
      2. variable passed to the completed text field.
      3. correct variable pass script to the incomplete text field.
    2. Problem-

    1 counter variable remains at 1 and does not increase by 1 when the button is clicked.

      Link to .fla

      script

      var myVar = 0;

      button_1.addEventListener (MouseEvent.CLICK, fl_ClickToPosition);

      var fl_TF:TextField;

      var fl_TextToDisplay:String = myVar;

      function fl_ClickToPosition(event:MouseEvent):void

      {

      fl_TF = new TextField();

      fl_TF.autoSize = TextFieldAutoSize.LEFT;

      fl_TF.background = true;

      fl_TF.border = true;

      fl_TF.x = 100;

      fl_TF.y = 100;

      fl_TF.text = fl_TextToDisplay;

      addChild (fl_TF);

      myVar ++;

      }

      any help is greatly appreciated.

      Thank you

      Try:

      var myVar = 0;

      button_1.addEventListener (MouseEvent.CLICK, fl_ClickToPosition);

      var fl_TF:TextField;
      fl_TF = new TextField();
      fl_TF. AutoSize = TextFieldAutoSize.LEFT;
      fl_TF. Background = true;
      fl_TF. Border = true;
      fl_TF.x = 100;
      fl_TF.y = 100;
      fl_TF. Text = String (myVar);
      addChild (fl_TF);

      function fl_ClickToPosition(event:MouseEvent):void
      {
      myVar ++;
      fl_TF. Text = String (myVar);
      }

    1. Build a simple counter

      Hi, I'm just getting started in LABView and I am a very slow learner. I have build a counter to count my gamepad operations as it is cycling on a tester of life. I put him in place to count the individual directional activations, but I join to have it count total cycles. I'm writing up to the VI I did so far. How can I do that after that he been rolled once in each direction (up, left, down, right), there is a cycle? Thank in advance for any help.

      -Pascale

      I think the only problem is that it's a loop so fast (10mS) at the point where the counter increments he already counted the next event.  You can add additional logic to prevent the inside while loop to stop until the direction of the joystick Returns Boolean 0.  The idea is that stop only once all 4 have been activated AND 4 are no longer in an active state.  I used the function NOT to make it more obvious that the logic was, you have also the output of arithmetic consisting be reversed but this watch only upward like a small point on the line of the value.

      Like the other post, I don't have a way to test this, but I think my logic was scientifically.

      Edit1: The post above beat me to it, and his suggestion would work just as well as mine, we just thought it differently.

      Edit2: I noticed in one of your posts above you mentioned that you want to count only when it has been activated in a certain order.  This VI does not work like that, it would take a more complicated logic to do.  I see two ways that could be made, but don't have the time to get out to see which would be best.  Good luck and have fun.

    2. Question on simple counting in oracle code

      have two tables table1 and table2

      Table 1A 5000 documents, table2 has 10000
      There is a column called num_id (number)
      in white table1
      There is a column in table2 num_id (number) with a number of seq data in table2 and the last num_id = 10000

      just take the max (num_id) table2 and begin the process of table1 with 10001, 10002, 10003, etc..

      Thank you
      Doug

      Hi Doug,.
      Suppose you want to use the sequence.nextval to update the table 1 then all you need is...

      declare

      vn_max_seq table2.num_id%type;
      vn_counter table2.num_id%type;

      Start

      Select max (num_id) in the vn_counter from table2;

    3. UNIQUE between Simple mode and open authentication possible OAM?

      Hello

      Our SSO OAM in 'Open' mode (WP, PM, AM, AAA and ID).

      I would like to configure an applications in SIMPLE mode between the access server and webgate. But still I'd like to preserve, single sign - on, when the user accesses the protected open OAM application.

      Is this possible? Thank you.

      Yes, possible. The transport application component security mode has no impact on the end user SSO.

      Technically, the mix of modes (simple and open) is not supported. If you have installed some AAA servers more in simple mode you can connect your webgate to those simple ones more and not the other (open mode) to avoid this problem.

      If you need to share the existing AAA servers you will need to bring the listening in BOTH modes. This used to work even if I have not tried with recent versions. The technique is to (re) configure the AAA servers in Simple mode and then pass the parameter mode back to open the profile of component in the directory (via the admin UI).

      Mark

    4. Counting of string separated by commas in the cells of a column

      Hi all

      Try to pass some of my Excel spreadsheets in numbers. I'd appreciate help with a specific string of text/number in the cells in a column. In the example below (no sheet of complete works) is a column, the packs work (WP01, WP02 and so forth)-which means work packs a particular Test & Validation document (e.g. TV-102) applies to.

      I would like to be able to simple counting the number of occurrences, say "WP05", is applicable. If I use COUNTIF, on the "WorkPack" column, he has only the cells that contain only the string "WP05" (i.e. in the sheet, I work with, I know there are 22 entries for "WP05" in the column of pack work, but only the 14 account)

      Note: I am building this on my MAC, but would like to be able to access and use these sheets on my iPad - don't know if that makes a difference.

      Any suggestions / ideas?

      Thank you in advance...

      ATB Perry

      ID

      Paper group

      WorkPack

      TV-91

      Validation of NFR

      WP05 WP06

      TV-102

      Certificate of conformity

      WP05 WP06

      TV-103

      Validation of NFR

      WP05 WP06

      TV-206

      Test EN

      WP05

      TV-207

      Test EN

      WP05

      TV-208

      Test EN

      WP05

      TV-209

      Test EN

      WP05

      TV-212

      Certificate of conformity

      WP01, WP02 WP03, WP04, WP05, WP06, WP07, WP08 MICROSOFT WINDOWS CURRENTVERSION, WP09, WP10, WP11, WP12, WP13, WP14, WP.15

      TV-213

      Validation of NFR

      WP01, WP02 WP03, WP04, WP05, WP06, WP07, WP08 MICROSOFT WINDOWS CURRENTVERSION, WP09, WP10, WP11, WP12, WP13, WP14, WP.15

      TV-214

      Test EN

      WP01, WP02 WP03, WP04, WP05, WP06, WP07, WP08 MICROSOFT WINDOWS CURRENTVERSION, WP09, WP10, WP11, WP12, WP13, WP14, WP.15

      TV-215

      Validation of NFR

      WP01, WP02 WP03, WP04, WP05, WP06, WP07, WP08 MICROSOFT WINDOWS CURRENTVERSION, WP09, WP10

      TV-308

      Validation of NFR

      WP01, WP02 WP03, WP04, WP05, WP06, WP07, WP08 MICROSOFT WINDOWS CURRENTVERSION, WP09, WP10, WP11, WP12, WP13, WP14, WP.15

      TV-338

      Test EN

      WP05

      Here's how I would approach (without more):

      Add additional columns to your table (those titled "WP01',"WP02", etc.).  Enter the names as shown

      The first line is a heading row.

      Also... Add an extra line at the end and make a footer row

      D2 = (LEN ($C2) −LEN (REPLACE ($C2, D$ 1, ""))) ÷LEN ($1 D)

      It's shorthand dethrone select cell D2 and type e (or copy and paste it here) the formula:

      = (LEN ($C2) −LEN (REPLACE ($C2, D$ 1, ""))) ÷LEN ($1 D)

      Select cell D2, copy

      Select cells D2 the bottom of column R, paste

      in the footer row (row 15 of this example) iff the following formula:

      D15 = Sum (D)

      Select the cell D15, copy

      Select the cells D15 thru R15, dough

      I could never find 22 WP05 instances (even when I search your message on this web page):

    5. How to read a counter value for the separation of the two edge before meter is stopped by the second edge (6602 Council)?

      I use a timer/counter with DAQmx 6602. I use the separation of two - available via DAQmx cash edge. Count between the two edges works properly, however I do not know how to read the value of the counter during the counting operation (i.e. after the first edge triggered the beginning of the count, but before the second edge triggered the end of the counting). I'll have to wait for the second goes off the edge of the end of the countdown until I can get a counter value. I need to be able to access the current value of the County during the count operation. This was possible in traditional DAQ. How can it be accomplished using DAQmx?

      Ah shoot - I was afraid that this might be the case (for what it's worth, my series of X returned intermediate values, but the material and the underlying driver are quite different)...

      You just need to take one measure at a time or you are buffer several measures of separation of the two edges at the same time?  So just to take one measure at a time, you can set a task of edges of count using the database internal time as the source using an arm start trigger (first edge) and a sample of clock (second Board) to work around the problem.

      Best regards

    Maybe you are looking for