Saturday, March 13, 2010

Passed the CLD (part 3) - preparations

I passed the CLD exam a couple weeks ago, and I'm writing about that experience.  In part #2 I talked about the courses that NI offers.  Now I want to write about the example problems NI publishes.

NI has plenty of information on their website about their exams - preparation guides, slide shows, and sample exams.  There are three samples: a traffic light, a security system, and a car wash.  These problems have been posted as examples for a while.  I know for a fact that the traffic light problem has been on the NI site since at least 2003.

There are two lessons to draw from that last statement.  First, the problems are older and, in my opinion, not as sophisticated as current test problems.  Second, the solutions are old as well and not very good.  I'm not the only one who thinks this.  Do a search through the comp.lang.labview users group, or LAVA, or even on the NI discussion forums, and you'll see that many others have expressed the same opinion.

Here's what I'm saying: don't limit yourself to the practice exams and the NI-provided solutions.  Look online for the solutions from other people, read through the discussions about the problems, think about how the problem could be made more complicated.  A couple of links to get you started are here, here, here, and here.

=====================

In the course of preparing for the test, I tried to summarize what I learned from the sample exam solutions.  Here's an abbreviated list of what I wrote down as important - your own lists may differ.

  • The top level VI is at least a state machine.  Make sure you have an initialize option, and set up default properties within the initialize state.  Don’t have them sitting outside the loop – that’s messy.
  • Controls & clusters
    • When in doubt, type-define.
    • There are some things (like changing colors) on a strictly type-defined control cluster.  Make it a regular type-defined control instead.
    • For a control reference, use the To more specific class function to cast the reference as a known control.
  • SubVIs
    • Wire errors for all subVIs.  Use a case statement to skip operations if there is an error.
    • Make use of functional globals.
    • Always have an initialize case for functional globals.
    • Some subVIs will be state machines themselves.
  • Timing is an essential part of the CLD exam.  You need to understand how to time operations, pause them (while maintaining the elapsed time), and abort them.
    • If you can, just use the express timer.
    • If you have to create a timer VI, make it a functional global.
      • The main states are Initialize, Start Time, and Get Time.
      • Use the initialize option to set everything to zero
      • The stored items in the VI are the target time, start time, elapsed time, and Time Elapsed?
      • Check the time as the image below: subtract the current time from the start time to see if the difference is greater than the set time.
  • Queues are often used in sequence-type patterns.  Know them well.
    • Adding something to the queue puts it at the end of the line.  To put it at the front of the queue, use the Enqueue element at opposite end function.
      • If you must abort a sequence, place the abort action in the front of the queue.
    • Queue VIs wait until there is something in the queue to act upon.  Use the timeout option if this behavior is unwanted.
    • You can preview the next item in the queue without removing it.

No comments: