03-25-2010 03:48 PM
Hi all,
I have a quick prototype APP I'm putting together in LabVIEW 8.2, under Windows XP, with a NI USB-6212 DAQ.
I am using daqMx to do group reads and writes, and the speed is acceptable.
However, I'm having an issue making a decision based on the user selection of a radio button.
At startup, I set the radio button to 'manual' programmatically. The other 2 options are 'semi-auto' and 'automated'.
I then enter a loop and allow the user to set up whatever parameters they need, etc.
There is a folder tab on the front page of the VI, but it is not directly related, and I don't read it's value (that is, I don't check to see which page is being used).
When the user presses 'Go', I read the value from the radio button (manual, semi-auto, or automated) as a selector in a case statement. Based on the user's setting of the radio button I set operational variables for use later in the program.
However, The functionality is not working as I expect. I placed flags within the case statement to see what it is doing, and the VI does not reliably execute the case statement 'option' which agrees with the setting of the radio button. Sometimes I set 'semi-auto' and the case statement for 'manual' is executed.
I had been reading the radio button from a 'local variable', so I swapped that around and I read from the 'terminal' now. No change.
Any thoughts? Do I have to do something before I can read the radio buttons reliably?
Thanks,
Jeff
03-25-2010 03:53 PM
03-25-2010 04:56 PM
Sounds like a typical case of "wire a control to a loop so you get a static value". Only what's inside the loop is repeated. If you want to update the value from a control you need to read it again. From the sound of it, placing the control inside the loop will solve it, else you're updating the control somewhere else and have a race condition.
03-25-2010 05:30 PM
Hi again.
Thank you for your responses. I was putting together a small application to show the problem, and was able to recreate it.
Then I noticed that I was reading the radio button outside of any structure, thereforfe it was pulling in an undefined value before the user clicked 'start'.
I checked my 'real' code and that appears to be the problem.
Once I placed the 'read' of the radio button inside a control structure, so that I defined when it was read, all is good.
Thanks,
Jeff
03-26-2010 05:05 AM