12-03-2008 10:44 AM
12-03-2008 12:10 PM
12-03-2008 03:20 PM
12-04-2008 06:27 AM
Hi,
Thank you very much for the solution, it works well. Now I would like something a little bit more complicated. Actually at the beginning you have a choice between 2 buttons. One click to it makes it disappear. One click at left activates the timer and if it is at right you have a chnage in the font 2 sec before the presentation of a picture. 1 sec after, a next trial begins. At left, it is the same thing except that therer is no change in the font.
What I can't do is to return to the choice phase after the first trial because the while loop continues to run. I don't know how to fix it. Do you know how to fiw it? Thank you in advance12-04-2008 08:33 AM - edited 12-04-2008 08:36 AM
In order for that event structure to execute more than once, you will have to get it placed in a while loop so that it can execute again. I think you need to step back and rethink your architecture. From solving the original problem as you had posed it, you have now added about 3 layers of complication. You've duplicated all the code. That is now a candidate to be made into a subVI. The 2nd set of code is now dependent on the completion of the first set based on the blue wire you have running between them. I don't think that is what you want.
You've wrapped up each set of code in a case structure with a single other case that is empty. And for many of your cases, you have tunnels set to their default values. I don't think that is always what you want either. I would think the # to create is just as valid for the second set of code as the first, but whenever the second set runs, the first set hasn't run, thus the value of that wire will be zero because that is the default value of the tunnel coming out of the upper case structure.
And third, you've added the complication of the event structure.
I suggest you look at the design templates. The event structure should probably be a part of the producer loop in a producer/consumer design architecture. Beyond that. You should look at the state machine architecture which is often built within a consumer loop. Any time you have something where you are dealing with multiple steps, but need to return to an earlier step, but also need the flexibility to change the order of the steps, a state machine is usually at the heart of it.
I would also recommend cleaning up the front panel. Now that you've added some new controls, they are getting scattered all over the place on the front panel.
Looking closer at the event structure, it should execute twice because it is within a For loop that has a 2 wired to N. But it will not get past the event structure again until either button press happens. You are doing some odd things with hiding the buttons, and even odder things by changing their position. You may be setting yourself up for a case where you can't execute the event structure because the controls that have events attached to them are either missing or misplaced.
As for your comments about different fonts, I don't see in your code where you are doing anything with fonts.
12-04-2008 08:55 AM
12-04-2008 09:38 AM
12-04-2008 11:04 AM
Go to File then New ....
You want Producer/Consumer design pattern with Events. See attached.
PS: Why is it with your messages the Re: gets added on with every reply. The only thing I can see is that your reply gets added on as Re space colon, while mine is Re colon which matches all other replies I see on the forums. Puzzling.
12-04-2008 11:42 AM
Yes puzzling.
Otherwise thank you but I did see the example in the templates but I have difficulties to see the link with my program and how to arrange element I have in this architecture. I have difficulties to see how it works except for the state machine that I know a little bit more.
12-04-2008 12:37 PM