02-24-2012 07:42 AM
I have a solution for the timer to the car wash CLD exam that seems to have a bug in it that I can not sort out. The program assumes that the car is in the correct position before running the sub-routine. In this example I have the car location set to "1." If I switch locations while the timer is running from 1 to 2, 1 to 0, etc it works as long as I go back to 1. If I do something like 1,2,4 the program freezes and I can't understand why. Any suggestions appreciated.
02-27-2012 03:52 PM
You mentioned if you go 1,2,4, the program freezes. I assume that the sequence that you are refering to is the sequence of your car position slider enum. The enum only has 0,1,2, so what do you mean?
02-27-2012 04:02 PM
I checked again but I see 5 positions : Entry, Station 1, Station 2, Station 3 and Exit.
02-27-2012 04:12 PM
No, I was only talking about the enum in your timer.
02-27-2012 04:50 PM - edited 02-27-2012 04:51 PM
Dang it, I meant to hit reply and not "Me Too"!
Anyway.. It is seldom that you would want an event case in a subVI. Maybe for processing user events. Also, in general, two separate modules should not know about eachother. In this case you have a timer module that knows about a carwash position sensor.
I recommend trying to create a reusable timer with pause that you can use in any VI. Just an Action Engine with "Set Time", "Check Time", "Pause" and "Resume".
When you have a loop with an event structure, you really don't need the WaitmS to throttle down the loop.
But basically the problem is that you have an event structure in a case that will not execute. The "freezing" problem has nothing to do with going from a particular state to another particular state. It happens after the value of the slider changes twice. Since your event structure cannot execute because the condition is not satisfied for the case it is in to execute, you hang the UI. You can go to "Edit Events Handled by This Case" and unselect "Lock front panel (defer processing of user actions) until this event case completes".
But don't mark this as the solution because it is not. The solution is to create a timer module using an Action Engine as described above.
02-28-2012 07:18 AM
Limited familiarity with action engines means more studying for me! Thanks for the advice.
02-28-2012 07:26 AM