How to use delay using boolean inputs

dear sir
 I have created a AND logic where when both inputs are high using boolean switches output  should become high  green led should glow after 5seconds and other than it output should be false red led will glow. basically I want to use delay function .I am attaching file
thanking you
regards
kn
Solved!
Go to Solution.
Attachments:
try1.vi ‏8 KB
try.vi ‏38 KB

kavharshre wrote:
sir I am attaching the solution for boolean.Any improvements or suggestions.
First of all, your front panel and diagram are way too big for this VI. Resize them to a reasonable size.
As already mentioned, that "AND TRUE" is just silly.
The upper boolean output of the inner loop is the same for both cases, thus it does not belong in the inner case structure at all.
All you need is a single TRUE diagram constant. Configure the output tunnels to "use default if unwired".
Try to keep your wires straight.
 Avoid crossing wires unless necessary
Change the labels of your controls and indicators to something logical and intuitive. Self-documenting!
Here's a literal rewrite.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
try3MOD.vi ‏8 KB

Similar Messages

  • How to use boolean operator to get count

    Hi All,
    In my query i need to add a field Count which shows number.
    Meaning,
    Column A   ColumnB ColumnC  Count
    100               50            0            2
    55                60             76         3
    79                0               0           1
    meaning from all three column only two has values then Count should show 2. etc....
    any suggestion how to use boolean expression here ?
    or anyother way to display Count ?
    thanks,
    KS

    Hi thanks for idea.
    boolean didnt work here. the formulau sugested worked...
    But i wrote formula for the Count --> COUNT("overtime") and for the Count property I selected Calculate Result As --> Summation fo Rounded Values
    so the output is as follows:
    i had data for 3 payperiods
    Count  (1st 3 columns)                    overall result(last Column)
    200801     200802     200803           
    1                 0             1                         2
    1                1              1                         3
    0                1             0                         1
    Now the out put i wanted is in the last column -Result column.
    I dont want Count column to be display like this. it is showing values instead of total. any this i should change for this?
    thanks,
    KS

  • How to use Create input request Activity

     Hi,
     I want to get inputs from the users .
     I want to display a form were user can select a input from drop down list.
     That selected item i want to store it in a variable and use across the flow.
     How to do that using create input request or is there any other way to do that.

    You should be using "Input Request" to do what you are trying to do.
    Add "Create Input Request" to your workflow
    Configure the question you want the user to see in the Web Console. For example, "Select make of your dream car"
    Add "questions" to your input request. For the "drop-down" selection, chose to add new question of type "Select". This will bring up the dialog box that will allow you to configure the unique ID for your question, the free form text (label) and the list of selection choices to show in the drop-down.
    In the activities that follow "Create Input Request" you can retrieve the actual values that the user chose/typed by looking at the values in the [Workflow.Create Input Request.Task.Questions] table property. It has several columns: Id, Question, Value (that correspond to the fields you've configured)
    If you have Input request with several questions, you can use Select from Table activity to choose the specified question (by ID) that you want the value for. If you have only one question in the input request, you can get to the value (entered by the end user) by referencing this property [Workflow.Create Input Request.Task.Questions.First Row.Value]

  • How to use boolean?

    I now boolean is a data type that returns either true or false but i dont really know how to use it. Can someone please explain it for me with some common examples or codes would be highly appreaciated?
    One more question, how do you use boolean isDigit(char ch) or boolean isLetter(char ch)?
    Thanks

    public static jePrastevilo(int number){
    for(int
    int deljitelj=2;deljitelj<number;deljitelj++){
                        if(number%deljitelj==0)
                             return false;
                        else return true;
    Why this doesn't work? Retun type required?You need to make sure that the method declares that it is returning a boolean.
    i.e. public static boolean jePrastevilo(int number)
    Also think about what happens when number is less than 2?

  • How to use Boolean values from 2 different sources to stop a while loop?

    I am working on a program for homework that states E5.4) Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. Be sure to include the Time Delay Exress Vi so the user has time to press the stop botton. 
    I am doing this right now but it seems as though I can only connect one thing to the stop sign on th while loop. It won't let me connect a comparision of N and the iterations as well as the stop button to the stop sign on the while loop. So how would I be able to structure it so that it stops if it receives a true Boolean value from either of the 2 sources (whichever comes first)? 
    Basically, I cannot wire the output of the comparison of N and iterations as well as the stop button to the stop button on the whlie loop to end it. Is there a solution?
    Thanks!
    Solved!
    Go to Solution.

    Rajster16 wrote:
    Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. 
    Look in the boolean palette for something similar to the word hightlighted in red above.
    LabVIEW Champion . Do more with less code and in less time .

  • How to use Action/Input maps

    It seems to me that the move to sharing actions menus, buttons, and other components is a logical one, given that it is desirable to have all references to the action reflect its enabled state.
    The question that arises is: which ActionMap object to use as the central store? Do you create your own and pass it on somewhere?
    And, if you try to do anything with homegrown InputMaps then the components stop seeing the events. I wish there was a definitive YOU MUST DO IT THIS WAY tutorial.
    Why is there no factory API that can create UI components pre-attached to actions and with accelerators or mnemonics already set? Then we would not need to write half the code we do now. My solution:
    public class ComponentFactory {
       ActionMap myMap;
       public ComponentFactory(ActionMap map) {
          myMap = map;
       public JButton createButton(String actioncommand) {
           Action a = myMap.get(actioncommand)
           if(a==null)
              return null;
           return new JButton(a);
       public JMenuItem createMenuItem(String actioncommand) {
        // etc...
       public void setAction(Action a) {
           myMap.put(a.getValue(ACTION_COMMAND_KEY),a);
       public void setEnabled(String actioncommand, boolean state) {
           Action a = myMap.get(actioncommand);
           if(a!=null)
               a.setEnabled(state);
    }Is there any concensus as to the best way to handle ActionMaps/InputMaps?

    Hugh,
    >
    The tutorial is a touch short on this subject, whilst
    it is good on how to create and use actions with
    toolbars and the like, the section on InputMaps and
    ActionMaps is far too brief to get the wider picture.
    The API docs on the same is about one paragraph's
    worth.okay, I just checked the tutorial - it's a bit short on the inputMap/actionMap indeed.
    >
    You are mixing up two different issues:
    a) customize a button with an action
    b) bind a keyStroke to an action for an arbitrary
    jComponent
    a) has nothing to do with b)If b) has nothing to do with a) why have MNEMONIC_KEY
    and ACCELERATOR_KEY on the action?Hmm... where do you see a contradiction to my statement? Those keys are part of a) as they are used for customization of the AbstractButtons: the button's mnenmonic/accelerator properties are set to the corresponding values of the action. This propertyChange triggers an update of the keyBinding to the button's "pressed"/"doClick" actions as registered in the actionMap. They are never used (at least not internally by Swing) for b)
    Historically the action is older than the inputMap/actionMap: basically it's an ActionListener (which is more or less a command pattern) plus some (view) state. This "plus" was designed right in the beginning of Swing for a) to enable state sharing between different "buttons" but not really integrated until version 1.4. parallel to that the need for a general mechanism of binding between keyStrokes and "commands" became obvious and inputMap/actionMap were introduced in 1.3. The only action state that's needed for this mechanism to work is the enabled property. All values are ignored - so currently they somehow appear to be overloaded in the context of the inputMap/actionMap. Personally I think they are very powerful because of this extra flexibility.
    >
    There is still not a single diagram; and I maintain
    that it is less than useful to beginners who are not
    familiar with the terminology used. Well, IMO diagrams are not everything - I still think it much easier to understand than the dnd spec or the focus spec f.i.
    >
    you are free to use whatever object you want as akey
    - write a utility method to use the name, if feellike
    doeing so. There is nothing in the framework that
    would single out the name as "the" key to use, The keybindings document specifically states:
    "New actions can be added to a component equally
    easily."
    "The conventional key for an action is it's
    name." If there is a conventional way then it
    should be encouraged with an appropriate API. I get your point. And I definitely agree on following a convention if there is one. Except when the convention is quite immature (to formulate mildly) - and not even followed by Swing internally: most of the default actions registered in the actionMap don't even have a name, the binding is done by string literals ... duplicated in at least two places: the XXLookAndFeel and the ui-delegates.
    Greetings
    Jeanette

  • How to use boolean transition as trigger 0to1= 1impulse, 1to0= 0 impulse

    Hello!
    I have a boolean button HVenable which will be used to enable/disable the high voltage output of a voltage source.
    The problem:
    I only need one True value to send the Open HV command
    and one False value to send the Close HV command; the boolean button sends a continuous train of True values when it is on and a continuous train of F values when off.
    How can I convert a transition from off to on / F to T into a single 1 impulse or T impulse 
    and the transition from on to off/ T to F into a single 0 impulse or T impulse.
    What instrument converts a transition from F to T into a 1 or T impulse
    and a transition from T to F into a 0 impulse (different from the first kind of transition)?
    In the attached test vi, such an instrument would be inserted between HVenable button and Select;
    when True it will send an open command to visa O 01 CR
    when False  it will send a close command O 00 CR.
    Solved!
    Go to Solution.
    Attachments:
    bultrig.vi ‏11 KB

    First, Do Not Use Continuous Run to make code run more than once! Place the repeating code inside a loop. Continuous Run is a troubleshooting tool to be used (sparingly) during development.
    The key to your issue is to use the Event structure. A Value Change event on the HVenable boolean will do exactly what you want.
    You do not need Type Cast and all the conversions. Set string constants to '\' Codes display mode and enter the data you want.
    Lynn
    Attachments:
    bultrig.2.vi ‏11 KB

  • How to use HDMI input on A520

    I Have an a520 i have an xbox 360 that i want to display on this PC, not sure how to display, can somebody provide specific steps on how to get the 360 to display using the HDMI input on the pC?
    THanks

    We purchased the hdmi adapter and were able to get audio but no video...returned it for a replacement and the same thing happened.  Any suggestions? I know the hdmi cable is good because I use it with my samsung galaxy and it works fine both audio and video. 

  • Having trouble figuring out how to use trigger inputs as a general purpose input.

    I'm trying to use "Trigger 1" as a general purpose input to indicate the status of external circuitry. I can't seem to get the "Read High-Speed Capture Status" to indicate anything. I'm using the "Configure High-Speed Capture" VI with the capture mode set to Inverting Digital Input, and that VI feeds into a Do-While loop which contains the "Read High-Speed Capture Status" VI, which has the Ret Vect set to 0. I see from the online help that the High-Speed Capture function is available on Servo and Closed-Loop stepper systems, which I suppose is to enable the ability to read the position of the encoders. I'm using an open loop stepper system, so are these High-Speed Capture fun
    ctions unavailable even though I'm looking only for status (Trigger 1), and not concerned with reading position? Thanks in advance, Rob.

    Thanks for the answer Ken. I'm going to try a different workaround. The global was too slow, and I think I'll break my subVI into two parts. I'll create a sub that has all the setup stuff in it, then embed the actual "check trigger status" loop in the main VI. The loop contains only 2 or 3 nodes. Too bad LabView works this way. I can see one reason it should, but another larger reason it shouldn't. Wishlist.... Oh, speaking of wishlist, I like the improvements that 6.0 has brought, but one thing still bugs me. There's no way to have LabView remember the place to look for files when it's first started. It defaults to "My Documents", which should be, as all LabView programers know "LabVIEW6\user.lib" (or whatever). Of course, once th
    ere, LabView remembers for that session. Next time it's started, back to "My Documents" again. How 'bout fixing the "Options", "Path" settings so that it will actually remember the path set? Am I missing something here, or does it have anything to do with the fact that we're using Windows 98? My buddy's using NT, and his works the same. Is there a way around this? TIA, Rob.

  • How to use boolean push button as a constant to add to other values

    Hello all, I am trying to use a boolean OK button and a constant to make something similar to the calculator project I've read about in other posts. I labled the button $1.00, $0.25, ......  So on.  I just want to add the value to an indicator every time I push the button.
    The closest I can get is the vaue is displayed while I hold the button in and the it goes to 0 as I realese it. I want it to add up each time its pressed.
    Thanks in Advance
    Kevin
    Solved!
    Go to Solution.

    Hi Kevin, this is Paul from Applications Enginering at NI.  Try something like in my attachment.  You can use case type statements to evaluate whether a button was pressed, then assign that true case a value.  Good luck with it
    Paul Davidson
    Sound and Vibration Software Staff Product Support Engineer
    National Instruments
    Attachments:
    Dollars and Cents.png ‏20 KB

  • How to use the input entered in report parameters form & use it in a field in a report parameter.

    Hi, I'am creating a new report, which is a combination of 'form_letter & tabular' style.
    I have also created a Report Parameter with 2 inputs, that is 'to_date' & 'from_date'.
    The value that will be entered in 'to_date' & 'from_date' in the parameter_form, must get displayed in the report.
    So for this, I created a field for 'to_date' & added code for it in pl/sql editor.
    code is as below:
    function F_TO_DATEFormatTrigger return boolean is
      f_to_date date;
    begin
      f_to_date := :PF_P_TO_DATE;  // ASSIGNING VALUE TO FIELD ( f_to_date) FROM INPUT OF REPORT PARAMETER (PF_P_TO_DATE) .
      return (f_to_date);
    end;
    BUT I'M GETTING ERROR " REP-0730 THE FOLLOWING BIND VARIABLE IS NOT DEFINED: PF_P_TO_DATE.
    I tried to decode the error, but I think the problem is different. (The above code works only if "PF_P_TO_DATE" was a part of query statement, that is one of the columns in database, but PF_P_TO_DATE is a parameter). So can anybody please help me with how can I take the value from parameter input & display it on the field of the report?
    Thank You.

    Hi Vijetha,
    Create a formula column and return the date you need and asign the formula column to a field in paper layout.
    here is the example query
    function CF_to_dateFormula return Date is
    begin
       return (:to_date); -------:to_date is that you get as a parameter
    end;
    Hope this will help
    Regards
    su.gi

  • How to use simple input command ??

    I am tired of trying to find an easy to understand source to implement simple INPUT command ( equivalent to cin>> and scanf() , in c++ and c as i m good in those two)
    when print can be System.out.println(--) , then y does read have to be so complicated ?
    Help me out guys !!!

    package palindrome;
    import java.io.DataInputStream;
    * @author Pulkit
    class Main {
    public static void main(String[] args) {
    int num;
    System.out.println("Enter a number to check if it is palindrome");
    // System.in.readline(num);
    DataInputStream ob = new DataInputStream(System.in);
    Now the remark line is wat i tried to do, as i thought it should follow the print method ( System.out.print ) that one.
    But in a book , i see its done just the other way, just below the rem line.
    I just need ur help to explain me as to how that line has been put, i.e. the syntax of that line.

  • How to use standard Search Input Help (return 2 data code and desc) ?

    Hi,
    Please advise how to use standard Input Help provided by SAP and return 2 data (code and description) ? because the standard Input Help only return the code only ?
    Thank You and Best Regards
    Fernand

    >
    Saket  Abhyankar wrote:
    > Hi,
    >
    > I think you need to go for 'Search Help Exit' or OVS.
    >
    > Regards,
    >
    > Saket.
    That is not true that this is the only way.  The standard Data Dictory based search help can return more than one value as long as there are multiple exporting values defined in the search help, the search help is attached to a Data Dictionary Structure, and this same data dictionary structure is used as the source of the context node. You can read more about this in the online help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/9f724642314aabe10000000a42189b/frameset.htm
    The Note section under Integration:
    If an input help structure is stored in a field in the ABAP Dictionary, and if you want to use the field mapping of search help parameters stored in the ABAP Dictionary as the field name for the structure for your Web Dynpro input help, then map your context nodes to this structure. This ensures that all components of the structure are available dynamically at runtime as attributes of the node.
    If the context node is not mapped to the structure, the data element's input help can be used if there is one.

  • How to enter text in text input box using virtual keyboard in flex application

    Re: how to enter text in text input box using virtual keyboard in flex application
    hi,
    im using flash builder 4,
    i  designed virtual keyboard, i have to update the text in text input box  continously by using virtual keyboard.
    i used button events.i did  some mistake there.
    can some one help me out of tat.
    thanks  in advance.
    i have included my mxml program with this.
    virtualkeyboard.mxml
    <?xml  version="1.0" encoding="utf-8"?>
    <s:Application  xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955"  minHeight="600" creationComplete="initfunc()">
         <fx:Script>
            <![CDATA[
                import  mx.controls.Alert;
                private function initfunc():void
                    b1.addEventListener(MouseEvent.CLICK,handleEvent);
                     b2.addEventListener(MouseEvent.CLICK,handleEvent);
                     b3.addEventListener(MouseEvent.CLICK,handleEvent);
                     b4.addEventListener(MouseEvent.CLICK,handleEvent);
                     b5.addEventListener(MouseEvent.CLICK,handleEvent);
                     b6.addEventListener(MouseEvent.CLICK,handleEvent);
                     b7.addEventListener(MouseEvent.CLICK,handleEvent);
                     b8.addEventListener(MouseEvent.CLICK,handleEvent);
                     b9.addEventListener(MouseEvent.CLICK,handleEvent);
                     b10.addEventListener(MouseEvent.CLICK,handleEvent);
                     b11.addEventListener(MouseEvent.CLICK,handleEvent);
                     b12.addEventListener(MouseEvent.CLICK,handleEvent);
                     b13.addEventListener(MouseEvent.CLICK,handleEvent);
                     b14.addEventListener(MouseEvent.CLICK,handleEvent);
                     b15.addEventListener(MouseEvent.CLICK,handleEvent);
                     b16.addEventListener(MouseEvent.CLICK,handleEvent);
                     b17.addEventListener(MouseEvent.CLICK,handleEvent);
                     b18.addEventListener(MouseEvent.CLICK,handleEvent);
                     b19.addEventListener(MouseEvent.CLICK,handleEvent);
                     b20.addEventListener(MouseEvent.CLICK,handleEvent);
                     b21.addEventListener(MouseEvent.CLICK,handleEvent);
                     b22.addEventListener(MouseEvent.CLICK,handleEvent);
                     b23.addEventListener(MouseEvent.CLICK,handleEvent);
                     b24.addEventListener(MouseEvent.CLICK,handleEvent);
                     b25.addEventListener(MouseEvent.CLICK,handleEvent);
                     b26.addEventListener(MouseEvent.CLICK,handleEvent);
                     b27.addEventListener(MouseEvent.CLICK,handleEvent);
                     b28.addEventListener(MouseEvent.CLICK,handleEvent);
                     b29.addEventListener(MouseEvent.CLICK,handleEvent);
                     b30.addEventListener(MouseEvent.CLICK,handleEvent);
                     b31.addEventListener(MouseEvent.CLICK,handleEvent);
                     b32.addEventListener(MouseEvent.CLICK,handleEvent);
                     b33.addEventListener(MouseEvent.CLICK,handleEvent);
                     b34.addEventListener(MouseEvent.CLICK,handleEvent);
                     b35.addEventListener(MouseEvent.CLICK,handleEvent);
                     b36.addEventListener(MouseEvent.CLICK,handleEvent);
                     b37.addEventListener(MouseEvent.CLICK,handleEvent);
                     b38.addEventListener(MouseEvent.CLICK,handleEvent);
                     b39.addEventListener(MouseEvent.CLICK,handleEvent);
                     b40.addEventListener(MouseEvent.CLICK,handleEvent);
                     b41.addEventListener(MouseEvent.CLICK,handleEvent);
                     b42.addEventListener(MouseEvent.CLICK,handleEvent);
                     b43.addEventListener(MouseEvent.CLICK,handleEvent);
                     b44.addEventListener(MouseEvent.CLICK,handleEvent);
                     b45.addEventListener(MouseEvent.CLICK,handleEvent);
                     b46.addEventListener(MouseEvent.CLICK,handleEvent);
                     b47.addEventListener(MouseEvent.CLICK,handleEvent);
                     b48.addEventListener(MouseEvent.CLICK,handleEvent);
                     b49.addEventListener(MouseEvent.CLICK,handleEvent);
                     b50.addEventListener(MouseEvent.CLICK,handleEvent);
                     b51.addEventListener(MouseEvent.CLICK,handleEvent);
                     b52.addEventListener(MouseEvent.CLICK,handleEvent);
                     b53.addEventListener(MouseEvent.CLICK,handleEvent);               
                public function handleEvent ( e :  MouseEvent ) : void
                    var a:String=  e.target.name ;
                    Alert.show(e.target.name);
                   var b:String=null;
                    switch(a)
                        case "Button20":
                           b=textbox.text;
                            //textbox.text="a";
                             textbox.text=b+"a";
                            break;
                       case "Button21":
                            //textbox.text="b";
                           textbox.text=b+"b";
                           break;
                       default:
                           //textbox.text="s";
                            textbox.text=b+"s";
            ]]>
        </fx:Script>
        <s:Panel  x="43" y="82" width="527" height="213">
          <mx:Button  x="71" y="86" id="b1" label="1" width="30" height="24"/>
             <s:Button x="180" y="86"  id="b2" label="5" width="30"  height="24"/>
            <s:Button x="127" y="86"  id="b3"  label="3" width="30" height="24"/>
            <s:Button x="99"  y="86"  id="b4" label="2" width="30" height="24"/>
             <s:Button x="323" y="86"  id="b5" label="0" width="30"  height="24"/>
            <s:Button x="294" y="86"  id="b6"  label="9" width="30" height="24"/>
            <s:Button x="265"  y="86"   id="b7" label="8" width="30" height="24"/>
             <s:Button x="237" y="86"  id="b8" label="7" width="30"  height="24"/>
            <s:Button x="209" y="86"  id="b9"  label="6" width="30" height="24"/>
            <s:Button x="42"  y="86"  id="b10" label="`" width="30" height="24"/>
             <s:Button x="382" y="86" id="b11" label="=" width="30"  height="24"/>
            <s:Button x="353" y="86"  id="b12"  label="-" width="30" height="24"/>
            <s:Button x="410"  y="86"  id="b13" label="back" width="76" height="24"/>
             <s:Button x="157" y="86"  id="b14" label="4" width="30"  height="24"/>
            <s:Button x="43" y="109" id="b15"  label="tab" width="66" height="24"/>
            <s:Button x="105"  y="109"  id="b16" label="q" width="31" height="24"/>
             <s:Button x="247" y="109"  id="b17" label="y" width="30"  height="24"/>
            <s:Button x="303" y="109"  id="b18"  label="i" width="31" height="24"/>
            <s:Button x="361"  y="110"  id="b19" label="p" width="34" height="23"/>
             <s:Button x="394" y="109"  id="b20" label="[" width="31"  height="24"/>
            <s:Button x="191" y="109"  id="b21"  label="r" width="34" height="24"/>
            <s:Button x="424"  y="109"  id="b22" label="]" width="31" height="24"/>
             <s:Button x="222" y="109"  id="b23" label="t" width="31"  height="24"/>
            <s:Button x="161" y="109"  id="b24"  label="e" width="31" height="24"/>
            <s:Button x="133"  y="109"  id="b25" label="w" width="31" height="24"/>
             <s:Button x="332" y="109"  id="b26" label="o" width="31"  height="24"/>
            <s:Button x="275" y="109"  id="b27"  label="u" width="31" height="24"/>
            <s:Button x="220"  y="133"  id="b28" label="g" width="31" height="24"/>
             <s:Button x="424" y="132"  id="b29" label="enter" width="62"  height="24"/>
            <s:Button x="43" y="132"  id="b30"  label="caps" width="66" height="24"/>
            <s:Button x="275"  y="133"  id="b31" label="j" width="42" height="23"/>
             <s:Button x="314" y="132"  id="b32" label="k" width="31"  height="24"/>
            <s:Button x="133" y="133"  id="b33"  label="s" width="31" height="23"/>
            <s:Button x="161"  y="133"  id="b34" label="d" width="31" height="23"/>
             <s:Button x="250" y="133"  id="b35" label="h" width="31"  height="23"/>
            <s:Button x="105" y="133"  id="b36"  label="a" width="31" height="23"/>
            <s:Button x="191"  y="133"  id="b37" label="f" width="31" height="23"/>
             <s:Button x="342" y="132"  id="b38" label="l" width="31"  height="24"/>
            <s:Button x="152" y="154"  id="b39"  label="x" width="31" height="24"/>
            <s:Button x="353"  y="154"  id="b40" label="." width="31" height="24"/>
             <s:Button x="325" y="154"  id="b41" label="," width="31"  height="24"/>
            <s:Button x="294" y="154"  id="b42"  label="m" width="31" height="24"/>
            <s:Button x="259"  y="154"  id="b43" label="n" width="37" height="24"/>
             <s:Button x="236" y="154"  id="b44" label="b" width="31"  height="24"/>
            <s:Button x="211" y="154"  id="b45"  label="v" width="31" height="24"/>
            <s:Button x="181"  y="154"  id="b46" label="c" width="31" height="24"/>
             <s:Button x="122" y="154"  id="b47" label="z" width="31"  height="24"/>
            <s:Button x="380" y="154"  id="b48"  label="/" width="31" height="24"/>
            <s:Button x="368"  y="132"  id="b49" label=";" width="31" height="24"/>
             <s:Button x="396" y="132"  id="b50" label="'" width="31"  height="24"/>
            <s:Button x="43" y="154"  id="b51"  label="shift" width="82" height="24"/>
            <s:Button  x="407" y="154" id="b52" label="shift" width="79" height="24"/>
             <s:Button x="455" y="109"  id="b53" label="\" width="31"  height="24"/>
        </s:Panel>
        <s:TextInput  x="161" y="27" id="textbox" width="253"/>
    </s:Application>
    regards,
    saran r

    hi,
    how to code for these buttons "control,alt,delete,insert and spacebar".
    can u help me how to program?
    i have attached the mxml code with this,
    virtualkeypad1.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   creationComplete="application1_creationCompleteHandler(event)" viewSourceURL="srcview/index.html">
        <fx:Script>
            <![CDATA[
                import flash.utils.getQualifiedSuperclassName;
                import mx.events.FlexEvent;
                private var inpText:String = 'inp1';
                private var shiftState:Boolean = false;
                private var capsState:Boolean = false;
                protected function keyboard_clickHandler(event:MouseEvent):void
                    this[inpText].text = this[inpText].text+(event.currentTarget as Button).label;
                    if (shiftState == true) shift_clickHandler(null);
                protected function caps_clickHandler(event:MouseEvent):void
                    capsState = !capsState;
                    if (capsState == true)
                        currentState = "SHIFTED" else currentState = "PRIMARY";
                protected function tab_clickHandler(event:MouseEvent):void
                    this[inpText].text = this[inpText].text+"    ";
                protected function shift_clickHandler(event:MouseEvent):void
                    shiftState = !shiftState;
                    if (shiftState == true)
                        currentState = "SHIFTED" else currentState = "PRIMARY";
                protected function enter_clickHandler(event:MouseEvent):void
                    this[inpText].text = this[inpText].text+"\n";
                protected function backspace_clickHandler(event:MouseEvent):void
                    var tmpStr:String = this[inpText].text;
                    this[inpText].text = tmpStr.substr(0,tmpStr.length-1);
                protected function application1_creationCompleteHandler(event:FlexEvent):void
                    inp1.setFocus();               
                protected function focus_enterHandler(event:MouseEvent):void
                    inpText = event.currentTarget.id;
            ]]>
        </fx:Script>
        <s:states>
            <s:State name="PRIMARY"/>
            <s:State name="SHIFTED"/>
        </s:states>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:TextInput id="inp1" y="36" width="151" horizontalCenter="0" click="focus_enterHandler(event)" y.PRIMARY="239" horizontalCenter.PRIMARY="42" width.PRIMARY="199" height.PRIMARY="31"/>
        <s:Group id="keyboard" width="661" height="184" horizontalCenter="0" y="300" focusEnabled="false">
            <s:Button x="5" y="5" label="~" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="`"/>
            <s:Button x="49" y="5" label="!" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="1"/>
            <s:Button x="93" y="5" label="@" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="2"/>
            <s:Button x="137" y="5" label="#" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="3"/>
            <s:Button x="181" y="5" label="$" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="4"/>
            <s:Button x="225" y="5" label="%" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="5"/>
            <s:Button x="269" y="5" label="^" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="6"/>
            <s:Button x="313" y="5" label="&amp;" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="7"/>
            <s:Button x="357" y="5" label="*" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="8"/>
            <s:Button x="401" y="5" label="(" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="9"/>
            <s:Button x="445" y="5" label=")" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="0"/>
            <s:Button x="489" y="5" label="_" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="-"/>
            <s:Button x="533" y="5" label="+" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="="/>
            <s:Button x="577" y="5" label="Backspace" height="43" width="80" fontSize="11" fontWeight="bold" click="backspace_clickHandler(event)"/>
            <s:Button x="5" y="48" label="Tab" height="43" width="67" fontSize="12" fontWeight="bold" click="tab_clickHandler(event)"/>
            <s:Button x="72" y="48" label="Q" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="q"/>
            <s:Button x="116" y="48" label="W" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="w"/>
            <s:Button x="160" y="48" label="E" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="e"/>
            <s:Button x="204" y="48" label="R" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="r"/>
            <s:Button x="248" y="48" label="T" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="t"/>
            <s:Button x="292" y="48" label="Y" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="y"/>
            <s:Button x="336" y="48" label="U" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="u"/>
            <s:Button x="380" y="48" label="I" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="i"/>
            <s:Button x="424" y="48" label="O" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="o"/>
            <s:Button x="468" y="48" label="P" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="p"/>
            <s:Button x="512" y="48" label="{" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="["/>
            <s:Button x="556" y="48" label="}" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="]"/>
            <s:Button x="600" y="48" label="|" height="43" width="57" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="\"/>
            <s:Button x="5" y="91" label="CapsLock" height="43" width="80" fontSize="12" fontWeight="bold" click="caps_clickHandler(event)"/>
            <s:Button x="85" y="91" label="A" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="a"/>
            <s:Button x="129" y="91" label="S" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="s"/>
            <s:Button x="173" y="91" label="D" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="d"/>
            <s:Button x="217" y="91" label="F" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="f"/>
            <s:Button x="261" y="91" label="G" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="g"/>
            <s:Button x="305" y="91" label="H" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="h"/>
            <s:Button x="349" y="91" label="J" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="j"/>
            <s:Button x="393" y="91" label="K" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="k"/>
            <s:Button x="437" y="91" label="L" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="l"/>
            <s:Button x="481" y="91" label=":" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY=";"/>
            <s:Button x="525" y="91" label="&quot;" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="'"/>
            <s:Button x="569" y="91" label="Enter" height="43" width="88" fontSize="24" fontWeight="bold" click="enter_clickHandler(event)"/>
            <s:Button x="5" y="134" label="Shift" height="43" width="106" fontSize="24" fontWeight="bold" click="shift_clickHandler(event)"/>
            <s:Button x="111" y="134" label="Z" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="z"/>
            <s:Button x="155" y="134" label="X" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="x"/>
            <s:Button x="199" y="134" label="C" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="c"/>
            <s:Button x="243" y="134" label="V" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="v"/>
            <s:Button x="287" y="134" label="B" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="b"/>
            <s:Button x="331" y="134" label="N" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="n"/>
            <s:Button x="375" y="134" label="M" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="m"/>
            <s:Button x="419" y="134" label="&lt;" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY=","/>
            <s:Button x="463" y="134" label="&gt;" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="."/>
            <s:Button x="507" y="134" label="?" height="43" width="44" fontSize="24" fontWeight="bold" click="keyboard_clickHandler(event)" label.PRIMARY="/"/>
            <s:Button x="551" y="134" label="Shift" height="43" width="106" fontSize="24" fontWeight="bold" click="shift_clickHandler(event)"/>
        </s:Group>
    </s:Application>
    thanks in advance,
    saran r

  • 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!"

Maybe you are looking for