09-14-2012 11:56 AM - edited 09-14-2012 12:09 PM
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.
09-14-2012 12:09 PM
Nevermind, I found the problem.
09-14-2012 12:13 PM
Care to enlighten us so that we can avoid making the same mistake?
09-14-2012 12:33 PM
@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.
09-14-2012 12:42 PM
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.
09-14-2012 12:50 PM
Great that you got it working. Oh, and it's a case of "been there, done that." 😉