Hardware push button acting as mechanical switch (latch when released)

Hello,
I have a simple question. How can I have a hardware push button (momentary switch fed into DAQ board as a digital input) exhibit the same characteristics as a boolean with its mechanical action set to Latch when released?
Is it possible to do that?
Thanks,
r15
Solved!
Go to Solution.

Is the code implemented easier when a "latch when pressed" behavior is required?
The problem I am facing is that when I press the hardware button, the indicator "element" is incrementing as long as the button is pressed. I need it to only increment one time until I release the button and press it again.
Hence, everytime I press the button (no matter how long I keep it pressed), I want the indicator to increment only once to count the number of times the button is pressed.
I attached the VI below to make things clearer.
Attachments:
Untitled 1.vi ‏44 KB

Similar Messages

  • Hardware push button

    I am trying to build an automated thermostat tester using labview. I'm going to try and test 6 t'stats at one time. I have most of it ready but I have a few doubts. I'm using Labview 8.5 on Windows 2000 with the NI PCI 6515 DAQ unit.
    I am attaching my code here. As you can see it has  start and stop buttons (soft button). But this is not how it's supposed to be anymore. They want a push button in hardware now. So our design fixture has a big push button for start and stop (momentary switching not a proper switch) (hard start-stop).
    I want to know how to edit this VI in order to not have these soft buttons but to tie them up to a hardware button. I know I will have to use the DAQ to sense the momentary change in state but I don't know how I can do that and how to edit this without having lots to do.
    All you help will be highly appreciated.
    Thanks,
    Shreya
    Attachments:
    mux_try45.vi ‏678 KB

    Look at the dataflow demo I have attached. If you cannot figure out what it is doing part of the time, try running it with execution highlighting on. (The light bulb on the diagram toolbar). Notice that parts Two and Three have the indicators outside the case structures and use shift registers so no local variables are needed. Part One does not update LED 1 or String 1 effectively because it has neither the shift registers nor local variables. Parts One and Two are similar to your Unit cases, except that in the demo they always execute the same case on each iteration. Part Three is similar except for the way it handles delays. See below for why this matters.
    Part Three shows an alternate Wait method which works well with state machines and allows prompt response to user inputs (Stop) or errors.
    The picture shows one case of your program. Suppose this case is called in Unit 1 and the Reset93 case is called in Unit 2 on iteration 50 of the while loop. A call to Reset93 writes to a digital line then calls Clear Tasks. Clear Tasks calls Power Off which writes to a different digital line and calls Stop. Stop tells the while loop to stop executing.
    Question: When does PowerOff (Unit 2) happen and when does the while loop stop executing?
    Answer: In iteration 53 at least 183 seconds later. Iteration 50 does not complete until all the case structures and all other nodes inside the while loop complete. Since Unit 1 Case Dialog1 has waits totaling 183 seconds, iteration 51 will not start for at least that long. If one of the other Unit cases has a longer delay or has a delay in iteration 51 or 52 those delays would extend the time before stopping.
    Lynn
    Attachments:
    Parallel state dataflow demo.vi ‏44 KB
    Dataflow1.png ‏20 KB

  • Push button true and release

    HI,
    I need to create a push button which command (true)a case structure : In this case structure I have an "Analog 2D DBL NSamp NChannel" which is doing an acquisition according to Nb of samples : What I what is that after this acquisition is completed, the pushbutton should be set automatically to false ; Do someone has already done this ?,
    Thanks for the help
    P,

    May be the simplest thing is to change the mechanical behaviour on the button. Right-click on the control, then Mechanical action>Latch when released.
    That should do the trick : When you press the button, it remains at True until read (means until the acquisition will be started in the case structure), and returns to false immediately after.
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Spring Push Button

    Hi all I'm new to LabVIEW and learning it up for my final year project. Thank you in advance for the help from you guys. 
    I have a question here:
    Is it possible to create a button with spring back effect? Means I wish to have a switch at the front panel which acts controller of our car alarm, press once to trigger the action/motion, yet we do not have to press it AGAIN to switch it off, and prepare for the next activation. 
    Thank you if anyone out here is willing to give me a helping hand. Good Day.
    Solved!
    Go to Solution.

    What you want is the "Latch when Released" mechanical action.  The button will reset when the terminal is read on the block diagram.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • HDL node not picking up push button signals

    Hello,
    I am trying to design a vending machine using sbRIO and Labview HDL node. But my HDL node doesn't seem to pick signals from push button (latched when released). I have successfully done the same thing using labview blocks but not geting desired results by HDL node. I could use labview blocks only and not HDL node but I have to give a presentation to my class about how we can integrate VHDL code in labview. I have attached my VI with following VHDL code living inside HDL node. 
    process( clk, reset )
    begin
    if( reset = '1' ) then
    state_reg <= idle;
    enable_out <= '0';
    elsif rising_edge(clk) then
    state_reg <= state_next; -- result and enable_out follow input by 1 clock cycle
    if( enable_clr = '1' ) then
    enable_out <= '0';
    elsif( enable_in = '1' ) then
    enable_out <= '1';
    end if;
    end if;
    end process;
    process(state_reg,Five,Ten)
    begin
    case state_reg is
    when idle=>
    if (Five="0"and Ten="0") then
    state_next<=idle;
    elsif (Five="1" and Ten="0") then
    state_next<=statefive;
    elsif (Five="0" and Ten="1") then
    state_next<=stateten;
    elsif (Five="1" and Ten="1") then
    state_next<=statedone;
    end if;
    when statefive=>
    if (Five="0" and Ten="0") then
    state_next<=statefive;
    elsif (Five="0" and Ten="1") then
    state_next<=statedone;
    elsif (Five="1" and Ten="0") then
    state_next<=stateten;
    elsif (Five="1" and Ten="1") then
    state_next<=statedone;
    end if;
    when stateten=>
    if (Five="0" and Ten="0") then
    state_next<=stateten;
    elsif (Five="0" and Ten="1") then
    state_next<=statedone;
    elsif (Five="1" and Ten="0") then
    state_next<=statedone;
    elsif (Five="1" and Ten="1") then
    state_next<=statedone;
    end if;
    when statedone=>
    state_next<=idle;
    end case;
    end process;
    process (state_reg)
    begin
    Ten_Deposited<="0";
    Five_Deposited<="0";
    case state_reg is
    when idle=>
    Ten_Deposited<="0";
    Five_Deposited<="0";
    done<="0";
    when statefive=>
    Five_Deposited<="1";
    when stateten=>
    Ten_Deposited<="1";
    Done<="0";
    when statedone=>
    Ten_Deposited<="1";
    Five_Deposited<="1";
    done<="1";
    end case;
    end process;
    Attachments:
    Untitled 3.vi ‏14 KB

    Thanks, NapDynamite. However, you just included your Project (not the actual VI) on the attachment. A good way to include all of the dependencies is to create a source distribution (LLB). 
    Right-click on Build Specifications, select New»Source Distribution
    Under Distribution Settings, select Custom as your Packaging Option
    Check the Destination is LLB box and click OK on the warning.
    Choose the Destination Path where you would like the LLB to be saved
    Click Build to create the LLB, or click OK to save the Build Specifications.
    Regards,
    Daniel REDS
    RF Systems Engineer
    Help us grow.
    If a post solves your question, mark it as The Solution.
    If a post helps, give Kudos to it.

  • Issue with Icons display in PUSH BUTTONS in forms 11g

    Hello,
    This is regarding an issue with the icons background for the push buttons in the forms 11g. When we enable the icons for the buttons (.gif) they are visible on the
    top left corner of the buttons and not in the centre. In one of the forums it was written like this is a common problem in Forms 11g. Is there any way by which we can
    centralize this icons on the Forms buttons. Also I have heard that image editing tools can be used to centralize the icons. I tried with one of the tools but it seems
    like it is not working.
    Can somebody suggest a workaround for this?
    Thanks in Advance
    Ram

    I will assume you are attempting to use the images included in the Forms applet jar. These images are purposely structured so that the subject is off-centered. You should not see that same behavior if you use your own images or edit the ones built-in to Forms. However, keep in mind that the images packaged in the Forms applet jar are intended to be used in a menu toolbar and not custom buttons.
    For more information, refer to MyOracleSupport note 1391073.1 where I explain this in detail.
    Michael Ferrante
    Senior Principal Support Engineer
    Forms Global Technical Lead
    Oracle Corporation
    .

  • Latch Until Released Behaviour

    The behaviour of the latch-until-released behaviour of switches seems a little strange to me and I was wondering if anyone would shed some light on a question I have about it.
    As a quick experiment I created a very simple VI containing just a while loop with an event structure, a couple of latch-until-released boolean controls, and a numeric indicator.
     What I expected was that the indicator would display "2" while one of these boolean controls was depressed and "1" after releasing it. What I found was that it displayed "2" after pressing the button but remained that way after releasing it as well.
    Using the event inspector window, I verified that this event case was firing both when I pressed the button and when I released it, but in both cases it seemed to be reading the button as "true". I find this really odd - wouldn't it make more sense for the button to be read as true in one case and false in the other?
    To get the intended behaviour, I had to do something pretty ugly:
    Since the button seems to be in the same state in both executions of the case, there's no way of differentiating between press and release events except by keeping state external to the event structure. My question is basically: why have the LabVIEW developers chosen to design it this way? What's the logic behind it?
    Solved!
    Go to Solution.

    CoastalMaineBird wrote:
    Your event recognizes a VALUE CHANGE.
    The definition of WHEN the value changes is defined by the mechanical action you set.
    If you set latch-until-released behavior, you are asking the button to retain its TRUE state until the next READ after the mouse releases it. (look at the MECHANICAL ACTION icons for pictures of this).  In other words, it is the READ of the TRUE state (after the mouse release) which CAUSES the button to pop out.
     wouldn't it make more sense for the button to be read as true in one case and false in the other?
    Not if the READ is the CAUSE of the transition.  They do it this way so you won't miss a transition (especially back in the days before EVENTs - you had to poll the buttons to respond to them).
    I have never used the latch until released, only latch-when-released for regular DO IT actions, and sometimes switch-until-released for pushbutton type (DO IT WHILE I PUSH) actions.
    You mention having to do something ugly to "get the intended behavior", but I'm not sure what your intent is.
    > The definition of WHEN the value changes is defined by the mechanical action you set.
    > If you set latch-until-released behavior, you are asking the button to retain its TRUE state until the next READ after the mouse releases it. (look at the MECHANICAL ACTION icons for pictures of this).  In other words, it is the READ of the TRUE state (after the mouse release) which CAUSES the button to pop out.
    That's correct, but the issue here isn't so much when the value changes (the value changes in the way I expect), but the choice LabVIEW is making about when to sample the control's value and generate an event. When I press the button and generate an event, does LabVIEW update the state of the control and then generate a Value Changed event? That would make sense and it seems that's what's happening when I press the button. However, when I release the button, it seems to be generating a Value Changed event and then changing the state of the control.
    This diagram might make this all clearer:
    > Not if the READ is the CAUSE of the transition.  They do it this way so you won't miss a transition (especially back in the days before EVENTs - you had to poll the buttons to respond to them).
    If that's the case, is there a way that I modify the program so that I can read the control as false when I'm releasing it (which would be more intuitive and make the program a lot simpler to write)?
    > You mention having to do something ugly to "get the intended behavior", but I'm not sure what your intent is.
    My program is ugly because I have to keep boolean values going through shift registers and switch their values within the Value Changed event case. I have to do this because I read a boolean control as "true" both when pressing and releasing it, and therefore I have no way of differentiating which situation is happening within the event case itself - I need to maintain external state to "remember" if the button is currently pressed or depressed to figure out how I should update the numeric indicator.
    My intent is just to update a numeric value to one particular value when a button is pressed, and another value when it's released.
    Bob_Schor wrote:
    I think the explanation is that Value Changed refers only to value changes that take place by interaction with the Front Panel, such as pushing the button.  The Latch property means that when the button is read, it "clears itself", but like any programmatic change to a Control, this is not registered as a Value Change.  
    So Up is initially false.  You push it, it becomes True when you release it, and triggers the Event.  You read it as True, which travels in the wire and selects 2 -- the act of reading also changes the value to False.
    I tried to write a tiny VI to illustrate this, but ran into the issue that you can't create a Local Variable from a Latched Control, nor can you use the Value property.  Oh, well ...
    BS
    I'm not sure if you're correct - the reason being that two Value Changed events are generated, once when pressing the button and then again when releasing it. This can be verified with the Event Inspector window. I don't think the value change associated with releasing a latched boolean control is classified as "programmatic".
    Up is initially false. I press the button (and keep it pressed), and an event is generated during which time Up's state is read as true. At some later time I release the button, generating another event in which Up's state is again read as true.

  • 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

  • Push buttons hardware with usb-6008

    I'm creating this whack a mole game.. how to do I implement the push button switches hardware connected to the NI-USB6008 input? Can someone give me a headstart pls? I'm stumped.. 
    Attachments:
    FYP_beta16.vi ‏269 KB

    Please don't tell me you attached a VI that was set to run when opened.
    I try downloading your VI and it popped up with a dialog box saying there is no disk in the drive, and to put a disk into \Device\Harddisk3\DR7.  That or it seemed to be looking for an H: drive.
    As for switches, look at page 21 of the manual http://www.ni.com/pdf/manuals/371303l.pdf.  It shows a switch connection a digital input pin to ground.  But also a resistor between the digital input pin and +5V to pull the voltage level back up when the switch is open.  Although I'm not sure that the pull up resistor is truly critical.

  • My Iphone Off/On push button is apparently stuck. I am unable to turn it off or push for the black screensaver. Is there a mechanical fix or am I sunk with a defective phone now?

    question: Is my IPhone 4S now defective/defunct for use with a bad push button for on/off and screensaver, or is there a mechanical fix that an Apple Store Genius can do to pop that button out again?

    Oh, yes, the Apple store will either install that cheesy, annoying screen app, or tell me I can replace my phone - only 1 1/2 years old - come on, Apple! - for a hefty price since the warranty is over and my cell contract still has months to go. Oh, and I've purchased AppleCare several times on other products and never needed it because I am careful with my electronics! Apple has gotten enough money from me for AppleCare in the past, and why would I have expected Apple to have a shoddy product (well, I might now). Thanks for responding, though.

  • My iphone will not switch screens when I push the button

    my iphone will not switch screens when I push the button

    -try restarting the device
    -reset the device
    -restore the device as new
    -replace the device

  • Q10 switches off when power button pushed once and gets stuck in boot up loop

    Hi All
    All of a sudden my Q10 power button has become sensitive and restarts when pushed once.  When it tries to restart it gets stuck in the boot loop - going from red light to BlackBerry logo, back to red light.... If I push the power button a few times it will boot up.  
    I have tried to reload the most actual 10.3 software but problem still exists.
    Any ideas?  Oh and its JUST gone out of warranty.....
    Is it a power button issue or something more serious?

    Sounds like button. I'm assuming that is one way they can fail. I don't know for sure. What I usually read about button problems is the button doesn't work at all.
    The issues could with the 10.3.1 upgrade complicates guesswork. How did you reload the OS? If you did a clean install with an autoloader then I would say you did what you could do to rule out software.
    - Ira

  • How do I change the color of the small LED inside a Push Button

    One of my colleagues managed to accidentally change the color of the LED inside the Push Button. He didn’t know how he did it and we couldn’t figure out how to change it back. It’s easy enough to replace the Push Button with a fresh copy from the Buttons & Switches pallet but I would like to know how to control this parameter. Does anyone know how to do this?

    Hi Bob,
    Could you help us help you?
    Please post a VI with the troubling pushbutton so we can see the issue.
    If you are talking about the LED shown in the attached jpg,
    that color can NOT be changed at run-time. Use the Paintbrush.
    Ben
    Message Edited by Ben on 10-14-2005 10:26 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Led.JPG ‏20 KB

  • I just received a iPod Touch 5th generation for xmas and it acts like it is locked, when you slide the slider it says unlock button and nothing happens.  Can't slide the power off either.  It tells you the time, unlock button, power off button but nothing

    I just received a iPod Touch 5th generation for xmas and it acts like it is locked, when you slide the slider it says unlock button and nothing happens.  Can't slide the power off either.  It tells you the time, unlock button, power off button but nothing happens.  Voice just tells you the unlock button, time, poweroff button.
    Please help also itunes says I need to enter on iPod the passcode to reset to factory.  I can't get it open to enter passcode, slider doesn't work.  It is one day old and this happen xmas afternoon.  PLEASE Help someone

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • Ipod nano 6 won't start. I have already tried pushing the volume down & on switch

    My nano 6th Generation won't start. I have already tried pushing the volume down & on switch. I just have a black screen.

    See the appropriate section of this Apple support document.
    iPod nano (6th generation): Hardware troubleshooting
    B-rock

Maybe you are looking for

  • Testing adobe air applications with fake apple certificate in iOS simulator running in a hackintosh

    I can compile an Adobe Air application on windows with a fake apple certificate. Can I test this application in iOS Simulator running on a hackintosh? Or is the simulator blocking testing of IPA outside from XCode ie: it's not a standalone simulator

  • FSAPPL 100 PI content tpz file

    Does anybody know where I can find the Financial services APPL 100 which contains Banking services 5.0 XI content? I have seen it in SPROXY on a ABAP stack. But cant find it in SMP: UNDER MENU Support Packages and Patches  =>Support Packages and Patc

  • How can I establish connection between DirectSoft Programming software and LookOut

    Hi,         I am working with a DL06 PLC. I am trying to a develop a LookOut Direct HMI for this tainer. I would like to know if there is any option in LookOut where it allows me to run small parts of PLC code along with HMI so that i can toggle disc

  • Slideshows on icloud Keynote

    Anyone managed to play a slideshow with icloud Keynote? I tried in different browsers and different computers and with native keynore presentation or icloud-built. All that I get is a black screen. I am desperate!!!  I need any solution for my lectur

  • Multiple Selection with JList

    Hello! I have a Frame with a JList that needs to be able to do multiple slection. The JList ist filled with special names which are found when the user opens a certain file. (so a file-chooser is here too) When the User selects a name every paragraph