10-31-2012 05:27 AM
Hello,
I am trying to build a VI where the user enables some boolean controls on the front panel.
The VI uses a producer consumer architecture wherein based on the booleans clicked,
certain states get queued an saved into an array.
After the user is done selecting, the booleans should get disabled and the array of states
should be indexed one after the other.
This is an attempt to solve the car wash sample exam.
However, the VI is not generating the required results.
Can someone please help me figure out what is the correct way to implement this.
Thanks,
Solved! Go to Solution.
10-31-2012 05:37 AM - edited 10-31-2012 05:40 AM
Its because you have wired the consumer while loop stop from the first one. Remove that and in your consumer loop, do a compare of the states that you receive and if it equals shutdown, stop the consumer loop.
10-31-2012 05:57 AM
Thanks for your reply, let me check it out.
10-31-2012 07:33 AM - edited 10-31-2012 07:35 AM
Your data flow was wrong to the second loop for the parallel process...Just wire your stop control directly to your second loop
10-31-2012 07:49 AM
Thanks for youur replies guys, that was the problem alright.
Now, I have extended this VI to attempt the Car wash CLD problem in a simplified form (without pausing in between states).
However, again I am finding that the array is not building up with the selected states.
What I am attempting to do is build the array based on the user inputs, then once start is pressed, disable the options
and start indexing through the arrayed states with a 5s timer in each state.
Can you please help me figure out how to get it to work ?
10-31-2012 07:59 AM
@SysArch wrote:
...However, again I am finding that the array is not building up with the selected states.
its working fine?
10-31-2012 08:02 AM
Please see the Queued SM_Sprinkler which is the new VI that I have attached in the previous post.
10-31-2012 08:06 AM - edited 10-31-2012 08:07 AM
Its because your consumer loop is being shutdown when the first time the consumer loop executes, your equal compare will be true and it will stop the consumer while loop. Use single stepping and debugging features available in labview to see whats happening in your vi.
10-31-2012 08:07 AM
Ok thanks, let me check with those.
11-01-2012 12:52 AM
I have tried to debug it but am stuck at one stage..
I am not able to get the timer to count up continuously. The states get queued alright, but the timer just counts to some randome time
and then the code seems to halt.
Can anyone please help me debug ?