LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Traffic Light CLD Soln vs mine

I pulled an NI "CLD solution - Traffic Light.llb" and was kinda taken back by the block diagram, considering the nit picking itty bitty things that my grader pointed out on 2 of my CLD exams, see this post.. read more on this here http://forums.ni.com/ni/board/message?board.id=170&thread.id=315267 .
 
I copied NI's FP and did my own VI soln following there methods while leaving out some of the nit-picky things like subVIs and droppin an error handler on the block diagram. (It faster to duplicate the cases in a case structure vs subVIing parts of the code when I'm in the middle of an exam and didn't include an error handler due to the simplicity of this test (only 1 block diagram needed).
 
I would like those to tell me who gets the fail/pass grade here on the block diagram... following the NI rules of CLD coding that is. Heck, I'll paste what they told me about the deduction of points on the CLD.... if you apply this to there soln well judge for yourself. Maybe this will help future CLD candidate... can wait for the next exam!
 
------------------------------------------------------------------------------------------
""Code repeated once should be in a subVI or points off. OK, don't copy and paste code put it in a VI
 
use of locals or globals or propery nodes for INDICATORS value updates are points off. Controls... well alright locals globals and sometime property nodes are ok.
 
Unneccessary bend in wires over say ( ohh lick my finger then waving in the air) 5 times is a nono, points off.
 
NOT gates are points off when using the compound arithmetic operator. "Oh use the inverter thats on the compound arithmetic, your taking a performance hit...". Ah 1 less func on the block...Well I like the look of the NOT gate, its stands out.
 
Errors not handled.... points off. OK wire a error clust in and out your state machine and case an error with a error handler popup func, should error happen it pops up in the user face. Hmmm, did read this as a requirement in the test spec.
 
Don't make your Style overly complex, this is a performance hit.... "looking for the fewest functionality on the block diagram for best performance, yada yada yada. Scalable, modular, simplest, performance, speed, minimal bends, handles errors, minimal property nodes, documents all descriptions of controls and block diagram and last but not least does the functionality work.""
---------------------------------------------------------------------------------------
Download All
0 Kudos
Message 1 of 85
(7,394 Views)
My code is attached, you still have to go through and ensure all booleans in every case is the correct settings. Other than that here it is, attached.
0 Kudos
Message 2 of 85
(7,378 Views)
The purpose of the test is determine how well you develop an application. Not how fast can you do it.
 
Let's look at your example of duplicating code (or Case Structure Cases) instead of using subVIs. Imagine you discover a mistake in that bit of code that you duplicated a number of times. Now you have to go through each case and make the same change to each bit of code. Now how much time have you saved by not making that a subVI? And, hopefully you'll get all the changes correct in each place. And what if you liked that bit of code so much that you used it other applications that you now have to track down and fix...
 
I never liked the name "Local Variable". People tend to use them like variables in a text based language, and that can get you in trouble in LabVIEW. I refer to them as "Initializer Terminals" to the classes I teach and when talking to new developers about them. About the only time I use them is to initialize a controls value when the application starts or you are loading a saved configuration from a file. Admittedly, sometimes they do creep into other places, but not very often. Local Variables and Property nodes break the data flow paradigm and can easily introduce race conditions and do introduce extra processing and memory overhead.
 
As for error handling, how are you going to know if something goes wrong if you don't include error handling?
 
Just remember, this exam is about style and architecture and not about speed and "does it work". I've seen exams turned in that were not complete yet, and didn't have full functionality, but passed because of the architecture and style. The graders could tell they were on the right track.
 
Hope that helps.


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 85
(7,373 Views)
Ed, you hit the nail on the head. I would use subVI in the real world of course. It took me less than 2hrs to do my VI. During a test, when the material is all new, its best to use the fastest method first then go back and dress up, cross the I-s and dot tees. Since my implementation of the timing was right there on the block diagram I was able to quick debug and fix it. Yea I had to go back into all cases and correct it, thats the trade off. This Test example is not worth the effort of SubVIing is what I'm saying... I would do this now (use subVI) cus NI grader deduct points.
 
I didn't put an initialize in my VI, the spec didn't require it from what I read. I disagree property nodes break the data flow, break a thread (so what a microsecond lost). Anyhow, you must use a propery node to set a control (it has output and no input). In the real world you handle errors if they present themselves, this is an exam and time is important. Anyhow all they want is a simple error handler on the block diagram, how hard is that...
 
It too have come across Certified Labview Developer who did not complete the functionality of the exam and got a pass. Your not supposed to pass on Programming Style alone or Functionality alone or Documentation alone, so they must have gotten an overall 75% out of 100 on Programming Style, Functionality and Doc...
 
My point is NI soln for the example is not the greatest per there requirements!!!
0 Kudos
Message 4 of 85
(7,353 Views)

A slight CORRECTION:

I disagree property nodes DO NOT break the data flow, they may break a thread (so what a microsecond lost).

0 Kudos
Message 5 of 85
(7,351 Views)
Hold-on maybe the fact that there are Certified Developers who did NOT complete the functionality may tell you the grading is subjective.... hmmm??? Nope!! NI confirmed its by a point system, seems to be deduction only (well thats the way my conversation went with one of the exam Authors. Seems to me they should add points and not find thing to deduct (hush hush subjectively) I mean objectively.
0 Kudos
Message 6 of 85
(7,339 Views)

I pretty much agree with the evaluations.

For example, the "states" is only used internally, so making it a control is useless because there can never be a user interaction. It is NOT used as a control! The value should be kept in a shift register, and, if you really want a FP object of it, make it an indicator and show the data in the wire at each iteration. No locals needed.

I have never taken any CLD, so I don't quite know what the requirements are for the "traffic light" question. GIven full freedom, I probably would make the traffic light an Xcontrol enum or similar. It would make the code so much more readable. 😄

0 Kudos
Message 7 of 85
(7,316 Views)
Altenbach, 
great idea about using the Xcontrol, now I'll go off and learn something doing the xcontrol. Yea, in my haste to beat the clock, its point off for the NI example and also for my own soln example for wasting functions on the block diagram, per NI recommendations. 
 
Aaand, another day I'l do the NI Car Wash example which by the way also has quite alot happening on its block diagram solution. I wonder who wrote these soln??? I see some func (e.g. queues), not discussed in LV basics I&II training, on the block diagram. I also see one too many bent wires, gosh :^).  NI recommends taking I&II training to take the CLAD and/or CLD.
0 Kudos
Message 8 of 85
(7,290 Views)
Before you go the XControl way, it is pure overkill.

I did my CLD exam in 2 hours, the next 2 hours I used for documentation and fine tuning.
The CLD is a follow up on Intermediate 1&2. Intermediate 1 focuses on the queued driven master/slave design pattern.

As said the CLD is pre programming style, if you want to you could do the code in 60 minutes, and it would be rejected.

Good luck,

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 9 of 85
(7,247 Views)
I passed my CLD just by style. The functionality was completly missing due a logical error after starting the program. Just a greater than / less than error. I got my points in style and architecture. Showing all posibilites to document a wire, using unique icons on subVIs, using always the 4x2x2x4 contector pane, making terminals required ...
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 10 of 85
(7,228 Views)