LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Resoved] How to make sure numeric entry is accepted before saving.

Running LV 2010.  I have an application in which I talk to some hardware via the USB.  Values are stored in the EEPROM inside the hardware.  I have a screen that shows these variables as floating point numbers, and allows the user to change the variables as needed, then save to the device.  The problem I have is that, if I change a number, and while the numeric field still has focus, I click the save button, the program saves the previous vaue.  It's as if the value was not entered.  If instead, I click off of the newly entered number in the middle of the page somewhere, then click save, it saves the new number.  In the save button routine, I have tried changing the focus to the save button, then "waiting" 10mS for the display to update, then saving, but this does not work.  How do I make sure the screen has accepted the change before I do the save?  Thanks.

0 Kudos
Message 1 of 6
(2,570 Views)

Nevermind, I found the problem.

0 Kudos
Message 2 of 6
(2,563 Views)

Care to enlighten us so that we can avoid making the same mistake?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(2,554 Views)

@crossrulz wrote:

Care to enlighten us so that we can avoid making the same mistake?


I'm guessing he was trying to push the values using the numeric events instead of placing the controls inside the "Save Button" event to be read when the "Save Button" was pressed.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(2,547 Views)

Bill, you pretty much nailed it.  It has been a while since I looked at it, so it took me a bit to realize what was actually happening.  I have it set up so that when a value is changed, the value change event for that value writes the value to the device so the device will reflect the change.  Then, I instruct the device to save it, then reading it back to compare and tell if the values were saved correctly.  The way I was doing it, clicking on save was not allowing the value change event code to execute.  Needless to say, I had to make a few changes.  It works now.  Thanks.

 

0 Kudos
Message 5 of 6
(2,540 Views)

Great that you got it working.  Oh, and it's a case of "been there, done that."  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 6
(2,532 Views)