Trying to create a latching push button using digital inputs

Hi everyone,
I'm writing a program to control a motor with 3 push buttons, Up, Down and Stop. I want the Up button to latch when pushed and delatch when Stop or Down are pushed. I've tried the Resettable Latch.vi example program from this website but no luck. It seems like the output  from the AND gate is indeterminate. I've attached my program, Any help would be great! Thanks
Solved!
Go to Solution.
Attachments:
LatchAttempt.vi ‏140 KB

Use Index Array to get the single boolean you want from the array.  If you don't wire an index it will give you element 0.  Using this you could have all the switches wired to different pins of the same register on your DAQ device.  Then you could read one byte and sort out which bit does what.  You also need to build the individuale booleans into an array before writing to the DAQ.  Here's a quick example:
You need to decide which button sets which bit.  I haven't checked the logic of your latch algorithm yet.
Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome

Similar Messages

  • Push button using abap objects

    Hi experts,
    can u paste any sample code for creating and handling push button on a screen using ABAP objects.
    thanks in advance.
    santhosh

    Hi Santhosh,
       Check the following code.
    * create a custom area on the screen
    DATA : gref_ver_toolbar      TYPE REF TO cl_gui_toolbar,
           gref_custom_container TYPE REF TO cl_gui_custom_container.
    * initializing toolbar
    * Creating toolbar container............................................
      create object gref_custom_container
      exporting
      container_name              = iv_ccarea   " control area on screen
    exceptions
       cntl_error                  = 1
       cntl_system_error           = 2
       create_error                = 3
       lifetime_error              = 4
       lifetime_dynpro_dynpro_link = 5
       others                      = 6
    * creating reference to toolbar........................................
      create object gref_ver_toolbar
      exporting
       parent         = gref_custom_container
       display_mode       = 1
    exceptions
       cntl_install_error = 1
       cntl_error         = 2
       cntb_wrong_version = 3
       others             = 4
    * subroutine to create buttons
    * Local data............................................................
      data: lv_fcode       type ui_func,
            lv_icon        type iconname,
            lv_is_disabled type c,
            lv_quickinfo   type iconquick.
    * delete node  button...................................................
      lv_fcode            = 'DELETE'.
      lv_icon             = '@11@'.
      lv_is_disabled      = space.
      lv_quickinfo        = test(001).
    * adding button to toolbar
      call method gref_toolbar->add_button
       exporting
        fcode            = lv_fcode
        icon             = lv_icon
        is_disabled      = lv_is_disabled
        butn_type        = cntb_btype_button
        quickinfo        = lv_quickinfo
       exceptions
        cntl_error       = 1
        cntb_btype_error = 2
        cntb_error_fcode = 3
        others           = 4
    * registering toolbar
    * Local data............................................................
      data: ls_event type cntl_simple_event,
            lt_event type cntl_simple_events.
      ls_event-eventid    = cl_gui_toolbar=>m_id_function_selected.
      ls_event-appl_event = space.
      append ls_event to lt_event.
    * Method for Registering Events for Toolbar.............................
      call method gref_toolbar->set_registered_events
        exporting
          events                    = lt_event[]
        exceptions
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3
          others                    = 4.
    * Setting handler for the Toolbar Buttons..............................
      set handler  gref_application->handle_function_selected
              for  gref_toolbar.
    just copy paste the above code in the PBO of the screen also you need to create a method handle_function_selected which will take care of the function on the button
    * Method to handle button on toolbar....................................
         handle_function_selected
                        FOR EVENT function_selected
                               OF cl_gui_toolbar
                        IMPORTING fcode.
    method handle_function_selected.
          case fcode.
            when 'DELETE'.
    *          code...
         endcase.         
    endmethod.
    Hope the above code snippet help you.
    Regards,
    Kinshuk

  • Measure rpm and PWM signals using digital input of NI9401 module

    Hi, is there a simple way how measure rpm (to 5000 rpm) and PWM (about f=3kHz) signals using digital input of NI9401 (ultrahigh-speed digital I/O)  module plugged in NI 9172 ?  I will wellcome any suggestions and VI examples (bether still). I'm begginer using LView 8.2. I apologize for my poor English. Many thanks.

    Hi CUA,
    Since you have already the right tools, you just need to get started with the software. The NI-9401 will give you access to the counters that are inside the cDAQ chassis 9172.
    You need to place the module in slots 5 or 6. You can read in how they work and how to configure them in the counters section of the user guide found here.
    Now to measure rpm, you can either measure the period of the signal (seconds) and multiply by 60 to have minutes and the number of ticks per revolution. You can find a shipped example to read period called “Meas Dig Freq-Buffered-Cont-Large Range 2 Ctr.vi” found under Hardware Input and Output » DAQmx » Counter Mesurements
    To measure PWM, it is similar procedure and you can read the semiperiod (high time or low time). There is also a shipped example called “Meas Semi-Period.vi” found under the same location.
    There is great information for these kind of task at this page or just post back if you need to.
    Hope this helps.
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • I am trying to create a sequence to be use as primary key in a Oracle table

    Hi guys
    I have the ODI version 10.3.5 and I am trying to create a sequence that populates de row_id for a table. The schema is a database.
    And I want that this item will be the primary key of the table that is loaded at execute the interface however I'm getting issues.
    So please advise me.

    Hi ,
    Can you please provide the following details :
    1. What is the execution area of your sequence ? Is it source or staging or Target.
    2. What IKM you are using ( I hope you are executing sequence in Staging or Target ) ?
    My understanding is when you check Not Null , all your rows are going to Error table. So it is not giving any error.
    When you uncheck the Not Null , it is giving error because Database is not allowing Null values in the Primary Key Column.
    You can do the following to check if your sequence is working properly.
    Try to write a Insert Select query in DB and execute it and see if it is working properly.
    i.e.
    insert into      EMPL     (
         EMPNO,
         ENAME,
         JOB,
         MGR,
         HIREDATE,
         SAL,
         COMM,
         DEPTNO
    select      S_EMPNO.NEXTVAL,
         ENAME,
         JOB,
         MGR,
         HIREDATE,
         SAL,
         COMM,
         DEPTNO
    from     EMP
    or if you can provide your query in this format , it will help in finding the issue quickly.Also provide the KM details.

  • Trying to create DLL from VI to use in TestStand.

    I trying to create a DLL out of an existing VI file.  The VI has about 4 inputs and about 3 outputs.  If I go to Tools >> Build Application and select the Build Target as a "Shared Library (DLL)" i get a dll after the build; but when I try to call that DLL from teststand, it doesn't recognize any of the inputs or outputs.  How do I build a DLL so that teststand will reconize the inputs and outputs?
    Solved!
    Go to Solution.

    The controls and indicators are connected to the connectors.  Also, answering an earlier post, the prototype information for the inputs and outputs are not automatically displayed. I can manually define the prototypes, but then the question is how does each prototype link to its corresponding parameter (by name?). I've also tied creating just a simple VI that has just one string input and one string output.  I built the VI to a DLL and tried calling in TestStand and i get the same results.  I've inserted the resulting header file after that build.  Which, by the way, looks exactly like my other created DLL's header file.  The difference in bold(the name of the VI). Which makes me thik that my build DLL process might be off.
    #include "extcode.h"
    #pragma pack(push)
    #pragma pack(1)
    #ifdef __cplusplus
    extern "C" {
    #endif
    void __stdcall String_input_output(void);
    long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);
    #ifdef __cplusplus
    } // extern "C"
    #endif
    #pragma pack(pop) 

  • My IPod nano doesn't know when I'm pushing buttons/using the wheel.

    I tried everything Apple suggests for resetting it that didn't require pushing buttons on the actual IPod. I have even restored it to the factor settings. The HOLD button is NOT on, however when I slide to unlock, the Apple Icon comes up and then the home screen will come up, but then nothing. PLEASE HELP!

    Do you have any better luck with that if you update to iTunes 10.6.1.7?
    From the notes for the release:
    iTunes 10.6.1 provides a number of improvements, including:
    • Fixes several issues that may cause iTunes to unexpectedly quit while playing videos, changing artwork size in Grid view and syncing photos to devices.
    • Addresses an issue where some iTunes interface elements are incorrectly described by VoiceOver and WindowEyes.
    • Fixes a problem where iTunes may become unresponsive while syncing iPod nano or iPod shuffle.
    • Resolves an ordering problem while browsing TV episodes in your iTunes library on Apple TV.
    http://www.apple.com/itunes/download/

  • How to create a new push button in application tool bar in GMGRANT thru BDT

    Dear SAP Gurus -
    We have a requirement in 'GMGRANT' transaction. We need to create a button in the application tool bar of 'GMGRANT' transaction. Once the button is activated, if the user clicks on the button then it will go to a new screen (external screen). User can input data in to the external sceeen and upon saving, the data will be stored in to a custom table and when user clicks on 'back ' button user should come back to the GMGRANT transaction.
    Just wanted to know, how to create / activate a new button on application tool bar of GMGRANT transaction and what are the configuration and detail steps to achieve the same through BDT.
    We went through a lot of documents on BDT but do not have a proper solution.
    Could you please help.
    Thanks in advance.
    Regards,
    Atul Mohanty

    hi,
    You can find user-exits (menu exits) to add new menu item.
    But, there is no possibility to add new buttons on application tool bar.
    Regards,
    Sailaja.

  • How do I create a web streaming app using digital publishing suite?

    Hello, and thank you in advance. I'm looking for tutorials and guides on how to create a web streaming version of an app using digital publishing suite. Can anyone point me in the right direction.

    Please tell us what you mean by "web streaming." Are you referring to a version of the content that can be viewed in a web browser?

  • How can i measure the time between two successive rising edges ,using digital input ..

    Hello
    I'm trying to measure the time in seconds between each two successive rising edges on a digital input .
    Till now I have managed to detect the rising edge ,increment a counter with each rising edge ,and snap the time at which the rising edge happenned
    all I need now is to subtract the current rising edge time from the previous rising edge time in order to calculate (T) which can be 1/frequency and display it in realtime to the user.
    but I don't know how to do this
    Can somebody please help me !!!
    note: the time that I'm measuring ranges between 200 ms - 2 seconds
    Solved!
    Go to Solution.
    Attachments:
    Counter without time.vi ‏11 KB

    Cheers for that. It's always a good idea to post your SubVIs as well - the problem could be in one of those.
    To help you out:
    You already know how to use shift registers so why not use one again for time? Create a new shift register for  the time then simply compare the "rising edge time" to the the previous time stored in the shift register and then write the new time to the shift register.
    Just a few other pointers:
    1. You'll want to initialise your shift registers ie wire a constant to the left hand register outside of the loop. This will cause the register to be reset each time the program is run. This is so that your counter will start from zero each time you run your code.
    2. You don't need to use the "greater than?" compare function with boolean as they can only be true or false (1 or 0)! The "Equal?" function is what you should use here.
    3. Lastly, it's a small thing but you can use the same tunnel that feeds into a case structure in each of the cases - no need to create two tunnels for the true and false cases, use the same one.
    -CC
    "If anyone needs me, I'll be in the Angry Dome!"

  • How can I measure the time between each two successive rising edges ,using Digital Input ?

    Hello
    I'm trying two measure the time in seconds between each two successive rising edges on a digital input .
    Till now I have managed to detect the rising edge ,increment a counter with each rising edge ,and snap the time at which the rising edge happenned
    all I need now is to subtract the current rising edge time from the previous rising edge time in order to calculate (T) which can be 1/frequency and display it in realtime to the user.
    but I don't know how to do this
    Can somebody please help me !!!
    Solved!
    Go to Solution.
    Attachments:
    Counter without time.vi ‏11 KB

    Woah!  
    Sorry Apok, but your code is becoming way too complicated/messy. I don't think that all of those shift registers or boolean conversion/operators are needed at all.
    If you want to measure the timing between two button presses then this is a different (much less complicated) way. It simply records the timing of the button press into a shift register then compares the two.
    Spoiler (Highlight to read)
    Of course this is a very quick and basic solution just to show you that it can be much simpler than you are making it (remember to use the mechanical actions of the buttons to get the behaviour you want).
    A better way would be to use an event structure looking at value changes of the buttons to determine the timings between clicks.
    -CC
    "If anyone needs me, I'll be in the Angry Dome!"
    Attachments:
    Time between clicks.vi ‏9 KB

  • Use digital inputs to choose inquiry sequence?

    Hello,
    Is it possible to use a couple of the NI-1456 CVS TTL Digital Inputs to select which specific Inquiry Sequence should be ran?
    I currently own NI Vision Builder for Automated Inspection.  I do not own LabView.
    I am using a NI-1456 CVS and firewire camera.  My solution will use the NI-1456 CVS stand-alone.  It will not be connected to a VGA monitor, or to a computer.  I intend to use the system to detect flaws in silicon wafers.  Due to several possible wafer sizes and shapes, I will have to develop an Inquiry Sequence for each wafer type.  I would like to have the NI-1456 CVS unit contain several Inquiry Sequences.
    -Rick

    Hi Rick -
    Actually, this is a very commonly used feature of VBAI!  From the Configuration Interface, choose Tools»Configure Inputs/Outputs.  This will pop up a settings window for the entire inspection process.  The second state (called "Change Inspection?") allows you to configure a Product Selection port.  The digital byte written to this port will determine which inspection script to run.  From the listbox, you can choose NI CVS/IMAQ IO Product Selection to use your CVS's digital input port for this feature.
    More information about this feature can be found int he NI Vision Builder for Automated Inspection Configuration Help, under the following index: Vision Builder AI Tools»Configuring Inputs/Outputs»NI CVS-1450 Series I/O.  Note that the ISO inputs are used for this feature, not the TTL inputs.
    David Staab, CLA
    Staff Systems Engineer
    National Instruments

  • [CS4] How to create list entries having button using ADM ?

    Hi All,
    I  want to create list box using ADM whose entries can have button. like we see in layer panel, there is a button to select arts of layer as figure shows.
    I tried to use function like  sADMItem->AddItem(listBoxRef,linkButton)  but there is no effect.
    plz suggest how to do so.
    Thanks

    You can do this, but its a lot of work.
    First, you can't add buttons to list entries. Second, that's not an ADM list in the Layers panel, thats an ADM Hierarchy Control. If you have no children of top-level items, then it will look like a list.
    To do this, you'll need to use an ADM Hierarchy Control and you'll have to implement the Draw() routine of the entries of said control. It'll be up to you to draw everything -- the icon, the text, etc. Then you can also draw your 'button'.
    Next, you'll need to implemented the Track() routine. You can have it do the default for most things, but you'll need to check for clicks and see if they're in the bounds of the 'button' you drew. If so, you can do whatever you want that button to do (and change some state that makes the button draw differently). I don't reccommend animating the press of the button, though that's probably doable (its likely very hard though).
    The code for this is quite extensive, but I'd look at IADMHierarchyList.hpp & BaseADMHierarchyList.hpp/cpp in the SDK directory. You'll be sub-classing those guys to do all this. I don't know if there's any sample code demonstrating this or not.

  • How to create array of push button 288 ch in the PXI 6509 (3pcs)

    Hi all,
    Need help..
    I'm beginner in labview. & its first time use NI to my project.
    We need push buttom approx 288 ch as panel control. we use PXI 6509 (3 pcs)
    & I have make a code (in the attach).
    but some time appear like a bug if we push one button after push all button. but some time is ok.
    Please correct the code.
    Many thanks..
    Solved!
    Go to Solution.

    It seems to work okay for me.  What do you mean by "sometimes appear like a bug"?  How is it not behaving like you want.
    Some recommendations:
    1.  There is no logical reason for the feedback node on some of your error wires.
    2.  You might want to turn some of your groups of buttons into a cluster.  That way you can work on the value change of a cluster and not have to set up 100's of value changes for the individual controls.  You would also be abe to easily use cluster to array to turn your cluster of booleans into array of booleans rather than building arrays by manually wiring up 100's of controls.

  • Creating 'print this page' button using AS3

    Hi all,
    I need to create a button, or at least a movie clip that
    functions like a button that will print a page when clicked.
    Ideally I would like to have the button as part of the flash
    application, which will be online embedded into a web page as a
    .swf. on click the print page dialog box will appear, and the user
    will be able to print out the web page. What is the best way to
    code this?

    sure. the swf's main timeline is a movieclip, so if you want
    to print everything that's on the swf stage, use the printjob()
    class to print the main timeline.

  • How to create icon on Push button

    Hai All
    I have a button, when the user press the button i will display the calander. So now i need to place a small calander picture in that so Pls tell me the steps to create a iconic button.
    Pls explain me the steps...
    Any Help is highly appricatable
    regards
    Srikkanth.M
    Edited by: Srikkanth.M on Apr 28, 2010 11:00 AM

    Hi,
    you have to create a jar file of the pic and have to place it in java folder .
    Also have to edit cfg file in server folder .in that you have to include the jar file name in parameter archive_jini =
    iconic property of button should set yes
    give the name of jar file without any extension( suppose list.jar you just give list ) in the iconic name property
    cheers
    Rinz

Maybe you are looking for