Latch to switch boolean conversion, or toggling flip flop in labview

I'm a labview newbie, and i've been scratching my head about a particular problem.
I want to use a joystick (11button, 3 axis) to operate 2 PI microscope stages in tandem. I am thinking about the best solution to this problem:
 the joystick buttons provide latched booleans: they are only true while the button is held down. once the button is released, the boolean becomes false again.
I want to take this toggle and produce a true boolean the first time the button is pressed, and change that boolean to a false when the button is subsequently pressed.
My current idea is to try and construct something with either an occurance structure or notifier structure, or even something like a boolean to integer conversion then modulo-2 division.
Can anyone give me some pointers here?
thanks!
Solved!
Go to Solution.

zipmanx wrote:
From a programming standpoint, which is better to use? an event handler as trob has suggested, or something like an occurance or a notifier?
Here's another one: can you do a bitwise shift in labview?
Since you are reading hardware, you probably need to poll it, so an event is out.
Yes, you ca do bitwise shifts in LabVIEW. Look in the "numeric...data manipulation" palette.
Here's one possibility to solve your problem (LabVIEW 8.5). There are many other ways to do this, but you dfefinitely don't need any blue wires for the logic. .
Message Edited by altenbach on 12-01-2008 01:05 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
JoystickBoolean.PNG ‏6 KB
JoystickBoolean.vi ‏10 KB

Similar Messages

  • Who can i make a set-reset flip-flop with labview interacting with for cycle outputs

    Who can i make a set-reset flip-flop with labview interacting with for cycle outputs

    Are you wanting a VI that emulates a RS filp flop, or do you have a question about using an actual one?
    You can make a RS flip flop by knowing the 4 states:
    R=0, S=0, Q=no change
    R=0, S=1, Q=1
    R=1, S=0, Q=0
    R=1, S=1, Q=?(invalid condition)
    I have attached a RS flip flop VI in LV version 6.0
    dhuff
    Attachments:
    RS_Flip_Flop.vi ‏34 KB

  • Edge triggered D flip flop in labview fpga

    Hi,
    I am trying to write a program to test ADC with PXI-7962 FPGA. This is basically a 9 bit SAR ADC whose data is to be read every time a 100 MHz clock have a positive or nagative edge. So I have to check for edges in the clock and take the value of the 9 bits in that same instant, for which I need edge triggered D flip flops. But I could not find any D flip flop on the FPGA functions pallette and also could not find a good solution in the web. Can anybody help me in this regard? 
    Thanks,
    Anindya

    I would recommend giving yourself a foundation in labview if this is going to be a sustained development effort. The best way to do this is with instuctor led training. If that isn't an option then the next best thing is self paced online training, which is free if you have purchased LabVIEW or LabVIEW FPGA.
    Strengthen Your Core with the New Self-Paced Online Training
    https://decibel.ni.com/content/docs/DOC-32313
    The advantage to giving yourself a foundation is you learn to ask the right questions earlier in development. The folks on the forums can only answer the questions you are asking, and while acessing every bit in a numeric is a perfectly reasonable question, we have no idea if what you are trying to do with them is reasonable and if accessing them all is even necessarry for your application.
    National Instruments
    FlexRIO Product Support Engineer

  • String (binary) to boolean conversion problem.

    Hello,
    Im facing problems converting a string (presumably in the binary format) to turn on LEDs according to its respective weight. ie.binary input = 1010. Thereby it would turn on the first (MSB) and third LEDs while the second and third are left off.
    What I have managed to obtain is a direct conversion of decimal to binary but have not much idea on how to achieve the above goal. The attached file shows two operations; top part does the boolean to binary conversion is fine. The bottom is supposed to be the binary to boolean conversion.
    Attachments:
    boolean to string.vi ‏21 KB

    OK, let's back up a second here. I don't understand what your "boolean to string" VI is doing. Are you starting with a string, a number, or a bunch of Boolean controls? The top part is dealing with Boolean controls and creating a string of characters of "0" and "1". The bottom part you have a numeric control. By the way, it is pointless to take the output of Number to Boolean Array, converting it to an array of 0s and 1s, indexing out each element, and then using the Not Equal to Zero operator. Just take the Boolean array output from Number to Boolean Array directly into an Index Array!
    You seem to be saying that you have a string in the binary format. This is somewhat meaningless, so I'm assuming you mean you have a string that consists of a sequence of the ASCII characters "1" and "0" to indicate a numerical 1 or 0. You then want to convert this into something that is programmatically useful. What that is is not clear, so let's assume an array of Booleans. If that's the case, then you can simply take advantage of the fact that you're starting out with ASCII characters, and use the ASCII codes to find out what you have. The ASCII code for the character "0" is 30 (hex) or 48 (decimal). The ASCII code for the character "1" is 31 (hex) or 49 (decimal). Assuming this is what you have and what you want, then you can simply do this:
    Attachments:
    Example_VI.png ‏8 KB

  • Need reset box with flip-flop green LED and reset button

    Before I build up a large number of these, is there an off-the-shelf box with flip-flop green LED and reset button?

    Hi,  I'm not sure what you mean.  Are you looking for a phsyical project box witha built in reset switch and LED?  Or are you talking about a LabVIEW template?
    Chris Bakker
    National Instruments
    Applications Engineer
    Check out LabVIEW 2009 and the New X-series DAQ!

  • Do you have Sequential Binary counter with J K flip-flops and 7 segment display ?

    do you have Sequential Binary counter with J K flip-flops and 7 segment display ?

    Hi,
    You should post what you have done so far and where you are having trouble.  If you only post a description you won't get much help on this board.
    Tien P.
    National Instruments

  • How do I enable the flip/flop image button in the geometry room?

    How do I enable the flip/flop buttons in the geometry room. A noob question to be sure, but I just can't figure it out. The buttons are grey, and won't respond when I click on them.
    I shot on the HVX using the brevis adaptor, so the footage is all upside down. In FCP I corrected this, but upon importing the project into Color, the images were upside down again. Do I need to re-flip them in color for the final output? Or will they automatically be subject to the effects already in my time line when I export back to FCP? Either way I'd like to temporarily flip them in Color so I don't have to stand on my head while color correcting.
    Anyone out there who can clue me in?

    Use FCP... the geometry in COLOR was never meant to be more than a convenience, sort of... Final Touch always ignored everything in the Motion tab until recently, with ambiguous results. Now one doesn't really know where the flips flops and flies are coming from unless you've done them yourself but I do notice that keyframed geometry-composed camera moves rarely import or export correctly, and interlace is poison.
    jPo

  • PLEASE HELP IN FLIP FLOP !!

    hi , i am a mechanical engineer new to labview and need help in creating a vi that can do the folowing flip flop function as shown in the attached dig .
    please upload a vi if possible ..
    Thank u
    Avinash
    IC Engines Lab
    IIT Madras
    Solved!
    Go to Solution.
    Attachments:
    flip flop.PNG ‏12 KB

    You've asked this question multiple times in several different boards:
    http://forums.ni.com/t5/Multifunction-DAQ/Combination-Of-Two-Triggers/m-p/1622404
    http://forums.ni.com/t5/Digital-I-O/PLEASE-HELP-IN-FLIP-FLOP/m-p/1627902
    http://forums.ni.com/t5/Counter-Timer/PLEASE-HELP-IN-FLIP-FLOP/m-p/1627906
    http://forums.ni.com/t5/Digital-I-O/PLEASE-HELP-IN-FLIP-FLOP/m-p/1628172#M14617
    At this point I'm not even going to bother helping you if you feel like spamming the boards. Especially with a question that looks just like a homework problem.

  • What ADDER code would result in a one slice implementation (1LUT + 2 flip flop) per bit

    I firstly apologise to all that are beeing asked this question for the time and effort I would cause
    To utilise the FPGA to a have a max number of adders I would need an adder synthesised in a way that balances the LUT and Flip Flop usage.
    any suggestions?

    Hi
    Thanks for the amazing answer its really great to know that there is one adder per LUT I never really realised it
     the LUT is purely a Logic unit:
    00 010101010101010
    01 0011001100110011
    10 0000111100001111
    11 0000000011111111
    so for the ADDER it needs per bit 2 EXOR 2 AND and 1 OR gate  that you can implement in one single LUT, 
    the requirement is to calculate in parallel "flatten" the sequential bottle neck but you need the accumulator flip flops also nearby so with what you told one could have in a 2 LUT and 2 FF slice a 2 bit ADDER and ACC of 2 bits, hence  for 10'000 slices in theory a 20'000 bit adder. 
    That is all I wanted to know and I opened this question so many can read and check is nothing wrong is said
    Thanks to all that read and any suggestions are welcome!
     

  • Flip Flop Counter 7-segment 4511 convergence issue

    I've build a counter using D Flip Flops and am trying to display it on a 7-segment display using a 4511 BCD decoder. I get a convergence error when I have the C output connected (on the second page) to the DC input of the 4511. If I disconnect the DC input the counter works fine and the binary count can be seen on the indicators on the first page.
    Any help would be greatly appreciated.
    Attachments:
    D Flip Flop Counter - count to 8 - NAND.ms13 ‏375 KB

    Hi techdude101,
    take a look at this document here and try some of the steps towards the bottom. 
    I found changing the RELTOL tolerance to 0.01 allowed your simulation to run okay. 
    Hope that helps!
    Charlotte N. 
    Applications Engineer
    Applications Engineer, NI UK & Ireland

  • Problem building J-K Flip-Flop out of gates and other circuits

    Hey
    I've been having problems with Multisim 11.0 when ever I try building a J-K Flip-Flop out of gates .
    The simulation stops at the fourth clock and doesn't want to set Q low, I've seen the error in other design were multisim  doesn't want to do the logic operations.
    Multisim seems to have problem were whenever there is a wire that splits from an outputs to two inputs, I've used the measurement probe on an other design and it shows that when ever there is a spilt the simulation it say its state is unknown...... Well I jus found out that when I put a probe on the schematic and status the simulation then it works perfectly 
    The picture should explain a lot more 
    I hope you can understand what my problem is 
    If I could get a solution to This problem(s) it would be great because I would like to be able to make more circuits without using several hours of trouble shooting only to come to the conclusion that it should probably work even though the simulation says no...
    This would save a lot of time when I'm building those circuits in school and I would be able to make bigger circuit simulation 
    No matter how clever and complete your research is, there is always someone who knows more.
    Attachments:
    JK flip flop.ms11 ‏295 KB

    Wasn't the design file attached?
     I'll try to attach all the design just to be sure...
    But the design that I really wish to get working correctly is the JK flip flop
    No matter how clever and complete your research is, there is always someone who knows more.
    Attachments:
    Circuit Design Suite 11.0.zip ‏468 KB

  • How can I construct a flip flop or other similar VI?

    Hi all,
    I am trying to develop a hardware simulator and the hardware has some feedback in it. For starters, I'm trying to make a simple D flip flop. I can do this using a while loop and shift registers or a feedback node, but I have to make the module non-reentrant so that it stores the internal state between calls.
    The problem with this is that I want to be able to put multiple flip flops on a diagram and if the VI is non-reentrant, which I have to do to use functional global variables, they all wind up sharing the same internal state, which is unacceptable. But of course, I can't make it reentrant, otherwise the next time I excute the flip flop VI, it won't be in the right state.
    It seems that LabView needs a way to generate a VI that is re-entrant, but yet holds it's internal state on a PER-INSTANTIATION basis.
    Any ideas?
    Thanks,
    Jason

    JasonWB wrote:
    Thanks - this seems to be working. I have an associate who claims he needs to change the name of the VI, even if it IS reentrant - I am looking into that. Thanks much for the help! I was getting confused with functional globals, thinking that was what I needed. So, I assume that as long as the particular instantiation is loaded into memory, it will hold all internal values in shift registers?
    Your associate may be seeing something that could be tricking him into thinking that. Like if he is initializing the shift registers outside the loop, then the registers will not hold the previous value because they get re-initialized on each run. This has nothing to do with it being reentrant, it's just doing what it's wired to do.
    Functional Globals are actually just subVIs that are not reentrant so that they can share data the same way a regular variable does.
    And you're correct in that as long as the reentrant is in memory, the values in it's shift registers will hold.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Flip Flop from Safari to Finder

    I don't now if this is the correct place to pose this question. Sometimes after I reboot, my Macbook flips screens from Safari to Finder about every 5 seconds. I guess it eventually stops because it's not doing it. I am on DSL, but I disconnected and it still continued to flip flop.

    This is likely Google Drive. Try quitting it for now, or going to its preferences and then unchecking the option to show sync icons and the right click menu. This should prevent the problem from happening until an update is available from Google.

  • Why do boolean indicator outputs toggle when true is written repeatedly?

    Hi,
    I'm using an LED boolean indicator in a sub vi connected to an output terminal.
    If TRUE is repeatedly written to it then it toggles between ON and OFF as though it were a push button switch and each TRUE received was someone pushing the switch.
    If I disconnect it from the output terminal then it behaves as expected, staying ON if TRUE is repeatedly received.
    Why does it do this, how can I fix it?
    Also, how can I turn all breakpoints off collectively without removing them?
    Thanks,
    Dave G
    (LabView V7.0)

    Hi Dave,
    go to File>>VI Porperties>>Execution and check if "Clear indiators if called" is checked.
    If this is checked it clears the indicator when the VI is called. If you set the value to TRUE this value will be given back to the calling VI.
    This behaviour was introduced to allow simpler programming. Think of a programm with various cases. There is only one case where you want to set the indicator to TRUE. If you haven't the above flag you need to set it to FALSE in all other cases. This forces to move the terminal outside of the case and to wire a lot of FALSE constants to the tunnel (nowadays we have the "use default if unwired" mechanism which makes the flag unnesseccary).
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • How to switch booleans whithin a loop to 0 when stop is hit

    I am trying to write a program than can send digital signal to an external oscilloscope. I am using NI-USB-6008. The program runs but when I hit "STOP" button (while the On/Off signal's boolean switch is on) the oscilloscope still shows an ON signal.
    The problem: How to switch the boolean to Off immediately when I press STOP?
    I tried using "Clear Task" and "joining the STOP button with the boolean switch but nothing change. Please find attached my program.
    Solved!
    Go to Solution.
    Attachments:
    DigOut.vi ‏18 KB

    altenbach wrote:
    Jeff Bohrer wrote:
    since you are looking at error status in the loop conditional logic I would recommend putting a second write outside the loop to garantee the write happens when exiting on error. Additionally, add an error handler after the clear task .
    Depending on what the error was, the last write might fail inside or outside the loop,   Exactly- and the most compelling reason to add an error handler
    so there is no real difference to my suggestion.  Except the user is notified of the error and that the hardware may not be in the expected state
    You would also need to clear the error before the last write outside else it would not do much anyway..Pssst it was or more correctly the write outside was not passed the error out from the loop and a merge errors is used to pass on the error information
    Jeff

Maybe you are looking for

  • Extra columns in ALV report

    Hi there, I added a column to an existing alv report which uses method 'set_table_for_first_display' to display the output. The method is called via: grid1              TYPE REF TO cl_gui_alv_grid,     CALL METHOD grid1->set_table_for_first_display  

  • Deleting photos from iphoto after transferring to ext hd

    Have seen other questions close to mine but not exact same. Hope someone can help. I have backed up all my photo's onto an external drive (actually 2 drives - 1 for current back up 1 for prev backup for redundancy). Now I try and to delete photo's in

  • CAN'T FIND DRIVER FOR AT-FBUS NI-FBUS FOR WINDOWS 2000

    Trying to load software for AT-FBUS for Windows 2000. The only drivers that I can find are PCMCIA-FBUS and PCMCIA-FBUS/2. Are these the drivers for my at machine??

  • Please Suggest on this(Query Designer)

    Hi ALL,    I want to design reports from one Query as shown below other           Cost of setup              (In US$) Items                  Market Price       Discount         Construction cost     10                    8                     Buildin

  • Ios 6.0.2 introduces keychain bug?

    Since I updated to iOS 6.0.2, I've experienced problems with some apps that can't seem to remember password credentials after each reload. I have to RE-ENTER the login credentials repeatedly. What a pain! iOS just can't seem to remember Twitter passw