A counter to increment each time a button is pressed

Can't seem to find a suitable vi within LabView and would appreciate if someone could point me in the right direction.

Dennis_Knutson wrote:
First, you should start a new thread instead of posting to one that is 9 years old. 
I guess we need to be patient. The first attempt at getting help was posted as a comment to his photo ...
Obviously, that code picture does not really show the entire problem but we can tell that the value is not wired across in all event cases. Also, the while loop can never complete, so the boolean indicator never receives any data. This thing seems buggier than a formicarium and trying to eliminate the "shift" (Whatever that means!) is barking up the wrong three.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Add point to scatter plot each time a button is pressed

    Hi folks,
    Apologies if this has been answered elsewhere, I am new to LabVIEW and trying to get an experiment up-and-running quickly!
    I was wondering if anybody would have general pointers or code examples on how to create a 2D scatter plot, to which a data point is added each time a button is pressed.
    I am measuring a gauge pressure and a force (from a load cell). I would like the scatter plot to add another data point each time I press a button, so that a history of my datapoints is shown. It would also be quite nice is this plot could then be exported as a .jpg using another button, but this is not critical. 
    A seperate button would also be available to clear the scatter plot.
    My current thinking is that this can be done by 'adding to an array', - presumably the chart would refresh each time an element was added to the array, but I am struggling a little bit with how to do this.
    If anybody has any suggestions, I would be very grateful for them.
    Many thanks,
    Euan

    Hi Euan,
    If you want to have your data shown in real time (and I'm assuming you do) then you'll need to use a Waveform Chart. The chart is able to update itself each time a value is written to it.
    The event structure is your friend here: you can write a case to update the chart each time a button is pressed. You can also create cases for the other situations you mentioned (clear chart, export jpg etc.)
    If you don't care about the chart updating in real time then you can use your idea of updating an array and then use a Waveform Graph to plot the datapoints at the end of your program.
    Take a look at the LabVIEW Basics course and the Examples for info on how to implement the event structure. If you run into any problems just post your VI and we'll see if we can't help you fix them.
    -CC
    "If anyone needs me, I'll be in the Angry Dome!"

  • Randomize sound effect played each time a button is pressed?

    I have 8 sound effects. all of them are in my assets blah blah, how can I tell it to choose a random effect from those 8 evry time the button is pressed?

     [Embed(source="sound0.mp3")]
     public var soundClass0:Class;
     [Embed(source="sound1.mp3")]
     public var soundClass1:Class;
     [Embed(source="sound2.mp3")]
     public var soundClass2:Class;
     [Embed(source="sound3.mp3")]
     public var soundClass3:Class;
     [Embed(source="sound4.mp3")]
     public var soundClass4:Class;
     [Embed(source="sound5.mp3")]
     public var soundClass5:Class;
     [Embed(source="sound6.mp3")]
     public var soundClass6:Class;
     [Embed(source="sound7.mp3")]
     public var soundClass7:Class;
     private var sound0 = new soundClass0() as Sound;
     private var sound1 = new soundClass0() as Sound;
     private var sound2 = new soundClass0() as Sound;
     private var sound3 = new soundClass0() as Sound;
     private var sound4 = new soundClass0() as Sound;
     private var sound5 = new soundClass0() as Sound;
     private var sound6 = new soundClass0() as Sound;
     private var sound7 = new soundClass0() as Sound;
    private var soundsVector:Vector.[sound0, sound1, sound2, sound3, sound4, sound5, sound6, sound7];
    whentever you need to play a sound:
    var randomIndex:int = Math.ceil(Math.random() * (soundsVector.length - 1));
    //if sounds0 does not really play you can extend the randomizing process 
    var ramdomSoundToPlay:Sound = soundsVector[randomIndex];
    ramdomSoundToPlay.play();
    C

  • Incremental Counter in SSRS each time report is run

    Hi
    I need to have a header row in my SSRS report which is an incremental number e.g. each time the report is run the number increments by 1.  Something similar to a hit counter on a website.
    Is it possible to have an internal variable within SSRS which will increment by 1 each time the report is run?
    It seems straight forward, but from reading other articles online, it appears not to be.
    Can anyone advise?

    The most i think you could do is query the ExecutionLog3 view and count the number of times the report has executed successfully.  The problem is this log is only kept for 60 days default.  I am sure if you wanted to you could adjust the period
    of time in which the log is kept (keep in mind it is system wide) or you could pull the data out that you need incrementally and store it.  Here is some information on the view.
    http://technet.microsoft.com/en-us/library/ms159110.aspx
    I think the biggest challenge you will face on this one is political should you go down this path.  Good Luck!

  • How do you count the amount of times a button is clicked?

    Heres my code:
    public void buttonClicked(JButton buttonzilla){
    if(buttonzilla == startButton){
    while(i < 7){
    story.append("\n" + "\n" + abc);
    i++;
    However, when i click the button once, it displays all elements in the array, however, im trying to get it so that each time i click the button another element is displayed, one at a time. How would i go about doing this?

    Can you explain the code because it dosent make sense
    to me, im a beginner.In the code you posted, there is no declaration for the variable i, so I've assumed it is declared as a class variable, and has scope within the class.
    You say you want to add only the data from the element of abc[], relative to the number of times the button has been clicked i.e. 1st click adds abc[0], 2nd click adds abc[1] etc.
    if(i < abc.length)  - to ensure no ArrayIndexOutOfBoundsException (really should also check i is not negative)
    story.append("\n" + "\n" + abc[i++]);
    instead of
    story.append("\n" + "\n" + abc);
    i++;

  • How to get a loop run for 1 instance every time a button is pressed

    I need to get a loop run only once everytime a button is pressed.
    Please help me.

    Read the help built into LabVIEW
    Here's online version of the help: http://zone.ni.com/reference/en-XX/help/371361L-01/glang/event_structure/
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do I get a link or shortcut to open in a new window each time?

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [/questions/776534]</blockquote><br>
    How do I get a link or shortcut to open in a new window each time?

    You can press and hold the Shift key while left-clicking a link to open a link in a new window.
    See also Tab Mix Plus: https://addons.mozilla.org/firefox/addon/1122

  • I would like a movie clip to play repeat itself everytime a button is pressed

    Hello,
    I am new to actionscripting but not Flash, I am using Flash
    MX 2004 for a college project at the moment. I have created an
    interface which features four buttons, each button activates a
    different movie clip. This works fine but only on the first time to
    press the button if you press the button again the movie clip does
    not play again, I would like the movie clip to play EVERY time the
    button is pressed. Here is the script that I have created in a
    seperate layer called actions, if that helps:
    ellaimage._visible = false
    Betaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    boxmovie._visible = false
    Betabox._visible = false
    textboxmc._visible = false
    Yakuzabox1._visible = false
    Pornobox1._visible = false
    pellabutton.onRelease = function () {
    stop ();
    Betaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Betabox._visible = false
    Pornobox1._visible = false
    Yakuzabox1._visible = false
    boxmovie._visible = true
    textboxmc._visible = true
    Pellaimage._visible = true;
    Pellaimage.gotoAndplay(1)}
    Betabutton.onRelease = function () {
    stop ();
    Pellaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Yakuzabox1._visible = false
    Pornobox1._visible = false
    Betaimage._visible = true
    Betabox._visible = true
    boxmovie._visible = true
    Betaimage.gotoAndplay (1) }
    Yakuzabutton.onRelease = function () {
    stop ();
    Pellaimage._visible = false
    Betaimage._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Pornobox1._visible = false
    Betabox._visible = false
    Yakuzabox1._visible = true
    boxmovie._visible = true
    Yakuzapic._visible = true
    Yakuzapic.gotoAndplay (1) }
    Pornobutton.onRelease = function () {
    stop ();
    Pellaimage._visible = false
    Yakuzapic._visible = false
    Betaimage._visible = false
    textboxmc._visible = false
    Betabox._visible = false
    Pornobox1._visible = true
    Yakuzabox1._visible = false
    Pornopic._visible = true
    boxmovie._visible = true
    Pornopic.gotoAndplay (1) }
    // this command stops the timeline
    stop ();
    Any help would be great.
    Thanks in advance

    No that doesn't work, that isn't what I want to to be
    repeated.
    In the below script I want textboxmc (which is a movie clip)
    to restart and play again everytime pellabutton is released.
    pellabutton.onRelease = function () {
    stop ();
    Betaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Betabox._visible = false
    Pornobox1._visible = false
    Yakuzabox1._visible = false
    boxmovie._visible = true
    textboxmc._visible = true
    Pellaimage._visible = true;
    Pellaimage.gotoAndplay(1)}
    Please can anyone help?

  • IPod Touch turns off when lock button is pressed.

    My father accidentally put my dog's cage on top of my iPod Touch...surprisingly it was fine. Or so I thought. A few minutes later the volume started acting strange, which I think was a problem with the button. Somehow I fixed that after playing around with it. But when I pressed the lock button, the iPod turned off, and wouldn't turn back on, as if it had no battery life whatsoever. When I got home, I plugged it in, and thankfully it responded. I thought it was fine, until I tried to press the lock button again. It completely dies every time the button is pressed. Which I suppose is alright, as long as I never press that button again but that's rather annoying. Any ideas on what to do with that?

    Sounds like you have a internal connection problem in the iPod. I would make an appointment at the Genius Bar of a local Apple store.

  • Purchased a new Apple TV and the remote double clicks each time I press the button. It worked fine during set up and for the first two days.  I have since moved it and this problem started. Restarted,reset,unplugged,change remotes, no change.Help please.

    Purchased a new Apple TV and the remote double clicks each time I press the button. It worked fine during set up and for the first two days.  I have since moved it and this problem started. Restarted,reset,unplugged,changed remotes, no change. Latest software update. This is really annoying.  iPhone remote app works just fine.  Any suggestions?

    That's one of the weird things.. it recognizes it maybe 10% of the time. And usually, only after I do the two-button reset. Problem is.. since it won't charge above 2%, anytime I try to do a restore or anything like that using iTunes, my device shuts off and I lose whatever progress I'd made.
    So, an update... after reading through a bunch of similar complaints (there are literally 1000's of them so there's NO WAY this isn't somehow ios7 related, thanks a lot APPLE ) I decided to try a restore in recovery mode. After 3 hours and several disconnections... I ended up having to just set it up as a new iPad, as the restore did nothing. Weirdly though... as I was doing the restore in recovery mode.. I noticed I'd gotten up to a 10% charge.. higher than it's been since September, so after setting it up as a new device, I turned it off and plugged it in using the wall charger. 2 hours later and I was up to 38%. Still not great, as my iPad, before ios7 could've fully charged twice in the amount of time it took for me to now get 28% more of a charge. And that's with a fully cleaned out device.. so that really ***** and I'm now more confused than ever.
    But I'm gonna leave it overnight charging and see what I come up with tomorrow. Sadly, when I paid $600 for it in February, I never expected to have to play "wait and see" with it...

  • 10.6.8 update won't install gets half way through then just freezes spinning beach ball for 4 hours any ideas y. Tried and restarted 3 times already does the same thing each time have to hold down the power button to restart

    10.6.8 update won't install gets half way through then just freezes spinning beach ball for 4 hours any ideas y. Tried and restarted 3 times already does the same thing each time have to hold down the power button to restart. Anyone can help

    Ok will check, as of right now I have 82.57gb free, that's plenty of space will check the disk though using disk utility. Also I am now downloading the update from the apple website instead of going through software update

  • TS1367 Hi, I am trying to install 'Playonmac' so I can install Meta Trader 4 - however, each time I reach the next button in order to install XQuartz it hits a deadend there - the 'Installing Quartz' window is saying installing Quartz,but thats as far as

    Hi,
    I am trying to install 'Playonmac' so I can install Meta Trader 4 - however each time I reach the next button in order to install XQuartz it hits a dead end
    - the 'Installing Quartz' window is saying installing Quartz, but all it does from there is the clock the spins around, just keeps spinning and nothing happens - I have waited and waited for it, but it just kind of freezes there.  I have reloaded the software over and over, and even switched off the firewall in case it was blocking Playonmac.  It is really important I load Meta Trader 4 on my Mac.
    Help will be much appreciated - Has anyone had this sort of problem?  Does anyone know how to resolve it? 
    Regards
    Joe

    According to wiki "the documentation from Apple states that Windows XP Service Pack 2 or Windows Vista is requisite for a Boot Camp installation, and it also mentions that trying to install an unsupported operating system could prevent the computer from booting even into Mac OS X". Sure that was from wiki, but it does seem to support and somewhat validate the problem I had with installing an earlier edition of XP.
    http://en.wikipedia.org/wiki/BootCamp_%28software%29#Other_operatingsystems
    Thanks for the info on the Filesystem info. My problem is that installing OS X on a mac is just a little bit more technical than installing Windows on a PC as there are a few more things to consider. Plus I'm not familiar with any of the utility programs as well. It's a **** miracle I managed to somehow create a volume to install OS X on when I thought I was erasing the partition I created for WinXP.
    But I'm still not sure about the missing 40GB from my 500GB HDD. Upon coming to the desktop straight after OS X was fully re-installed I noticed that the HDD only had 460GB and that 440GB of it available space. So the full installation of OS X was 20GB, but where has the other 40GB gone? I swear I saw that I had much more available space on my harddrive (BEFORE I tried to partition my HDD under Boot Camp Assistant and stuffing up the computer). Is the missing 40GB from the ORIGINAL FACTORY INSTALL of OS X INCLUDING all my iTunes music and other files I uploaded to the computer earlier? It would make sense but there's no way, as far as I know, of checking this. Any ideas?
    Cheers.

  • Is it possible to duplicate a button, instead of building a new one each time (navigation)

    In CS5...
    I have created a movieclip button which is animated  for all the states I need (up, over, out, etc.) it's made up of text, which is in a movie clip where I have my animations created (actions layer with AS3 script, my txt movieclip layer, my hit layer) and then that is inside a movie clip in my main scene.
    Is it possible to copy that button, so then change the text, Actionscript, instance name, etc?
    I tried copying the layer (by selecting the frames and copying frames, and pasting to new layer) but when I make any changes, it changes both copies!
    Can someone tell me an easy workflow so I don't have to build each button from the ground up each time?
    Thanks all!

    Ned Murphy wrote:
    Select the textfield that is inside the movieclip and in the properties panel you should see a dropdown for selecting the type of textfield.  If you select Dynamic and then assign an instance name to the textfield you can use that instance name in your code to assign the text when the file runs.  If you were to name the textfield "tField", then the code you would use inside an instance of your movieclip named "mClip1" would be...
    mClip1.tField.text = "your text";
    So, if I have multiple buttons, using your example, would the code read
    mClip1.tField.text = "your text";
    mClip1.tField2.text = "your text2";
    mClip1.tField3.text = "your text3";
    mClip1.tField4.text = "your text4";
    And my buttons are built inside movieclips, ie
    Main Timeline > aboutButton_mc > aboutText_mc > "about"
                        > contactsButton_mc > contactsText_mc > "contacts"
    can the code be put at any level, or does it need to reside on the Main Timeline to access all the movie clips' text fields?
    Just in case this may be too complex to get into via this forum, if you know of any good tutorials, that would be awesome too!
    I tried doing a search, but it's so hard to tell if they might be in AS2, or AS3, and if they would apply to newer versions of Adobe Flash (I have CS5)

  • Why are my custom groups and buttons at QAT deleted each time I restart Outlook?

    I created 3 template emails in my Outlook 2010 and added them to a group under Home Tab and also tried adding them to the QAT. In both cases, each time I reset Outlook, my customized templates are gone from the ribbon.

    Hi,
    How did you add the template emails to a group under Home tab?
    Did you have any group policy set in your environment to restore your Outlook settings after each reboot?
    Please come back and provide more information so that we can fix the problem more efficiently.
    Meanwhile, please refer to the two links below to check if it helps:
    How to Open Outlook Templates and Files using Toolbar Buttons
    http://www.slipstick.com/outlook/hyperlink-templates/
    How to add shortcuts to template in Ribbon in Outlook?
    http://www.extendoffice.com/documents/outlook/1324-outlook-add-template-shortcut.html
    Best Regards,
    Steve Fan
    TechNet Community Support

  • Why has my back button disappeared, I have to exit each time I want a previous screen.

    Why has my back button disappeared, I have to exit each time I want a previous screen

    I noticed you have ''Freeze (dot) com Net Assistant'' installed. This is considered by most security software to be malware since it changes your user preferences and feeds you ads. See http://www.mywot.com/en/scorecard/www.freeze.com
    Also, this Wikipedia article contains some info about it: http://en.wikipedia.org/wiki/W3i#History
    You should be able to remove it by going to Add-ons, then Extensions. If it's not there, then the free edition of Malwarebytes from http://www.malwarebytes.org/products/malwarebytes_free should be able to get rid of it for you.
    There are some screenshots of how you probably got it on your system here: http://www.emsisoft.com/en/malware/?Adware.Win32.Freeze.com+Toolbar
    (no need to purchase the software to remove it because as mentioned already, Malwarebytes should be able to get rid of it for you).

Maybe you are looking for

  • XML file to RFC

    Hi, i have scenario (XML file to RFC), it's by BPM, I can see XML content by file sender adapter but can't get detail field data into my data type of interface. what's wrong, please advise! Thanks! my data type as follows,     EXPORT Complex type    

  • Oracle 10g Install Question

    Hi All, I have to install oracle 10g onto a server where there is existing oracle 9i software. Is it safe to go ahead with the install, while the 9i databases are up?? what are the consequences of doing this? OS patches and kernel parameters as requi

  • Number Search using Oracle Text

    Hi, I'm new to Oracle Text. I want to implement search for the unique ids. Like google search when the user start typing 123 it need to brings anything starting with 123 and has show like entries how google will shows. When I add number 4 to like 123

  • Need advice if i should upgrade my legally unlocked iphone 3G

    Hi, I recently traveled to livigno (in the alps of Italy)and i stumbled across an unlocked iPhone 3G at an electronics store (not an apple store just a regular electronics store). the guy told me that it was legally unlocked and that i could make sof

  • Adobe Camera Raw has a bigger picture ratio than the original Canon CR2?

    This one is processed by the Adobe Camera Raw: this is the JPG processed by the Canon camera: When I view the CR2 files in Canon software, it shows the same as the 2nd JPG posted above. However, when CR2 files were in Adobe Camera Raw, all the photos