LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

radio button not read successfully

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

 

0 Kudos
Message 1 of 5
(3,025 Views)
Without seeing your code, it's very difficult to determine what the problem might be.  Please post your code so we can have a look at it.
0 Kudos
Message 2 of 5
(3,022 Views)

 

 

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.



/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 5
(3,006 Views)

 

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

0 Kudos
Message 4 of 5
(3,000 Views)
Dont forget to mark as solved (and the solution).
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 5
(2,974 Views)