11-21-2009 04:41 PM
Within my program (timer001.vi), I'm trying to have various cases controlled by a radio button, and I'm trying to have a different file name depending on the case structure. Everything works as expected except the circled part (circled.jpg). When run, right now, the '...numbers' file never even gets saved.
Could anyone tell me what I'm doing wrong and how I should fix it?
11-21-2009 04:48 PM
I couldn't find an 'edit' so I'm just replying to this...
I'd like to add that if I drag the 'C:\Documents and Settings\inst\Desktop\testing\numbers' string outside the case structure, then everything works as expected. However, if I do that, then I won't be able to change the path location depending on the case structure.
11-21-2009
05:35 PM
- last edited on
11-23-2009
08:54 AM
by
Support
In a nutshell, you have two cases that never finish executing, they have loops that run forever in them.
Without going into comments on cleaning up a lot of other issues in the code, what you need to do is wire your case selector to a different case structure with the file name/path or whatever that string is in it.
11-21-2009 06:18 PM
I don't see how you expect it to work. The only cases with something wired have while loops that you cannot stop exept with the Abort button. The Abort is going to stop everything. Do NOT wire a constant to a while loop's termination terminal.
p.s. Why are you using the obsolete traditional DAQ driver? Using multiple instances of them does not make any sense either.
And while you are at it and making modifications, please clean up your wiring. What you have in the 'Selection 2' case is unreadable.
11-21-2009 06:46 PM
That VI needs to torn down and rewritten fron scratch. This thing is buggier than a formicarium.
First you need to learn some of the basics of dataflow.
11-22-2009 10:35 AM
Looking at the three loops at the bottom of your code I suppose you're making a reaction time measuring program (what's in a name???).
Also the user should press the buttons in the correct order, 1 then 2 then 3 then 4.
(That's why he has a 36" monitor Altenbach 🙂 the further the buttons away from each other the better.)
If that is the case please take a look at the attached VI "4Buttons".
I use the "Disable" propery to control to correct order of the buttons. There is only one button enabled at the time.
When the user press the correct button, the next one is enabled and the actual one is disabled.
I store the time each button is pressed into a control.
Once the complete cycle is done, just subtract the controls from each other to get the time between 2 buttons.
Everything is in one loop and an event structure.
Use the same event structure to capture your radio buttons, I already prepared some code, up to you to fill the cases with the correct "clean" code.