06-16-2010 09:56 AM - edited 06-16-2010 09:57 AM
candidus wrote:Perhaps that's the problem: Your buttons have switching behaviour and your cases are wired to be executed on button press (true) so clearing the strings only works when pressing a button, not when releasing it! I'd suggest to use latching buttons and an event structure.
I'm sorry I didn't recognize that the buttons are latching ones already...
Nevertheless I suggest to use events.
06-16-2010 11:28 AM
The vi works fine here. When you press your clear button, you notice it turns to a darker grey and looks indented, then it returns to normal. Does your button stay darker and indented? If so, it has not been read yet and the clear action won't happen. Must be something with your particular computer or installation. As Ravens Fan mentioned, use highlite execution (the light bulb) to see what is happening.
06-16-2010 12:18 PM
I'm having a problem as exactly what you said!
After I click the button, it stays darker and clear action never happen.
If installation or PC was the problem, what am I supposed to do?
06-16-2010 12:57 PM
Is the VI you posted your actual code? If so, the button not popping up means that the "clear button" control is not being read. And the only way that is happening is if that loop is not iterating.
What does the execution look like when you have highlight execution turned on. If that is not your actual VI, but just a sample, then please post your actual.
Is it possible that if you wait long enough the button will pop back up? If your instrument is not working properly, then you might have a long enough timeout waiting for a response (10 seconds in your case) that it will look like things are not working but eventually will.
06-16-2010 01:10 PM
If you are not getting a response back on the serial port, the vi will hang here until a timeout has occured, as Ravens Fan has mentioned. The clear button will not be read until you get a timeout error and you click the continue button on the error popup. Then the button will be read and the text will be cleared and the button will return to its original color. You problem is not with the clear function, it is with the serial read. I suspect you are not getting back any serial data, which points to a totally different problem. Either your serial device is broken, or the link is bad, or the device is not getting the proper input, or the serial settings (baud, parity, etc) are wrong.