07-17-2014 03:37 PM
CVI 2012
I have a startup panel where the user makes a configuration selection via a COMBO BOX and then clicks an OK button to start the main panel.
This works perfectly in development but when I create the application for deployment on the target computer, the startup panel is bypassed. Only the main panel appears with the default COMBO BOX selection.
I believe the only way this can happen is because a Carriage Return or a Mouse click exists in buffer which causes the OK button to be immediately accepted. I cannot debug the root cause because it is a virtual terminal and CVI IDE is not available.
What function calls can I make to clear the mouse and keyboard buffer on startup. I suppose I could always just loop until the buffer is empty or set a flag to dump all keyboard events for the first seconds after startup??
What is recommended?
07-18-2014 12:02 AM
Before going to this task, could you just confirm that the OK button callback is called in the compiled executable? Just adding a simple MessagePopup in the button callback could be enough. I'm saying this because I can hardly think that a keyboard/mouse buffer is passed to CVI application, unless you are using a very slow or busy system and the user continues clicking on the icons to have the app launched.
07-18-2014 11:07 AM
Hello,
Does the startup panel not appear at all or does it sort of flash on the screen? I think a Message Popup is a good option to add stopping points in your code to verify the startup behavior.
07-18-2014 12:56 PM
Hi guys,
the startup panel DOES appear if you soft reset Windows Desktop or close the application and boot it manually.
It's only when you turn off the machine then turn it on that the startup panel doesn't appear.
This is a common problem with embedded systems where "junk" appears in your hardware , e.g., keyboard buffer, serial buffer, etc. and needs to be cleared first.
07-18-2014 01:32 PM
If you disable the callbacks in the startup function, does the problem persist? What is (are) the callback(s) that close the startup panel? Can you narrow it down to specific callbacks that are causing the problem?
07-18-2014 02:38 PM
The startup panel is closed ONLY when a Commit Event is received.
07-21-2014 09:52 AM - edited 07-21-2014 09:53 AM
Hello,
Ok, I just wanted to make sure there weren't Panel Events or other event callbacks that would close the startup panel.
Another thought. Since there always must be an active control, you could change the tab order of your controls so that the 'OK' Button is not the first active control. You could have the Combo Box be the control instead.
Please see this KnowledgeBase article about changing the tab order of the controls: How do I change the Tab Order for Controls in LabWindows™/CVI?
07-21-2014 11:43 AM
That is a good thought.
I ended up using the Timer() function. I first call the Timer() function in main and then I call the Timer() function also in the OK callback. If 2 seconds hasn't expired since startup, I disregard all events.
Thanks for your help!