Resetting a counter variable

I am trying to use counter variable "count". The default for "count" is 0 when the program is opened up. I initialize ssd and sumclick to be 0. However once it goes through the formula node, the value for "count" changes to 1 and then the decision loop within the formula node that checks if "count>0" is used.
My problem is, if I stop the program and then rerun the program without closing and reopenign the program, the value for count continues to be 1, and so my intialization for ssd and sumclick dont happen. Whenever I hit the run button I want count to be 0. I dont want count to remember the 1 from the previous run. How can I do this?
The VI is below.

Hi Charles,
Thanks for answering my question. The pciture I posted is part of a large program. After I posted the question I reworked on the block diagram to create a base level example to try and figure out what was going wrong. Here is the base level example. I tried to get rid of the formula node in this. i just have a while loop and all LV operations. 
I am trying to generate a random number, take the deviation^2 of the random number from 1 and then keep adding that cumulatively to make SSD. I want my SSD to begin with 0, everytime I stop and re-run the program. VI Attached. Please look at it and tell me. Thanks for the help in advance. 
Attachments:
ssd.vi ‏8 KB

Similar Messages

  • How to reset a count variable in a conditional format trigger

    I am using a conditional format trigger to eliminate sections of a report where there is no data. The trigger is automatically generated by reports (shown below). the condition is :com_count = '0' therefore no record, no display of section - if :com_count>0 then data present and display record.
    It works fine eliminating the sections - until actual data is found - and count is set to 1 and it displays the record. The problem is that once :com_count >0, then the section displays throughout the rest of the report whether there is actually data or not.
    It seems that :com_count needs to be reset to 0, but when I try to do that, it throws an error stating that :com_count is a read only variable.
    I am new to PL/SQL so can anyone suggest how I can reset the :com_count to 0 each time the trigger fires with :com_count = 1?
    Any help would be appreciated. Thanks,
    Glenn
    The conditional format trigger is:
    function M_G_COM_RANK_GRPFRFormatTrigge return boolean is
    begin
    -- Automatically Generated from Report Builder.
    if (:COM_COUNT = '0')
    then
    return (FALSE);
    end if;
    return (TRUE);
    end;
    The count
    It works perfectly

    wher is your COM_COUNT defined?
    If should be defined in the datamodel in the "mastergroup" of the "detailgroup" of which you want to count the records.
    If you do so, there is a property of the item "Reset at" ( which is by default set to "Report") and you then can change it to the name of the mastergroup. So every time a new record is "active" in the mstergroup, the count-item will be reset to 0.
    hope this helps

  • Global Counter Variable - Graphical Mapping

    Hi there.
    Can anybody help with implementing a global counter variable in the graphical mapping please.
    I am trying to populate the "SEGMENT" field of an IDoc with the correct sequence, i.e. add 1 for each new segment. The IDoc has several segments, most of which are embedded. I have tried using the "<b>counter</b>" function but this seems to reset back to one for each instance of it being called.
    I would appreciate any pointers.
    Thank you.
    Mick.

    Hi see this for implementation
    <b>defining Global Variables</b>
    ArrayList arrVI;
    int counter =0;
    <b>Initialization Section</b>
    arrVI= new  ArrayList();
    <b>assignment</b>
    arrVI.add(sVI[iLoopCounter]);
    counter++;
    <b>
    fetch Values</b>
    for (int i =0;i<counter;i++)
    result.addValue(arrVI.get(i)+"");
    Mudit

  • Assigning a specific value to the sapscript counter variable

    Hi all,
    I am trying to use the sapscript counter variable in my sapscript but encounter the following warning.
    My code looks like the following:
    /: DEFINE &SAPSCRIPT-COUNTER_0& = 0
    The new counter value is &SAPSCRIPT-COUNTER_0(+)&
    The warning i get when i do the syntax check is:
    Ambiguous symbol &SAPSCRIPT-COUNTER_0&
    What is wrong with my syntax?
    Appreciate any help i can get.

    Hi,
         If i am not wrong you are trying to reinitializing that standard variable. if that is the case one thing, in script we cannot assign values to variable other than at initializing time but here you don't have chance to initialize that variable because that is standard one. More over modifications to standard variable will give some warnings.
    So try to use other than standard one as per your requirement.
    Hope this will help you.
    Regards,
    Aswini.

  • How do i reset a counter in crio scan interface mode

    Hai,
         I am using cRIO 9104 with NI 9421(DI SINKING) module for my counter application in scan mode.
    I have a doubt that how do i reset my counter previous value when my system is in idle mode(i.e stable mode).I tried to use a timeout in property node, But i am not able to put a timeout in my code ,herewith I have attached the printscreen of my program.You can see the timeout option is in hide mode.Any other option is there to reset a counter.Kindly solve this problem and let me know the details.
    Thanks and Regards
    Jayanthi.K
    Attachments:
    Untitled.png ‏292 KB

    You need to get a refnum for the module.  The simplest way to do this is to drag the module in the project onto your block diagram.  It will drop a refnum constant for the module.  You will find all kinds of useful properties and methods on this refnum.  In this case the refnum is of a class named "SD Module" (where "SD" stands for "Specialty Digital") and it has a method on it for resetting counters.  See the attached screenshot of the block diagram.
    Ross Houston
    Senior Software Engineer
    RIO Software R&D
    Attachments:
    reset_counter.png ‏3 KB

  • How to reset a counter on external signal in LabView?

    Hallo there!
    I am using LabView v 8.5 and the NI USB-6211 to acquire signals, among them are the following:
    1) angular pulses from a rotary encoder
    2) a reference pulse for the rotary encoder witch will give a pulse on a specific position of the movement for every rotation
    3) value from a pressure sensor
    What I am trying to do is to create a pressure/volume diagram based on the pressure and volume inside a cylinder of an IC engine. To do this, I will need the angle of the engines crankshaft to calculate the pistons position in the cylinder. This way I can calculate the volume and put it in a xy graph to represent the volume (x-axis) and the pressure(y-axis).
    I am using clk0 to count the pulses from the angular encoder, and this works great. However I now need the reference pulse to somehow reset the count at the precise time it goes high in order to precisely know the angular position.
    How can I do this? And how precise will this be? And will I need any kind of synchronization with my pressure measurements? If so, how?
    The relevant part of the program I am working on resembles the Count Digital Events with reset.vi 33 KB as found in this thread. However, I don't know how to get the reference pulse to reset as the stop button is. How can I do this?
    In addition: the fast pulses of the angular encoder = 0-> ~10kHz. I seem to lose information if I use the basic level trigger detection.vi when I put this signal on an analog port.
    -J

    Hi Nick,
    If you have an X Series or 2nd Generation cDAQ chassis (basically any cDAQ chassis except for the 9172 or 916x sleeves) then you can implement:
    1,2,3,4,5,6,7,8,9,10,(reset),1,2,3,4,5,6,7,8,9,10,(reset),1,2...
    You would have to configure an Edge Count Task, set the initial value to 232 - 6 (such that the 6th count causes the counter to rollover, which generates a pulse on the counter output), and enable the count reset using your external signal:
    The count reset isn't currently available for other DAQ devices, but I believe it should be available on M Series (62xx) and TIO (660x, 6624) with a future driver release (some time in 2012).
    If you don't have an X Series (or gen II cDAQ), don't despair.  On other hardware, you can get close to the previous behavior with a counter output task, with the exception that the "reset" signal would only be detected after the 2nd tick after your pulse is output.  Also, the reset signal would have to occur at the beginning to arm the counter the first time.
    Or, you can get the 3rd behavior that you asked for by doing a continuous counter output task with the external signal as the source of the timebase ticks.  For example:
    1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9
    In toggle mode (default):
    6 ticks of initial delay, 2 ticks high, 7 ticks low, 2 ticks high, 7 ticks low, ... etc.
    In pulse mode:
    6 ticks of initial delay, 9 ticks high, 9 ticks low, 9 ticks high, 9 ticks low, ... etc.
    See here for an overview of the difference of the two modes.  Basically, pulse mode will emit a short pulse when TC is reached, and toggle mode will toggle the state of the counter.  You can't have less than 2 ticks as a high time, low time, or initial delay.
    Best Regards,
    John Passiak

  • T-code that  resets the counts in the storage bins

    hello,
    is there any T-code that  resets the counts in the storage bins.
    As we do our weekly counts it keeps a running total of how many bin are completed and allows us to track the warehouse's progress.
    Regards
    Goutham

    Of cource, very sorry to waste your time,
    I didn't even notice LOL
    But your question is a easy question so I am sure some one will respond with a good answer for you.
    our program name is RLREOLPQ
    not sure if the program is custon or just t-code
    gl
    Edit: may be a bad sign for you, maybe no standard t-code if we had to create a custum one
    Edited by: Arakish on Apr 1, 2010 10:32 PM

  • Using a hardware trigger to reset a counter

    Hi all...I am trying to using a quadrature encoder with A,B,Z outputs on an e-series card (pci-6052e). the problem is that the card does not support the z output since it only has 2 counters. So i am trying to find a way to get around this problem. I start off using ctr 1 (to the source pin of which i connect the A signal)..to count the events which will tell me how many angles the shaft has rotated through. The only other thing i need is to use the single pulse generated on the z line to reset the count each time it turns high. From reading posts it seems like i have to stop and restart the counter task to accomplish this. So the thing i dont know how to do is to convert that pulse on the z-line to a boolean value so i can run a case loop to stop and restart the task. I can use a daq-mx start trigger to look at the pulse but how do i convert that to a boolean value to run the case loop.
    Thanks in advance, Shyam.

    Hi Shyam,
    Depending on how fast the encoder will be rotating, you can do a few things. The simplist is to just read the Z index on a digital line as you have begun doing. Using a DAQmx Read, you can detect the state of the line and if the rotation is slow enough, you can use the boolean value. Again, this is not ideal. The newer M-Series boards have a counter input for the Z index in addition to being able to do change detection on digital lines which will make this task much easier. See if this works for your needs.
    Regards,
    Kent
    Applications Engineer 
    Digital Multimeter Home

  • NI-6602 - Encoder capture - resetting the counter to 0 through software - DAQmx

    Hello. A simple one. I'm using DAQmx to set up a task to set channel 0 on an NI-6602 as an angular encoder capture port. This is working fine and I can grab the position in degrees. The simple question is - How do I reset the counter to 0 through software. I can set up ZIndex to do it but how do I either reset the counter or set it with an arbritrary number? I can see a method to set it on startup but not during capture.
    Thanks.
    Will

    If working in LabVIEW, there are DAQmx property nodes that will allow you to set the "initial count" value, but ONLY while the task is stopped.
    If you can't count on a hardware z-index reset, another software technique I've used to avoid stopping the DAQmx task.  I make a wrapper function for all my encoder task access (see the Action Engine nugget for ideas...).   Inside this "Action Engine" wrapper, I use an uninitialized shift register to store my encoder's "virtual 0".  I add a simple function to the action engine for setting the "virtual 0" to be the current encoder position value.  Every time I read from the encoder, I first subtract off the virtual zero before returning the data.  As far ast the rest of the app is concerned, the encoder data it gets is just as if I were able to make a software call to DAQmx to set the raw count to zero.
    -Kevin P.

  • BPM Counter Variable

    FILE1---> XI -->  IDOC
    I have a BPM to receive the File. Do the Transformation and then send to R/3 as requested. This scenario is working fine for me. The only problem I have is, I need to send a mail at the end of the process, saying that how many IDOCs were sent to R/3.
    I have introduced a Counter Variable(SimpleType,Integer) and counting each time an IDOC is created.
    But when I add a new step to send the Counter Variable, I dont even see that variable in the Message variable of the SEnd Step!!!
    What am I doing wrong?

    Hi Mohan,
    you cannot send variables - only messages
    (there's no way to map variable to a message in BPM)
    how can you do your scenario?
    you can do 1:2 mapping
    you can map your file to 2 kinds of messages:
    - idoc
    - message with one field(conuter)
    then map file to those 2 messages and counter has to contain the number of idocs
    then you'll be able to use it in send step:)
    BTW
    if you're not using combined IDOC have a look at my weblog:
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Need to keep track of URL and a count variable

    Can anyone suggest the best way to keep track of a URL and a count variable associated with each URL. I have started using 2 List objects. When I add a URL I also add a 1 in the count List Object. I am using List Objects because I must be able to sort them and search through them.
    Can anyone verify that I am going about this the correct way?
    Thanks

    I would probably use a TreeMap that referenced the counter.

  • Generate a event every X seconds and reseting a counter

    Hi!
    I'm quite newby in programming in Labview and I need your help.
    I've programmed a counter that is send to a MySQL database every time I click a button. Now I want to change this click event to an event ocuring every X seconds and that every time this event occurs it resets the counter. How can I do that?
    I think it's not a difficult question for someone used to programming Labview but I can't find an accurate solution.
    Thanks a lot.
    Solved!
    Go to Solution.

    Something like this?
    Jean-Marc
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp
    Attachments:
    Automatic event LV86.vi ‏26 KB

  • How to reset play count

    how to reset play count in iTunes

    Right-click the track(s) in iTunes, and choose "Reset Plays."

  • Camera Reset Frame Count

    Hi All,
    new here. Been using LR 4 on MBP 09 for about a year now, Love it!
    I'm shooting with a Fuji X100 exclusively (my only camera =). I recently updated firmware on it, and its reset frame count (up to 9500 frames). This means that the same frame number is now referring to two photos in LR. Should I start a new catalogue so I don't have conflicts? Or is there any other way to fix this problem? I checked X100 manual, I cannot choose to start from a certain frame number.
    Thanks for your help

    ...just on the question of starting from a given frame number, I have a comment and a suggestion.
    First, it is possible to have LR rename images at the time of import, assuming you are using LR to copy the images from camera card (not available if you copy the images into the computer yourself, and then use the "Add" method of import). As part of  this renaming, you can have LR include an "image counter" group of digits, which increment continually. That replaces the camera generated filename with an enforced unique numbering (some people include the capture date in the filename too - or other attributes - it can be defined to suit.
    As dj_paige says, it is not a problem to repeat a filename within a given catalog, but you may still prefer to have some unique element there.
    Next, while I don't know the X100 myself, this question of controlling camera image numbering comes up fairly often. Many cameras have two alternative modes: one where the camera keeps remembering the highest image number used, even after a card is removed; the other, where it promptly forgets about that each time ("goldfish mode").
    When a new card is inserted, cameras tend to take whatever internal counter may have been remembered from before (which will only apply if the camera is not in goldfish mode) AND take the highest number image found on the card, add 1 to whichever is higher, and use that for the next image taken. This becomes the new counter value.
    So: asssuming your camera offers these functions (they may be called different things) - you can set the camera to a given image counter value, by doing the following:
    Take a single image on a camera card. Turn off the remembering/incrementing of image number between camera cards, so that any prior counter value is forgotten. Take the camera card out, put it in a card reader and rename it to the image number that you would like to continue from. Put the card in the camera and turn on the remembering of image numbers. Take another picture: it will get an image number one higher, than the one you manually renamed. Becasue the counter is now persistent, this will continue regardless of which card is used - except if any card is ever put into the camera which has a higher value than the current counter, the counter will leapfrog that and set itself to a higher value still. To get it back down again, you would need to repeat the whole procedure above.
    Personally, I don't much care what images are physically called so far as LR is concerned - but I do prefer to have the camera image number increment continually nonetheless - which it has done ever since it was new.
    regards, RP

  • Page Counter Variable & Captivate 4

    Hello - I can't get a simple page counter variable to work that I snagged from Captain Captivate. When I click to preview, the project will not show. I’ve tried F4 and F12, it will not preview the project. When I click F3, it shows the variable text. I’ve downloaded his sample file, this will not preview either. When I delete the variable the previews work. Any ideas on how to solve this problem or is there another option for creating a simple page counter?
    Thanks!!

    Hello,
    You are talking about a slide number? There is a system variable cpInfoCurrentSlide that gives you that number. To have it on all the slides:
    insert a Text Caption on the first slide, in which you insert this system variable, you can add other text as well
    change the timing of this Text caption to 'for rest of project'
    preview: you will have the slide number on each slide.
    If you want to know more about variables, I posted something for starters. The link is in this blog post:
    Curious about variables in Captivate (4 & 5)?
    And if you want to know more, can recommend a Goober guide by the moderator of this CP-forum, Captiv8r:
    Variables and advanced actions
    Lilybiri

Maybe you are looking for

  • Can't install Extension manager 6.0.4 under Mac OS 10.8.2 ?

    Hello, So I'm french. And I can't install Extension Manager under Mac OS 10.8.2 ? Donc , je ne peux installer Extension Manager sous Mac OS 10.8.2 ? The error code is Echec de l'installation. Code d'erreur : U44M1P7 Merci pour toute aide. Thank you f

  • How to Create Dynamic form using table data

    Dear All, I have one Table called PRODUCT_MASTER where product details are stored. Say product A,B,C,D are stored in the table. Another table called SUB_PRODUCT_MASTER, which contains sub product details.Say A1,A1,B1,B2, B3,C1, C2, C3, D1,D2,D3. Now,

  • HTTP Post Action Block

    Greetings all, I am using a HTTP Post Action in BLS - Vs 11.5.  The objective is to return a HTTP string from a jsp page, so I can scrap the page.  The URL:  http://mospublic.ercot.com/ercot/jsp/balancing_services_mcp.jsp?marketdate=2008-06-16   (obv

  • N95-1 Isit me or has create muvee gone from latest...

    N95-1 Isit me or has create muvee gone from latest firmware? I cant find it now ive updated my firmware and I made some good lil demos .. OR do I now use those free apps you can get at nokia.co.uk? still was much better being able to produce custom v

  • Standard Views

    Hi, I want to ask one little question, I am using standard views, it is not appearing the data into TOAD. Then I have used the following code after that data is being appeared. BEGIN fnd_client_info.set_org_context ('101'); mo_global.set_policy_conte