Making a counter with enable and reset

Hi.  
First of all, I looked online for this solultion and no success.
What I am trying to do is have a counter with enable and reset.  
1.  Increment from 0 to 5 everytime true boolean is received.  Q, the output should then be 1
2.  If boolean false is received, Q should be 0
3.  Once the count reaches 5, reset the counter to 0 and repeat.
4.  Step 1-3 only happens when enable is true.  Anytime enable is false, the process is stopped.
Please help!
Rose

This is something called an Action Engine, closely related to "Functional Global Variables" (FGV) or "VI Globals" (VIG).  Basically, you have a While Loop with one or more Shift Registers acting as "memory" and an "Action" input (typically a Boolean or an Enum) that says what the Action should be.
As you posed your problem, I'm unsure if you require one Boolean (Enable/Disable) or two (Enable/Disable and "Count").  This is a situation where having an Enum input and more "Actions" might be appropriate.  For example:
Load      Save the Max Count (5 in your example) in a Shift Register
Reset    Set the internal Count to 0
Enable   Allow Count Action to proceed
Disable  Don't allow Count Action to proceed
Count    Increment counter if "enabled", and output current count
Each time you call this VI (did I say that this should be written as a sub-VI, with inputs Action and Max Count, and output Current Count?), depending on the Action you wire in, you will either perform "setup" actions (Load, Reset, Enable, Disable) or "Counting" actions (Count).  Note that it is easy to modify it so that if the Counter is disabled (ooh, that's a good name for this sub-VI, "Counter", has a mnemonic ring to it), the output is, say, -1, "Not a Count", instead of (as I described it above) the last Count while Enabled.
Action Engines (and similar constructs, where there's a While loop with "True" wired to the Stop terminal, useful as a "memory" unit) are pretty common in LabVIEW.  More accomplished LabVIEW users might also accomplish this with a Feedback loop, but I find that the "Do Once" loop shown above is easier for me to recognize and understand.
Bob (hard to teach an old dog new tricks) Schor

Similar Messages

  • Help me! I have a new iPad mini that won't turn on. It was working fine this morning then i turn it off and it never turns back on. it doesnt register with iTunes and resetting isnt working either.

    Help me! I have a new iPad mini that won't turn on. It was working fine this morning then i turn it off and it never turns back on. it doesnt register with iTunes and resetting isnt working either. All I did is download instagram and snapchat and poof doesnt work. I have had these apps before!

    Make sure it's plugged into the charger.
    Frozen or unresponsive iPad
    Resolve these most common issues:
        •    Display remains black or blank
        •    Touch screen not responding
        •    Application unexpectedly closes or freezes
    http://www.apple.com/support/ipad/assistant/ipad/
    iPad Frozen, not responding, how to fix
    http://appletoolbox.com/2012/07/ipad-frozen-not-responding-how-to-fix/
    iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
    http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
    Black or Blank Screen on iPad or iPhone
    http://appletoolbox.com/2012/10/black-or-blank-screen-on-ipad-or-iphone/
    What to Do When Your iPad Won't Turn On
    http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Home button not working or unresponsive, fix
    http://appletoolbox.com/2013/04/home-button-not-working-or-unresponsive-fix/
    Fixing an iPad Home Button
    http://tinyurl.com/om6rd6u
    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
     Cheers, Tom

  • I am making an album with Snapfish and would like to download ome of my photos from iphoto to snapfish, is this possible?

    I am making an album with Snapfish and would like to download some of my photos from iphoto to Snapfish, is this possible?

    You mean "upload"?
    There are many, many ways to access your files in iPhoto:   You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    There's a similar option in Outlook and many, many other apps.  If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    If you want to access the files with iPhoto not running:
    For users of 10.6 and later:  You can download a free Services component from MacOSXAutomation  which will give you access to the iPhoto Library from your Services Menu.
    Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and 10.5 Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    Drag and Drop: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    File -> Export: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    Show File:  a. On iPhoto 09 and earlier:  Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.    3.b.
    b: On iPhoto 11 and later: Select one of the affected photos in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder window will pop open with the file already selected.

  • Need help with deleting and resetting admin user

    I have a problem with the admin user on my computer. Here's the background: My computer started making popping noises. I found that the popping stopped when I switched to a different user account. I have repaired permissions and reset the PRAM, but this did not fix the problem.
    Can I fix this user problem by deleting some or all preference files, or by some other means?
    Or...how do I set up a new admin that has all my old settings and files from my original admin? I have never done this before and am very nervous. I have charged ahead to fix things before and then discovered that I erased important files! so I am going to be patient (sort of) this time.
    I have a backup of the drive that my user data is on, as well as a clone of it for booting.
    Any suggestions on ways to make this less painful are appreciated.
    Nathan

    Nathan:
    Here is what I suggest:
    1. Create an admin account that will be strictly an admin account. i.e. you won't be using it for anything else but to administer your computer. Here's how:
    Go to the Apple Menu, System Preferences, and open up the Accounts panel. Click the to add an account, and check the box to let that user "Administer this computer." You are temporarily creating a second admin account. Be sure you give it a good password and that you remember it! Now, log out. Don't just do a fast user switch. Log out completely, then log into the new admin account you just created. Go back to System Preferences, Accounts, and find your original user. Uncheck the box for that account that allows it to administer the computer. You've now changed your regular account into a Standard account and you've created a new admin account that you'll hardly ever use. That's the point: only use the admin account when you absolutely need to.
    Log out of the new Admin Account and into your former Admin Account, now Standard account. Check your access to the folders in your account. If you get notes telling you that you do not have sufficient privileges that can be corrected.
    Post back and let me know.
    Good luck
    cornelius

  • Making a PDF with "Outline" and Bookmarks Using Pages

    Hi, I'm using Pages 1 and I have tried making a PDF with outline breaks but I failed. I thought using paragraph styles for my document would work but when I exported my document to PDF, all I got was a PDF that only has the thumbnails view but not the outline view. Also, when I exported my document that has bookmarks to PDF, all the bookmarks don't work anymore. How can I make a PDF document using Pages with all the bookmarks and the organization just like other PDFs that I encounter? Thanks

    Hello LadyinStilettos,
    welcome to the Pages Discussions. If I remember correct, in Pages 1.x there is no way to export text links to PDF. An outline view creation doesn't exist.
    If you want to have links in PDF (of the TOC, too), then you should upgrade to iWork'06. But outline view doesn't exist here like it doesn't in version 1.x.

  • Making custom icons with transparency, and Cover View mode

    I tried making a new icon for a folder, and transparency doesn't seem to be treated the same in Leopard as it was in Tiger.
    Trying to get an object to float onscreen, without a square white background, I tried pasting the following onto the folder's icon at the top of a Get Info window:
    1. one layer of a .psd file
    2. the image Saved For Web in Photoshop (as a GIF), open in Photoshop
    3. the same image saved as a .png, opened in Photoshop
    4. a Photoshop EPS with a clipping path, opened in Photoshop
    5. the GIF file opened in Preview
    6. the .png file opened in Preview
    the results:
    1. the transparency surrounding the object comes out as white
    2. a speckled, purple image with a white background
    3. the same as 2
    4. the same as 1
    5 and 6: the transparency seems to work: the icon on the
    Get Info window loses its white background and the icon floats correctly on the Desktop. But in Cover Flow viewing mode, it completely disappears.
    What am I missing? By the way, the icons for the image files, in Cover Flow, show the white background for the .psd and .png files, but not for the .gif, where the transparency shows correctly. The .gif's icon seems to show the image with a white background in List and Icon view, but only the generic GIF icon in Column view. This all seems strange to me.

    I think you probably discovered the Cover Flow Bug. See this thread and the older one referenced in it as well:
    http://discussions.apple.com/thread.jspa?messageID=6846850
    As for the rest, well, at least you can copy something with a transparency out of Preview and paste it as an icon. Preview and Photoshop seem to me to not play well together with transparencies. I've gotten some VERY strange looking things, going back and forth between them with pngs and tiffs. Don't use gifs, or eps files, but I did notice that Finder does a rotten job coping with Photoshop's alpha channel (especially weird since once upon a time it worked fine, ditto for being able to show thumbs for eps files).
    Francine
    Francine
    Schwieder

  • Using one counter with FiniteSamps and another with ContSamps

    I am trying to use 2 counters on the USB-6229 (or USB-6259), where one counter is set up for FiniteSamps and another for ContSamps. I have the following MeasurementStudio code:
    ErrChk DAQmxCreateCOPulseChanTicks(hCnt0, "Dev1/ctr0", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
    ErrChk DAQmxCfgImplicitTiming(hCnt0, DAQmx_Val_FiniteSamps, 100);
    ErrChk DAQmxStartTask(hCnt0);
    ErrChk DAQmxCreateCOPulseChanTicks(hCnt1, "Dev1/ctr1", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
    ErrChk DAQmxCfgImplicitTiming(hCnt1, DAQmx_Val_ContSamps, 2);
    ErrChk DAQmxStartTask(hCnt1);
    When I run it, I get a run-error 50103 "The specified resource is reserved". If I change the FiniteSamps to ContSamps on the first counter, everything works fine.
    If I use only one counter with FiniteSamps, everything also works fine.
    Is this a bug in DAQmx or the dual counter use on M-series devices is limited to ContSamps?
    Vic
    Solved!
    Go to Solution.

    Hi Vic,
    This is actually expected on an M Series device.  Here's a timing diagram from the M Series User Manual that might make this a bit more clear:
    The device actually uses one counter to gate the other so the result is a finite pulse generation.  If you can provide the gate from another source, you may configure a continuous pulse generation on both counters and gate them (DAQmx calls this a "Pause Trigger") from this external signal. 
    You might also want to look into using Correlated Digital I/O to generate multiple finite pulses (up to 32 lines on your 6229 and 6259).  You could use one of the counters to generate a timebase for the digital lines, and build the waveform accordingly.
    One thing to note is that our new X Series boards can generate a finite pulse generation on a "single" counter (there is actually a paired internal counter that allows for this).  There are four user-accessible counters on X Series devices, meaning you could generate four finite pulse trains.
    Best Regards,
    John
    John Passiak

  • Making a DVD with HD and SD assets

    How can I make a SD DVD with HD and SD assets and retain the highest quality on the HD material? I have tried mixing the short vidoes on an SD timeline in Final Cut Pro, then rendering out the HD and export using Best Quality 90 min DVD settings in Compressor. I then import that file into a DVDSP project, and then chapter out that track and make stories to create separate play buttons for each video and a Play All button as well. The quality of the HD material seems worse than that of the SD material. Any advice is much appreciated. Thanks. Robin.

    Do you know how to best compress HD for optimal play on standard DVD players?
    If I am just dealing with HD material, I will send out the timeline as a self-contained .mov in ProRes (I like self-contained, saves some time on re-encoding) then use Compressor to make a SD m2v. You can start with the preset but then go in and change the frame controls to “Better” and also change the encoding rate if there is room to increase the rate.
    Calculating rates [information here|http://dvdstepbystep.com/faqs_7.php]
    Can get very good results from HD material delivered as SD format.
    When mixing things, it becomes more challenging. Depending on the material (is most of the material HD or SD in original format, can they be edited separately or do they need to go from one to the other to make the movie, etc.) I may try various approaches. If the majority of the footage is HD, I may just go with an HD timeline (though the SD material will not look as good.)
    When you say the quality of the HD material is worse, what is worse? Given all things being equal, camera quality (in other words you are not using an extremely high end SD camera and a $300 consumer HD cam, one is really good lighting with little movement, while the other is high speed race cars in streelights at night) the HD footage shouldn't look worse than the SD material...

  • Any "3rd" party program for making DVD's with movies and stills....???

    I think I have read every post on this or other sites about maximizing burned DVD quality after using imovie. At the end of the day I can only say this. I used proshowgold on my PC and the DVD's that were burned had MUCH better quality pictures and video. The DVD when shown on a TV was much more vivid. I did not have to lace/deinterlace/h.264/mv2/upscale/drag.. etc.etc.... you get the point. I love the mac but I want to make a movie with stills and music, hit "burn" or move to iDVD and have a decent DVD to give to friends.
    I looked at FCE but that didn't seem to be the answer for movies and stills.. ?? Anything else out there...???
    Any help other than "your doing it wrong" is appreciated....

    As Shawn said they keep on changing things around
    In an older version it looked like this [link to image|http://dvdstepbystep.com/toast.jpg]
    Click on New disc on the bottom, name the disc and drag the AUDIO_TS and VIDEO_TS File in
    You can also [use this|http://www.kenstone.net/fcphomepage/image_to_diskstone.html] to make a .img from iDVD and DVD SP then burn to disc....

  • Problem with SAVE and RESET button in WAD

    Hi all,
    We have two queries embedded in save template and we have created two different save and reset buttons for each query. But if i execute save or reset for one query it is working for both the queries. Can i restrict the SAVE and RESET button for a particular query.

    Hi Tilak,
         It appears that though there are two reset buttons, the HTML code for the webtemplete is not arranged to restrict the reset function of the button for each dataprovider used. This may cause the reset function to act globally on all dataproviders . In the XHTML code, please pass a unique instruction to each reset function, such that each instruction corresponds to a unique dataprovider.
    Thanks,
    Nithin Reddy

  • Question:Channel Sync with PBX and Reset Channel on Gateway

    Hello.
    There are several gateways(c2851 with 12.3(11)T8, ISDN E1 PRI Card) in our voip network.
    the first,
    I tried to make busy some specific channel to block user's call setup.
    I usually use "isdn b-channel x" under int serial 1/0:15.
    But, this time, PBX(NEAX) technician told me, he can't see the busy channel, made by gateway, in his PBX system.
    So I think, Both of them can't sync E1 channel.
    Thus, eventhough the gateway made busy some specific channel, PBX can't recognized the busy status of the channel made by gateway.
    Let me know, how can I check to resolove the problem?
    the second,
    Sometime, Between Gateway and PBX have problem, but i don't know why.
    To resolove the problem, I tried to reset channel using "isdn busy b_channel x" under int se 1/0:15.
    after that reuse usingn "no isdn busy b_channel x" under int se 1/0:15."
    But , i think, this way, using busy channel, is not reset status, just only making busy and then making idle.
    When i shutdown and then no shutdown under voice-port, the all channel become initial status.
    But all calls disconnect.
    Please let me know, how can i make initial status some specific channel, not using shut, no shut under voice-port, but gain same effect..
    Reagard,
    John

    For the first question, instead on 'isdn busy', you can make use of 'isdn service' command. It takes an individual B channel or an entire PRI interface out of service or sets it to a different channel service state that is passed in to the switch.

  • After making a website with muse and launching it with Business Catalyst. My website gives a notice: To change this page, upload your website into the public_html directory. How can i upload my website into the public_html directory?

    Hello,
    I'm using a Mac and made a website with Muse. After making the website i published the site and launched this afterwards with Business Catalyst.
    When i enter my website, i got the notification: To change this page, upload your website into the public_html directory.
    Does anyone know how i can fix this? I'm a complete noob in this subject.
    Thank u for reading

    Could you post a link please?
    BC does not give that message - Would be good to see if it is indeed BC.

  • Frequency counter with start and stop - Need help

    When No load, 200VA Unity , 400VA Unity, 600VA Unity, 400VA LAG, 400VA LEAD or Short is active Frequency Counter starts.
    When OFF and BENCH PWR is active Frequency Counter stops and is grayed out.
    Frequency Counter is grayed out when BENCH PWR is inactive
    Any one know ho to do this?
    Attachments:
    Buttons.vi ‏77 KB

    In order to enable or disable a control you need to write a U8 value to the Disabled property of the property node for that control.
    The values are:
    0 = Enabled
    1 = Disabled
    2 = Disabled and Grayed Out
    Kelly Bersch
    Certified LabVIEW Developer
    Kudos are always welcome

  • Making a movie with slides and clips

    Hi. I would like to create a project that will incorporate slide shows sections with video clips. Has anyone done this, and if so, is there any advice you can give before I start so I can avoid snags? For example, I know that iMovie has limitations on the number of slides in a slideshow. Will I still run into this problem if I am splitting sections of slides? I would like the finished project to be about a half hour long. Will playback quality on a DVD be consistent switching between video and slides? Are there any settings I should be aware of before I start?
    I am using iMovie 4 on an iMac G5 running 10.4.2 with 1GB Ram
    Thank you for your help.
    Haley

    Hi Haley.
    I have done photos and video on iMovie with only one slight problem.
    I don't know what you mean by saying the number of pictures is limited - you can have as many as you want.
    To begin with , don't use iPhoto. Just import your photos straight into iMovie. There you can adjust the duration of each slide to whatever you want, add the Ken Burns effect where necessary and put any type of transition between them.
    Although the original photos will be much better quality than DV, when they go into iMovie they will of course end up with DV quality which is perfectly OK. The video should blend in well with the stills.
    Now for the one slight problem. A video image is interlaced and sometimes certain types of photos will exhibit a slight shimmer or vibration. This will NOT appear on your computer monitor but will on a normal TV screen. So it is a good idea to play the video through to a TV before you burn a DVD etc. to see whether it is OK.
    How can you eliminate the flicker? More expensive programs like Final Cut have de-interlace or flicker removal filters which actually blur the image very slightly. iMovie hasn't, so you have to put up with this slight problem. You may find it quite acceptable on any pictures it affects. If you don't you could possibly experiment with the Sharpness filter to very slightly soften the image.
    Just go ahead with your project. I don't think you will find any serious problems and if by any chance you do, you can always ask for help in these forums.
    Good luck.
    Ian.
    PS When you come to burn a DVD it is best to do a test one on an RW type, then if it is not right you have not wasted a DVD.

  • Making file desin with elements and attributes implementation

    hello
    this is an FILE to IDOC
    I have an xml file that need to be enter to the XI. the XML has attributes and elements.
    I would like to know how can I make an element with some attributes and below there should be a subelement.
    for example, in delivery there will be all the attributes, and I would like to make it an array so there will be below subelemnt in the name of carrier for example.
    (if any one has other ways to implement this file feel free to suggest.)
    - <delivery number="1234567890" shipment-type="Y014" shipping-point="1910" ifm-reference="125" status="final">
    - <!-- status initial, change or final
      -->
      <carrier>123456</carrier>
    - <!--  This will be the SAP vendor code
      -->
      <scheduled-departure>200810011000</scheduled-departure>
    - <!--  Precalculated departure date and time format YYYYMMDDHH24MI
      -->
      <scheduled-arrival>200810031600</scheduled-arrival>
    - <!--  Precalculated delivery date and time
      -->
      <actual-departure>200810011015</actual-departure>
    - <!--  Actual departure reported by carrier
      -->
      <actual-arrival>200810031545</actual-arrival>
    - <!--  Actual arrival reported by carrier
      -->
      </delivery>

    >>that what I thought, but after I do the attributes for the element, I dont have the option to write for the element sub-element.
    I guess the current row that is selected would be an attribute thus the option insert subelement is disabled. Always select the element and insert either attribute or subelement to it.
    Thanks
    SaNv...

Maybe you are looking for