LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD Car Wash Timer

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.

LabVIEW 2016 - Windows 7

CLAD
Download All
0 Kudos
Message 1 of 7
(3,636 Views)

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?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 2 of 7
(3,582 Views)

I checked again but I see 5 positions : Entry, Station 1, Station 2, Station 3 and Exit. 

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 3 of 7
(3,576 Views)

No, I was only talking about the enum in your timer.

 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 7
(3,572 Views)

Dang it, I meant to hit reply and not "Me Too"!  Smiley Frustrated

 

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.

=====================
LabVIEW 2012


0 Kudos
Message 5 of 7
(3,563 Views)

Limited familiarity with action engines means more studying for me!  Thanks for the advice.

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 6 of 7
(3,545 Views)
I am on my phone so cannot provide a link, but do a search for Ben's Action Engine nugget. If you know what a Functional Global is, that is the foundation of an Action Engine. If the FG does more than just storing data it is commonly called an Action Engine. Understanding those and the Producer Consumer design pattern with events is key to passing the CLD exam.
=====================
LabVIEW 2012


0 Kudos
Message 7 of 7
(3,541 Views)