Invalid input event for numeric control

Need to catch the event when invalid input being through out, customer doesn't like the notify.
George Zou
http://webspace.webring.com/people/og/gtoolbox

I haven't had a big problem with this, and I plan to continue to use numeric controls instead of making everything strings, but it does seem strange that CVI doesn't catch this.  I like the automatic range checking options, the programmable increment/decrement buttons, and the ease of use.
You can use a quirk in CVI to catch this: if you enter an invalid number like 1.2.3 or 3...14159 or 1-2, CVI triggers EVENT_VAL_CHANGED, but leaves the original number unchanged.  So you can create a case in the callback for the numeric control for EVENT_VAL_CHANGED, and in that case check to see if the value is the same as the previous value.  If it is, assume an invalid input.  EVENT_VAL_CHANGED does not get fired if you just press Enter without changing the value.
There are a couple of limitations or drawbacks to this approach.  It doesn't save your invalid entry, so you have to enter the whole thing again instead of just correcting your mistake.  EVENT_VAL_CHANGED also gets fired if you use Delete or Backspace, even if the number you end up with is the same as the previous.  So this approach will flag that as an invalid entry.
See the attached example.
Attachments:
TestInvalidInput.zip ‏6 KB

Similar Messages

  • Listening events for numeric keys

    Hi,
    How can I listen events for numeric keys without using Canvas?
    I mean I would like to take some actions when user writes something
    on a TextField. My main class is not inherited from Canvas and because of that
    I can't use keyPressed() method to handle these numeric keys.
    Is there a way to handle these events in commandAction() method?

    Hi,
    If u r concerned only about the texfields and if you are using MIDP 2.0 compatible device then try ItemCommandListener.

  • Invalid input syntax for type boolean???? ahhhhhh

    Hey all,
    Has anyone come accross the 'invalid input syntax for type boolean' error - its driving me crazy trying to figure out what is wrong with my function/java code!!!
    The postgres (using 8.1) function is:
    CREATE OR REPLACE FUNCTION selectstaffroles("varchar")
    RETURNS refcursor AS
    $BODY$
    DECLARE
    ResultSet refcursor;
    whereClause ALIAS FOR $1;
    BEGIN
    OPEN ResultSet FOR
    EXECUTE 'SELECT role.* FROM role left join staffrole on staffrole.roleid=role.roleid WHERE ' || whereClause;
    RETURN Resultset;
    END;
    $BODY$
    LANGUAGE 'plpgsql' VOLATILE;
    WhereClause sent via java code =
    c.colStaffRoleStaffID+"="+staff.getUserStaffID() -which basically is staffid=2
    Once this query is executed via the java code i get the 'invalid input syntax for type boolean: "staffid=2" ' error. However if I type select selectstaffroles('staffid=2') using pgAdmin SQL window - no problems!
    ANY HELP or suggestions will be greatly appreciated! - Thanks in advance!
    Eli

    Ahh soz - silly mistake which was corrected pretty much as soon as post was posted!
    Solution:
    Within another method the where clause sent to the database function was enclosed within quotes! Removing quotes = problem resolved!

  • ORA-28232: invalid input length for obfuscation toolkit

    hi,
    i am facing this error when i enterd more then 8 charecter in the input string.
    ORA-28232: invalid input length for obfuscation toolkit
    why i cant user more then 8 charecter for password.?

    Rajnish Chauhan wrote:
    hi,
    i am facing this error when i enterd more then 8 charecter in the input string.
    ORA-28232: invalid input length for obfuscation toolkit
    why i cant user more then 8 charecter for password.?
    28232, 0000, "invalid input length for obfuscation toolkit"
    // *Cause:  Length of data submitted for encryption or decryption is not a
    //          multiple of 8 bytes.
    // *Action: Make sure that the length of the data to be encrypted or decrypted
    //          is a multiple of 8 bytes.since you did not share with us exactly what you did, we can say exactly what you did wrong.
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Menu on right-click for numeric control

    Hello,
    is there a way to program a "menu on right-click" for a control (e.g. numeric), like there is for table controls?
    I'm working with CVI 8.0.1 
    Thanks & Best Regards,
    Greg

    Yes, every control can be added a popup menu with a few instructions.
    Design the menu nar in the UIR editor; do not associate it to any panel
    Load the menu bar when needed with the line menuHandle = LoadMenuBar (0, "myfile.uir", menuBar): by passing 0 as the panel handle it will not be associated to any of them
    In the numeric callback add these instructions:
         switch (event) {
            case EVENT_RIGHT_CLICK:
                // Context menu
               choice = RunPopupMenu (menuHandle, menuBar_Menu, panel, eventData1, eventData2, 0, 0, 0, 0);
                switch (choice) {
                     case menuBar_menu_item1:
                              // menu item handling code
                              break;
                break;
    Passing eventData parameters to RunPopupMenu function ensures that the menu is displayed at the mouse position.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Set initial value for numerical control

    Hello LV users,
    I have a VI that is used to initialize some experimental equiptment. It passes on a cluster of ten or so numerical control DBL integers as parameters. Everytime I open the programe the values are reset back to zero and I have to enter the values back in. Is there any way to set default values for  the controls so I do not have to change them everytime I open the program.
    Thanks 
    Solved!
    Go to Solution.

    Wowden,
    If you want to set default values for multiple numeric control's in your cluster in one go, 
    -Type in the desired default values
    - Right click on your cluster, browse to 'data operations'
    - Choose 'Make current values default. 
     Similarly, if you need to set defaults for  multiple clusters or multiple controls on your front panel,
    - Choose 'Edit' in the menu 
    - Choose "make current values default' (This sets defaults for all controls/constants etc. in one go)
    RaVI

  • Class ID Property value is always 18 - Digital for numeric controls of a cluster

    Why does the Class ID Property Value always return the value of 18 (Digital) for any type of numeric control of a cluster, whether it is a DBL. U32, I8 etc. The Class Value never come backs as 17 (Numeric). Why? What does 17 (Numeric) pertain to?
    Solved!
    Go to Solution.

    This thread really belongs in the LabVIEW forum. In the future,
    please post there, as you posted in the forum that discusses the forum
    software and the forums in general.
    As to your question:
    JayB wrote:
    Is there any way to determine programmatically if the control is a DBL or a I32 besides using the Class ID property?
    See here.

  • Handling event for Tree Control Collapse

    Hi,
    Can any one suggest how to handle an event for 'Tree Node Collapse' . I have checked with all the exised tree events.
    thanks,
    Venu

    Hi Venugopal,
        If you are doing tree control programmin then i can suggest you a approach for tree node collapse and expand.
    for doing this follow these steps.
    1. create a toolbar (use class cl_gui_toolbar), add a button and assign a FCODE to it.
    2. here you register the following the event for the toolbar.
    gs_event-eventid = cl_gui_toolbar=>m_id_function_selected.
    3. here you set the handler for the toolbar events
      SET HANDLER  gref_application->handle_function_selected
                FOR  gref_toolbar.
    4. now in your class for gref_application you write a definition and implementation.
    definition
    handle_function_selected FOR EVENT handle_function_selected OF cl_gui_toolbar IMPORTING fcode.
    implementation
    CASE fcode.
       when 'collapse'.
          CALL METHOD xref_tree->collapse_all_nodes.
    this method might change depending upon the class you use for creating the tree.
    i hope this will help you.
    in case of clarification do get back to me.
    regards,
    Kinshuk Saxena
    PS mark helpful answers

  • Starting event for MQSeries control

    I am new to Integration. I'm testing a simple MQSeries control. I just want the control listen to a q, get the message and put the message on another q.
    What is the starting event for this type of process? Do I have to use a message broker?
    thanks.

    You can use the control only from an already running process. I you need to start a new process, whenever a message arrives in a MQ queue, then use the event generator, which communicates via Message broker events.
    -Kai

  • Invalid input marker for interface range

    I am trying to create a voice lab, I have a 1700 series cisco router and a 3500lx switch.  I have configure the vlans,and trunked fa0/0 on router and fa0/1 on switch, i and unable to create a interface range fastethernet fa0/2 - 24.    I get a invalid input marker  it will not take any command with range in it.  I can see all the ports

    Duplicate post, please post here -
    https://supportforums.cisco.com/thread/2262085?tstart=0
    Jon

  • How to handle events for Tab Control

    Hi,
    I have a Tab control with 4 tabs and I would like when I go to a specific tab all the contents of that tab being updated. Could you please help me with this?
    How should I set the event structure
    Thanks

    Tab Control->Value Change is the event you want.  You can then use a case structure to do whatever you need it to based on the "New Value".
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Any way to limit the input format for string control?

    Hi there,
      I need a control for the user to input some string with only alphabets and no special characters. Also need to control the number of characters to input. I search it and see someone use Xcontrol to achieve that but I really have no idea how to get that. Any other way to get this function works on string input?

    prvs wrote:
    Dear Altenbach,
    The VI that you have posted in (Max8Discard.vi) in Limiting Input String Length
    limits the entry of string control to required length but it doesnt limit the entry of special characters.
    If you have any simple way to do the same it will be very helpful
    Thanks in advance...!!!
    Regards,
    Praveen PRVS
    Just change the check after the Lexical Class function.  If you just want numbers and letters, then use the In Range & Coerce function to check for class numbers 3 through 5.  Play around with the logic some more until you get what you need (I'm thinking that AND should be an OR).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • I need to scan an input string for EOF (control Z) and then view the data that has come in since the last EOF.

    I'm talking to a Furness micromanometer.  It sends a string of three lines formatted as follows:
    Time                 xx:xx:xx xM
    Velocity             xxxxx ft/m
    Temperature    xxx.x degC
    I want to watch the input, and when I see the EOF character (ctlZ), I want to display the three lines of text sent since the last EOF.  Any help is appreciated.

    Lynn, attached is the original vi I wrote months ago.  It works, but occasionally there seems to be a disconnect between the instrument and LabVIEW.  The string received is shown in the upper left corner of the front panel (Micromanometer output) is the string last received.  Then it's parsed out into teh three columns.  AS you can see from the block diagram, I made a rather complex vi, although that was NOT my intent.  Occasionally, as I said, things don't work right.  Instaed of the first line beginning with "Velocity", it might read "city" and then everything is sort of offset, and the data is corrupt.  After closing and reatarting LabView it usually works correctly.  SO, I decided to go with a simpler, less complex approach.  Instead of sending the T to the instrument to trigger it, I simply set the Furness to sample at one second intervals (locally - on its front panel interface)and send its data out on the serial port.  Then I want Labview to monitor the port, and read the data whenever it sees there is date to read.  I don't know if I can use EOF or the start bit, or what.  I just wrote an application like this for another instrument, but I was able to determine the number of bytes in the string (19).  I just used a property node (Bytes at port), compared the numer to 19, and if it was greater than or equal to 19, I read the port. It works great, but I can't seem to get a handle on what I'm doing wrong here.  Anyway, attached is the old vi, as well as the beginning of the new one.  Help??!!!
    Attachments:
    Furness.vi ‏291 KB
    simple.vi ‏75 KB

  • Keyfocus for multiple controls in a cluster of clusters

    Hello friends!
    I have a front panel, which is made up of three tabs. Each tab has one cluster made up of a number of strict type deffed cluster of two numerics. User would be editing these controls. What I want to achieve is that the key focus should move to the appropriate numeric control when the user moves his mouse over it so that the value it contains become highlighted. The way I think it can be done is tediously long (i.e., create a mouse enter event for each control (several hundred of them) and using the control reference, in the event case, set the key focus to true) Is there an easier way to do that.

    Yes you can.
    You have to use the property node from the Application palette & choose the appropriate VI Server Class to get the references of all the Controls/Indicators present on the FP or inside a Cluster & so on...
    See the attached VI.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Refs for Controls.vi ‏5 KB

  • Is it possible to preserve dynamic run-time shortcut menu updates for a control?

    Hello all,
    I have a question about getting control run-time shortcut menus to persist after adding new items.  I am hopeful that I'm simply missing something simple here.
    Known Information
    I understand the use of the "Shortcut Menu Activation?" event (for the control of interest) which provides the relevant control's menu reference for use with the menu VIs.  No problems there.
    Problem
    I start with a control which has an .rtm file assigned as its run-time shortcut menu.  
    I then generate new items dynamically using the event/menu mechanism noted above.  
    The problem is that there doesn't seem to be a way to *preserve* those newly added items (ie. I have to re-create the new items everytime the menu is *activated*).
    What I observe is that, unless I add all the items every time the right-click event occurs (in the "Shortcut Menu Activation?" event case), it defaults back to the original .rtm menu state.
    Question
    Does anyone know how to either:
    get dynamically added menu items to "stick"
    perhaps dynamically create (new) and load an .rtm for a *control*
    Thanks in advance for any thoughts.  I'm working in LabVIEW 8.6 for this particular project.
    VM

    Looking at the second post link, it seems like you are trying to populate 10,000+ shortcut items on the Shortcut Menu for the control. I'm guessing these are tiered, since I don't think all of them would fit on the screen. If they are tiered, have you tried populating only the top level short cuts, and then populating more as the user navigates down the tree?
    - Regards,
    Beutlich

Maybe you are looking for

  • Graph Not Showing Up in Any Format

    Post Author: totai CA Forum: Exporting I have downloaded the trial version and created my first pie graph.  When I click any of the buttons to export (pdf, rtf, ppt) it opens the appropriate application but then all that shows up is the legend, no gr

  • How can I change my mac theme? for Mavericks

    I want my macbook to look better and I want to change the theme, any help?

  • Exchange server 2007 Service Pack problems SBS 2008

    I am Running Exchange server 2007 on Small Business server 2008 (SBS 2008). I tried to install SP2 but it fails both windows update and manually. Can anyone first advise me what version I'm currently running? Help / about form Exchange Management Con

  • New Sun 1 Studio 4 Mobile Edition User

    I am new to the S1S4ME and want to use the SerialComm API for development of a MIDlet communicating through the comm port on my PC. I have installed J2SDK1.4.2_04, J2MEWTK 2.1, and obviously S1S4ME. I have placed the comm.jar & javax.comm.properties

  • REPORT_OBJECT ¿how initialize it?

    I am using REPORT_OBJECT to send report by FTP. Parameter 'Desname' in URL is one of most important to manage it. In order to make my forms flexible I storage in "Report Target Name" property, of my logical Report in the deployed tree of my Forms, th