NI Traffic Light CLD Soln vs mine

  • Follow


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&nbsp;more on this here <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;thread.id=315267" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;thread.id=315267</a>&nbsp;.  
&nbsp;
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).
&nbsp;
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!
&nbsp;
------------------------------------------------------------------------------------------

""Code repeated once should be in a subVI or points off. OK, don't copy and paste code put it in a VI
&nbsp;
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.
&nbsp;
Unneccessary bend in wires over say ( ohh lick my finger then waving in the air) 5 times is a nono, points off.
&nbsp;
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.
&nbsp;
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&nbsp;in the user face. Hmmm, did read this as a requirement in the test spec.
&nbsp;
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,&nbsp;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.""
---------------------------------------------------------------------------------------


NI_TrafLight_Soln.PNG:
http://forums.ni.com/attachments/ni/170/316108/1/NI_TrafLight_Soln.PNG


MySolnSteps.zip:
http://forums.ni.com/attachments/ni/170/316108/2/MySolnSteps.zip


11.PNG:
http://forums.ni.com/attachments/ni/170/316108/3/11.PNG
0
Reply x9561 (148650) 4/14/2008 7:40:06 PM

The purpose of the test is determine how well you develop an application. Not how fast can you do it.
&nbsp;
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&nbsp;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...
&nbsp;
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&nbsp;overhead.
&nbsp;
As for error handling, how are you going to know if something goes wrong if you don't include error handling?
&nbsp;
Just remember, this exam&nbsp;is about style and architecture and&nbsp;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.
&nbsp;
Hope that helps.
0
Reply x9561 (148650) 4/14/2008 8:10:08 PM


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.


My_CLD_TrafficLight.vi:
http://forums.ni.com/attachments/ni/170/316118/1/My_CLD_TrafficLight.vi
0
Reply x9561 (148650) 4/14/2008 8:10:08 PM

A slight CORRECTION:
I disagree property nodes DO NOT break the data flow, they may break a thread (so what a microsecond lost).
0
Reply x9561 (148650) 4/14/2008 8:40:05 PM

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&nbsp;NI grader&nbsp;deduct points. 
&nbsp;
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...
&nbsp;
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&nbsp;overall&nbsp;75% out of 100 on Programming Style, Functionality and Doc... 
&nbsp;
My point is NI soln for the example is not the greatest per there requirements!!!
0
Reply x9561 (148650) 4/14/2008 8:40:05 PM

Hold-on maybe the fact that there are Certified Developers who did NOT&nbsp;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
Reply x9561 (148650) 4/14/2008 8:40:06 PM

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!&nbsp;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. :D
0
Reply x9561 (148650) 4/14/2008 9:10:06 PM

Altenbach,&nbsp;
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&nbsp;my&nbsp;own soln example&nbsp;for wasting functions on the block diagram, per NI recommendations.&nbsp; 
&nbsp;
Aaand, another day I'l do the NI Car Wash example which by the way&nbsp;also has quite alot happening on its block diagram solution. I wonder who wrote these soln??? I see&nbsp;some func (e.g. queues), not discussed in LV basics I&amp;II&nbsp;training, on the block diagram. I also see one too many bent wires, gosh :^).&nbsp; NI recommends taking I&amp;II training to take the CLAD and/or CLD.
0
Reply x9561 (148650) 4/14/2008 9:40:09 PM

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&amp;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
0
Reply x9561 (148650) 4/15/2008 4:40:06 AM

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 ...
0
Reply x9561 (148650) 4/15/2008 9:10:04 AM

If my memory serves me right, there is no queues discussed in Intermediate I or II. Futhermore, the NI master slave design pattern found in the LV New VI dialog uses notifiers. I did do the code in 60 minutes, the other hours was making sure it worked. guess, I need another hour to add documentation and a 3rd hour to checking for "Style" thats loosely defined per the&nbsp;LV design guide&nbsp;<a href="http://www.ni.com/pdf/manuals/321393d.pdf#labview_style_guide" target="_blank">http://www.ni.com/pdf/manuals/321393d.pdf#labview_style_guide</a>.  
&nbsp;
As far as using quote unquote the good connector pane, i.e. 4x2x2x4, that training rhants about, I prefer not too. Use only the amount of conncectors necessary and yes make terminal required. Try debugging some large application (1000 VIs)&nbsp;that someone&nbsp;inadvertantly connected one of those empty connector panes to the wrong wire or just leaves it unconnected all together.... Apps like this are not for the cookie cutter LV programming "Style" guides...
&nbsp;
The comments on my CLD are open to interpretation. According to NI, you should not pass on "Style" alone. your need 30 out of 40 points. Style is 15, Func is 15 and documentation is 10. The fact your passed tell me this was a subjective judgement call.
0
Reply x9561 (148650) 4/15/2008 2:40:05 PM

&nbsp;
As far as using quote unquote the good connector pane, i.e. 4x2x2x4, that training rhants about, I prefer not too. Use only the amount of conncectors necessary and yes make terminal required. Try debugging some large application (1000 VIs)&nbsp;that someone&nbsp;inadvertantly connected one of those empty connector panes to the wrong wire or just leaves it unconnected all together.... Apps like this are not for the cookie cutter LV programming "Style" guides...
&nbsp;


&nbsp;
I am now in a position where I have to maintain and update a very large application with several hundred VIs and most of those used the absolute minimum connectors (sometimes only 1!). Adding inputs and outputs breaks all of the calling VIs and this is not pleasant to fix. This goes beyond what I would consider a 'style' element. If I could find the amateurs that did the original programming, I would beat them over the head with the nearest heavy object. You can't even connect a wire to an empty connector either so I don't quite understand your comment about that.
I happen to believe that style is incredibly important for the developer when he or she is part of a large project and working as a team. It's next to impossible to manage large projects when everyone is doing things differently. I sympathize that you have taken the test&nbsp; and haven't passed but use the experience to learn from. I now work for a company that&nbsp; will pay the exam costs so we will see how I fare.
0
Reply x9561 (148650) 4/15/2008 3:10:08 PM

I passed not only on style but most of the points came from there. From the functional part the initialization and configuration was working. Only after starting the execution part the program didn't work.
0
Reply x9561 (148650) 4/15/2008 3:10:11 PM

If the prior developer had left you extra connector panes and the run arrow did&nbsp;NOT&nbsp;indicate broken because of some callers and changes you made,&nbsp;well I guess you would find this out at run-time or worse at the customer site.... I'm not the only one using minimal connectors. In fact I always use the minimal, what wrong with adding an addition connector when you need it. With modularized&nbsp;code it should be painless. Nothing wrong with 1 connector if thats all thats required... :smileywink: 
&nbsp;
&nbsp;
&nbsp;
&nbsp;
0
Reply x9561 (148650) 4/15/2008 3:10:12 PM

Let me start out by saying I've never taken the CLD, so you can evaluate the validity of my comments based on that. I have been following your comments regarding the CLD and its grading. It seems quite clear that you are quite annoyed over the result of the CLD in your case. My suggestion: get over it. Really. ALL standardized tests are subjective in either their construction or their grading. That's the nature of standardized tests. For some people this works out great, for others, not. Just because it didn't work out so well for you doesn't invalidate the test or its grading.  Your comments seem to be centered on trying to say that "NI doesn't seem to follow its own guidelines". Well, that's hardly a surprise. Have you looked at some of the VIs that NI wrote way back when? I shake my head sometimes. OK. So what? Does this mean that NI trying to put together a set of syle "rules" is hypocritical? Of course not. LabVIEW is a programming language, and just like any programming language you need to have some guidelines on how to program. Frankly, I commend NI for trying to put out a set of guidelines on good programming practices.For those of us who've been programming for a long time it's obvious that there's no "one style fits all". The point of the CLD, based on what I've seen, is not to say the "one style fits all". It's to say that style matters. And believe me, it does. You can't count the number of times I've reprogrammed something that someone else wrote or that I wrote myself because I didn't think it was "elegant". Did it work? Yes. Was it "sylish"? No. That's why I reprogrammed it. In many ways how you program says more than what you program or how fast you can program. I don't like to be rushed. I like to take my time to consider what I'm doing and evaluate all the possibilities in my head and determine which is the most elegant solution in terms of minimized code and style. Yes, style.As for the connector pane, not having a connector terminal available and then having to change the connector pane requires you to go into every VI that uses that subVI and relink to that subVI. That's why the use of the 4-2-2-4 pattern was adopted as a conventionally accepted pattern to use. It minimized this happening without creating a connector that required a microscope to connect a wire to.
0
Reply x9561 (148650) 4/15/2008 3:40:05 PM

I'm becoming less sympathic to you. There is actually quite a bit wrong with not leaving empty connector panes. If you have a subVI that is used in multiple locations, changing the connector pattern will require you to go into each calling VI and re-link the subVI. All of this is unnecessary. As a long-time developer, I realize that functions will change over time and a subVI may require new inputs or outputs. Failing to anticipate this and not making it easier in the future for myself or whoever, is dumb.
0
Reply x9561 (148650) 4/15/2008 3:40:05 PM

I scratching my head, I don't get your connector pane issue. Adding another pane does not break your code. Your existing wired&nbsp;connectors persist. Removing controls or indicators a certain way will add some additional debugging, maybe this is your issue...
&nbsp;
I doing whats recommended by NI to take the practice exams but when I look at the work of the example well you be the judge... I don't mind kissing up for the exam.
0
Reply x9561 (148650) 4/15/2008 4:10:05 PM

Just to enter discussion here: CLD takes "following the style guide" as a large part for its result. The reason is very good explained by Ed. The LabVIEW Style Guides, which are "tested" with CLD are subject to change. For instance, a year or two ago, nobody cared about "connector panes". But as Dennis or smercurio already stated, connector panes ARE important and can change; therefore, there should be a "rule" in the guidelines.... viola, here it comes. And 4x2x2x4 was chosen because of wiring errors and references......So, just to give you a small hint: keep in touch with the up-to-date version of LabVIEW and the current standard of the style guide.As the name "Style Guide" already implies: it is not a rule you have to follow in your daily work. Maybe, some of the content may be awefull for you; nevertheless, the NI Style Guide was built by experience on HOW TO SOLVE SOMETHING BEST. And regarding that NI examples do not follow the style guides:a) most examples are older. So there was no style guide to follow or the style guide maybe had some changes in between. NI does not reprogramm all examples just to keep up with the guide just like you wouldn't do it as well i asume....b) even newer examples break the guide; there are several reasons: esp. size is broken due to architectural reasons... the creator of the example is not aware of the current state of the guide .... we are all just humans :)c) There is no silver bullet in software developement (see http://en.wikipedia.org/wiki/No_Silver_Bullet)just my subjective thinkings,Norbert
0
Reply x9561 (148650) 4/15/2008 4:10:07 PM

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

I'm becoming less sympathic to you. There is actually quite a bit wrong with not leaving empty connector panes. If you have a subVI that is used in multiple locations, changing the connector pattern will require you to go into each calling VI and re-link the subVI. All of this is unnecessary. As a long-time developer, I realize that functions will change over time and a subVI may require new inputs or outputs. Failing to anticipate this and not making it easier in the future for myself or whoever, is dumb.
--------------------------------------------------
&nbsp;
Dennis we are in agreement here, 
I don't leave empty connectors like you mentioned above. yes forcefully changing panes is a nono, adding a necessary connector is painless. Others obviously consistently use the 16x2x2x16 leaving empty connectors, open for inadvertant connections.
0
Reply x9561 (148650) 4/15/2008 4:10:07 PM

TonP wrote:Before you go the XControl way, it is pure overkill.


I am not so sure, because making such an xcontrol is very fast and then you only have to deal with three values for each light (red, green, yellow) instead of a set of three booleans that can have 8 different states, 5 of which are illegal! Have you ever seen a light where the red and green are on at the same time? An accidental click in the wrong place could do that in the current code and even Darrens VI analyzer would not complain about it. :)
&nbsp;
Maybe even faster would be a picture ring containing the three images of&nbsp;the possible light states.
&nbsp;
I really think boolean structures&nbsp;are NOT the way to go here. :)
&nbsp;
The code needs to be designed in a way that is is easily readable and is inherently bug resistant. If I look at all these boolean constants in the posted codes, I cannot immediately tell if everything's OK. Can you?
0
Reply x9561 (148650) 4/15/2008 4:10:08 PM

Ahhh Altenbach,
&nbsp;
I will definitely try your suggestion! My light bulb just went off. 
&nbsp;
Once again the code was the fastest for me to slap together with minimal func on the block diagram. I simply used 2 cases and duplicated the others, that was left.&nbsp;This left me with&nbsp;tedious settings of booleans that I got bored with quickly. This particular practice exam is quite repeatable in coding. I'll do something not so repeatable next time.
&nbsp;
But have the idea now, use xcontrols whenever the controls is repeated repeated repeated....
0
Reply x9561 (148650) 4/15/2008 4:10:09 PM

altenbach wrote:



&nbsp;Have you ever seen a light where the red and green are on at the same time? 


You know what? I have.&nbsp; Some places in PA near where my in-laws live have these lights that have a solid red and a green left turn arrow on the same time.&nbsp; Even though the green arrow comes on, the light stays red.&nbsp; I don't know precisely what that means.&nbsp; Does that mean you have to stop before you make a left?&nbsp; These are on a 3 light traffic light.&nbsp; I think it may be just a cheaper way of having the 5 position light, where you have red at the top, yellow and green arrow on the left, and yellow and green solids on the right.&nbsp; But yet when the traffic is straight through, the green arrow goes out and the red solid stays red for the left turn lane which means you can't turn left yielding to oncoming traffic like you can with the 5 position light.&nbsp; But I've always said that PA is a little backwards.:smileywink:&nbsp; Sorry, Ben.:smileyvery-happy:
Message Edited by Ravens Fan on 04-15-2008  05:43 PM
0
Reply x9561 (148650) 4/15/2008 10:10:06 PM

When I was in England I saw that the traffic lights there have a state before changing from red to green. The amber light is turned on before the red goes out and the green goes on. I think that's to get people to rev up their engines.  :smileyvery-happy:<a href="http://en.wikipedia.org/wiki/Traffic_light" target="_blank">http://en.wikipedia.org/wiki/Traffic_light</a>
0
Reply x9561 (148650) 4/15/2008 10:40:05 PM

Yes, there could be more than 3 states and that would be easy to expand.
&nbsp;
Still, it is unlikely that we ever need all possible 2^3 states of the three booleans. :D
0
Reply x9561 (148650) 4/15/2008 10:40:07 PM

Ravens Fan wrote:

But I've always said that PA is a little backwards.:smileywink:&nbsp; Sorry, Ben.:smileyvery-happy:
(You must have put this in after my post).Hey! I'm originally from Philly. Oh, wait. I see your point. :smileyvery-happy:
0
Reply x9561 (148650) 4/15/2008 10:40:08 PM

Let's say I use an Xcontrol for the traffic light CLD example, my Xctrl&nbsp;has a cluster with the 6 lights indicators and outside the cluster on its own is the "left turn detector" boolean dub the "vehicle indicator". Now I need 2 pairs of lights always working in pairs and the other intersecting pair to work different.
&nbsp;
Do I create&nbsp;two Xctrl, one for North-South and one for East-West. I see its&nbsp;easy to make them all work the same, in this case I need two pairs to&nbsp;work opposite the other pair. Any verbal suggestions? 
&nbsp;
&nbsp;
&nbsp;
Btw, VA also has those dumb lights like PA. If you were speeding from afar approaching&nbsp;the lights, the red and green were both glaring so until you got right up on the traffic signal (braking) was when you could tell you had the light. Here in NJ we have traffic egineering, jughandles and left lanes are NOT for turning left but for going straight.:smileyvery-happy:


TrafficLight_Xctrl.PNG:
http://forums.ni.com/attachments/ni/170/316476/1/TrafficLight_Xctrl.PNG
0
Reply x9561 (148650) 4/15/2008 11:40:07 PM

richjoh wrote:
Btw, VA also has those dumb lights like PA. If you were speeding from afar approaching&nbsp;the lights, the red and green were both glaring so until you got right up on the traffic signal (braking) was when you could tell you had the light. Here in NJ we have traffic egineering, jughandles and left lanes are NOT for turning left but for going straight.:smileyvery-happy:

Oh yes.&nbsp; I forgot about those Jersey jug handles.&nbsp; The only state where you can't make a left.&nbsp; You have to make a half a dozen right turns and take 10 minutes to do it.&nbsp; I didn't realize VA had those lights as well.&nbsp; One of the things that trips me is I when I've sitting there waiting for the red light to go away and never notice that the green arrow lit up because it isn't has bright and noticeable.&nbsp; Hopefully there is no one behind me (like a local) blowing their horn.&nbsp; And since I have Ravens plates in Steelers country, they blow their horn a little louder.:smileyvery-happy:
0
Reply x9561 (148650) 4/16/2008 1:40:04 AM

If you are old enough you may remember when traffic lights had only red and green, no yellow.  The red came on with the green for a few seconds before the green went off.  Those were horrible for color blind people like me, because sometimes you did not know the red was on until the green went off - no advanced warning.  Yellow is so much more user friendly. Lynn
0
Reply x9561 (148650) 4/16/2008 3:40:06 PM

I'd like the XControl to handle these kinds of traffic lights: <a href="http://www.youtube.com/watch?v=V3q8M1CUqFY&amp;feature=related" target="_blank">http://www.youtube.com/watch?v=V3q8M1CUqFY&amp;feature=related</a> <a href="http://www.youtube.com/watch?v=Upq4KhHJKTE&amp;feature=related" target="_blank">http://www.youtube.com/watch?v=Upq4KhHJKTE&amp;feature=related</a> <a href="http://www.youtube.com/watch?v=_sWdYiqdZlA&amp;feature=related" target="_blank">http://www.youtube.com/watch?v=_sWdYiqdZlA&amp;feature=related</a> <a href="http://www.youtube.com/watch?v=1X_xRn3UFaY&amp;feature=related" target="_blank">http://www.youtube.com/watch?v=1X_xRn3UFaY&amp;feature=related</a> :smileyvery-happy:And, of course, Monty Python has their own <a href="http://www.youtube.com/watch?v=BzOZOvHv1p8&amp;feature=related" target="_blank">ode</a> to traffic lights.
0
Reply x9561 (148650) 4/16/2008 3:40:08 PM

whoops here the code


My_CLD_TrafficLight.zip:
http://forums.ni.com/attachments/ni/170/316685/1/My_CLD_TrafficLight.zip
0
Reply x9561 (148650) 4/16/2008 4:40:06 PM

OK officially here is the final soln to the Traffic Light sample CLD exam. I replaced all those booleans const with Bundle by Name and now its a little easier to read or debug. Currently&nbsp;my soln's&nbsp;North-South (default) state&nbsp;has all the booleans correctly set, you need to go through the rest and set red, yellow green whatever or red+green if you live in those States like....mentioned above.
Once again, for those planning to take the CLD, you need to add a few things, a subVI, comments and maybe 1 error handler (but stop lights should not ERROR or someone's life could be in danger! Just 1 case where poping up an&nbsp;error&nbsp;in the face&nbsp;is not the best idea, but maybe something smarter would do justice. But, its only a test...
Xctrl: works great for controls on the front panel but I'm using indicators. The facade VI events need to be fired. I have not yet work out how to make an xctrl indicator in my stoplight soln work for simple block diagram. Could be that its more work using xctrl but not sure at this time.
The attached includes the *.ctrls I forgot to include from the thread post.Message Edited by richjoh on 04-16-2008  11:31 AM


My_CLD_TrafficLight1.zip:
http://forums.ni.com/attachments/ni/170/316684/1/My_CLD_TrafficLight1.zip


CLD_Exam_TrafficLight_Soln_richjoh.PNG:
http://forums.ni.com/attachments/ni/170/316684/2/CLD_Exam_TrafficLight_Soln_richjoh.PNG
0
Reply x9561 (148650) 4/16/2008 4:40:06 PM

Altenbach, I had the impression that you wanted to write your whole code into one XControl.Off course, the traffic light can be easily packaged into an XControl.Intermediate 1 did have (at least 2 years ago) a scope on writing master/slave patterns using queues.Ton
0
Reply x9561 (148650) 4/17/2008 4:40:04 AM

In this case, I&nbsp;do the Certified Labview Developer "Sample Car Wash Exam". I find the specs to be quite involved, maybe got carried away. Unlike the "Stop Light" exam above, each case in the Car Wash specs has its twist.&nbsp;It must have taken the author a while to come up with a soln. You can find it here <a href="https://lumen.ni.com/nicif/us/ekitcldexmprp/content.xhtml" target="_blank">https://lumen.ni.com/nicif/us/ekitcldexmprp/content.xhtml</a>.  
&nbsp;
Anyhow, I took a look at NI soln and I would take a few points off for how the final block diagram is done.&nbsp;I'll let you be the judge and see for yourself. I also include pics of the steps leading up to my .... shall I say loosely defined "Style". I did go ahead and use a subVI this time, the block was littered. This was done only after probing like hell that my code works. In an exam, you'd want to do this once for points of course.
&nbsp;
My exam soln, attached, is not fully complete. It should make good learning exercise for CLD candidates. Guess if time allows I'll finish it completely and post.
&nbsp;
Ho hum, ladi da, the only example left is "Sample Security System"....


12.PNG:
http://forums.ni.com/attachments/ni/170/317040/1/12.PNG


CarWashCLDPics.zip:
http://forums.ni.com/attachments/ni/170/317040/2/CarWashCLDPics.zip


MyCarWashCLDSoln.zip:
http://forums.ni.com/attachments/ni/170/317040/3/MyCarWashCLDSoln.zip
0
Reply x9561 (148650) 4/17/2008 8:40:07 PM

Hi Richjoh, I assume the 12.png is you solution of the CLD?I have a few points:- You should update the state in a queue OR a shift register, using locals for this is not good
- How can it be there is a type-def conversion?
- Your shift register's are unlabeled
- I don't fully understand the Invert Arithmic OR of an inverted boolean, it looks like nothing is changed there.
- No error handling
- For the Car-Wash indicators, you start with a constant with all 'F', you convert one of them to 'T', you should do that in the constant directly
Grasp the idea of the state machine, having a conversion dot is killing, it makes sure your code is not expandible.Ton
0
Reply x9561 (148650) 4/18/2008 3:40:08 PM

TonP,
&nbsp;
I agree, the better choice is for state update is shift register... A queue well thats more stuff on the block diagram...at least 3 or more queue func. 
&nbsp;
Thank the Author of this exam for the Type def conversion. I copied his/her front panel and some ctrls are Typedef. Your correct on labelling shift registers, I don't make it this pretty, when I'm doing programming for real (the pressure for time usually doesn't allow it. Besides can't we read some wire, do I have to label every single nickel dime... here there.
&nbsp;
OR need to see a 1 to trigger, two ZEROs does nothing, thus the need for the double invert but check the code for yourself. "No error handling", once more does this mean I drop a error popup on my block diagram? If this is a test yes of course. Does the spec say handle some error, NO, from what I read.
&nbsp;
I think my way of setting the const are better when you need to make a change especially all the debugging. I will follow this with a post of the final soln. Anyhow, much thanks for the response! Your comments are welcome
0
Reply x9561 (148650) 4/18/2008 4:10:09 PM

richjoh wrote:
Here the FINAL soln for the sample Car Wash CLD exam. Maybe someone can learn from this cus NI example is well, I'll let you be the judge. 
Thank you, I will be the judge. Frankly, I prefer the NI solution. It's cleaner. Your solution:- Still has no error handling.
- Duplicates cluster constants unnecessarily.
- Mixes enum datatypes - this is always a bad idea.
- Has wire bends all over the place.
- Uses local variable where you should be using a shift register.
- Uses unnecessary logic calculations (in your "Vehicle OOP" state):<img src="http://forums.ni.com/attachments/ni/170/317306/1/Example_VI_BD3.png"> 
 - Still doesn't use the standard 4-2-2-4 connector panes.
- ...
 Message Edited by smercurio_fc on 04-18-2008  11:27 AM


Example_VI_BD3.png:
http://forums.ni.com/attachments/ni/170/317306/1/Example_VI_BD3.png
0
Reply x9561 (148650) 4/18/2008 4:40:08 PM

Here the FINAL soln for the sample Car Wash CLD exam. Maybe someone can learn from this cus NI example is well, I'll let you be the judge. I also post all my steps that includes my debugging...
Well on to the sample Security System exams... whey. This one was over-kill I think for any walking into an exam and doing this cold turkey


Final_CarWashCLDPics.zip:
http://forums.ni.com/attachments/ni/170/317304/1/Final_CarWashCLDPics.zip


FinalSoln_MyCarWashCLDSoln.zip:
http://forums.ni.com/attachments/ni/170/317304/2/FinalSoln_MyCarWashCLDSoln.zip
0
Reply x9561 (148650) 4/18/2008 4:40:08 PM

OK the VI attached above did not include the dependencies.Tthe attached VI&nbsp;INCLUDES&nbsp;dependencies (2 TypeDef Controls) this time.... You should be able to open this Solution for the Car Wash example....


FinalSoln_MyCarWashCLDSoln.zip:
http://forums.ni.com/attachments/ni/170/317311/1/FinalSoln_MyCarWashCLDSoln.zip
0
Reply x9561 (148650) 4/18/2008 4:40:10 PM

smercurio,
I explained my error handling issue in my response to TonP above. Not sure what you mean by Duplicate cluster const unnecessary. Take your choice of more wiring (that some liked to be labelled) or duplicate error cluster. Anyhow is this a way to nickel and dime code... lets leave that for NI CLD exam graders. I create 1 and only 1 enum during this soln. My enum connects to a TypeDef (a given exam variable). I don't see a problem with wire bends, once more what purpose does this serve. I seen lots of real code with lots of wire bends, if you can't trace code there is a triple click mouse button to trace. Your logic show above is correct. but in my VI I use THREE booleans, can you show me this using 3 booleans, I have not back checked this yet, it appear a trivial matter during a test... does this mean points off regarding your comment on unnecessary logic?
&nbsp;
I would go through my real code and not nickel and dime the pics just yet...
&nbsp;
Attached is another post of NI block diagram case anyone didn't see this case... you can take off points, I see bent wire on here tooMessage Edited by richjoh on 04-18-2008  11:55 AM


NI_Soln_CarWashBlkDia.PNG:
http://forums.ni.com/attachments/ni/170/317319/1/NI_Soln_CarWashBlkDia.PNG
0
Reply x9561 (148650) 4/18/2008 5:10:08 PM

Your "explanation" of error handling didn't explain anything. You are calling property nodes and they have an error out. These should be wired so you can handle an error with them. Is an error likely? Probably not. However, it's possible. Also, who said anything about duplicate error clusters? You seem to be misunderstanding the distinction between necessary wire bends and superfluous wire bends (AKA sloppy wiring). Your VI has numerous superfluous wire bends.You also seem to be missing the whole point. You're focusing on "nickel and diming". That's not the point of the exam. The point of the exam is to instill proper design and coding practices. The points are to indicate where a program is lacking this. Your attitude makes it clear that you don't seem to care too much about this and are more worried about what's considered to be "points off". To be honest, I doubt you will ever pass this exam with that attitude.
0
Reply x9561 (148650) 4/18/2008 5:10:09 PM

richjoh wrote:

Not sure what you mean by Duplicate cluster const unnecessary. 

For example, your "car wash indicator" cluster is duplicated in each case of the case structure. If you would place it outside, you only need one instance. (Same amount of wires!)
&nbsp;
If you would ever need to modify it, you currently would need to make identical changes in 6 different cases instead of one. This is 600% more work and at the same time&nbsp;dramatically increases the chance of coding errors (what if you forget one case or accidentally switch one of the booleans?). :o
&nbsp;
<img src="http://forums.ni.com/attachments/ni/170/317321/1/duplicates.PNG"> 
&nbsp;Message Edited by altenbach on 04-18-2008  10:04 AM


duplicates.PNG:
http://forums.ni.com/attachments/ni/170/317321/1/duplicates.PNG
0
Reply x9561 (148650) 4/18/2008 5:10:09 PM

Your subVI should do a sanity check on it's inputs, thus an error out seems appropriate. The enum given is only given in the example. There is never stated you should use it, and if you choose to use it, then use it and don't connect it to your own enum.The power of the queue is that you can overrule the FIFO functionality of it, this might be usefull (even in a CLD exam).In your example (12.png) you had two shift register containing a timestamp. It was not clear to me what the meaning of those two were, thus you need documentation.My rule of thumb:Documentation is at least 50% of any programming time.(and no I don't stick to that:smileywink:) Ton
0
Reply x9561 (148650) 4/18/2008 5:40:05 PM

Ahhh, Altenbach
excellent observation, the pic post really help. As at this point my eyes are&nbsp; quite bored with code. I could have move the duplicate const outside early on... but again this is really nit picky I would think during an exam. 
Would you take points off for this if you were judging subjectivly let say???&nbsp;Of course&nbsp;you would if an established point system&nbsp;had&nbsp;directly noted this ahead of time.... Anyhow I thought the point is to add up points not deduct what you see fit.
0
Reply x9561 (148650) 4/18/2008 5:40:06 PM

Why wouldn't he deduct points for taking up unnecessary memory space by instantiating six copies of one constant?&nbsp; If you did a similar thing inside a side loop, you would be constantly creating and destroying constants, taking up memory and cpu cycles.
0
Reply x9561 (148650) 4/18/2008 5:40:07 PM

Sorry about not following long with this thread but I'll try to catch-up.
1) Unless you are concerned about the 8 picoseconds it take to support the un-used connector pane terminal, always choose a pattern that has extras.
2) I am not responcible for the traffic lights in PA so no harm to me. What is really crazy are the traffic circle of New England. The rules there seem to be A) Don't make eye-contact, that implies you are yielding B) If having a hard time getting in, look for a car that cost more than yours and aim for it, they'll slow down. C) The only thing more dangerous than driving in NE is driving in Steeler country with ravens plates.
3) Has anyone looked at the VI's the DAQmx wizards produce? Since when is it leagal to wire an input to the right side?
4) I would never attempt to write an XControl for an exam. They are applications in themselves and the last thing I want to have to write two apps in a time limit.
Ben
0
Reply x9561 (148650) 4/18/2008 5:40:08 PM

Your "explanation" of error handling didn't explain anything. You are calling property nodes and they have an error out. These should be wired so you can handle an error with them.
&nbsp;
smercurio,
you made your point, but if property nodes error handler must be wired, I suggest NI make them "must be wired for run"... otherwise... they can be avoided. it (the way it is) currently does the job.
0
Reply x9561 (148650) 4/18/2008 5:40:08 PM

JeffOvert,
Your correct,
&nbsp;
but, I'm not using a 286PC running DOS worrying about cpu time and cpu cycles for this one. I have plenty of power under my hood here. My task manager cpu processing is nill... Maybe some much much bigger project, not this one...
&nbsp;
Because I copied the State going from one to the next the code const were copied... ah I'm going to lunch now...:smileyvery-happy:
0
Reply x9561 (148650) 4/18/2008 5:40:09 PM

JeffOvert,
Your correct,
&nbsp;
but, I'm not using a 286PC running DOS worrying about cpu time and cpu cycles for this one. I have plenty of power under my hood here. My task manager cpu processing is nill... Maybe some much much bigger project, not this one...
&nbsp;
Because I copied the State going from one to the next the code const were copied... ah I'm going to lunch now...:smileyvery-happy:
0
Reply x9561 (148650) 4/18/2008 5:40:09 PM

richjoh wrote:
&nbsp;it (the way it is) currently does the job.


You're still missing the main objective of the exam. They are looking for proper application architecture, and error handling is part of that. 
&nbsp;
Now weather Property Nodes need to be error handled is a question. Sometimes I do, sometimes I don't. It depends on what they doing.
&nbsp;
&nbsp;





richjoh wrote:
Anyhow I thought the point is to add up points not deduct what you see fit.

If I were grading an exam like this, I would start out assuming they have the maximum points possible, then deduct points as I finds errors.
0
Reply x9561 (148650) 4/18/2008 6:10:11 PM

Ed, I already explained my issue i.e. slapping an error handler on the block diagram above. OK, I'll say it again. During the exam thats all that needed, an error in, error out and Simple Error handler pop-up VI from the tools pallette. I guess if I wired all&nbsp;my errors nodes I will get less extra off too. 
&nbsp;
In all 16+ years at school, they use a method tallying up points for credit. In my opinion, for exams like this, a&nbsp;rock solid point system should be used to tally the grade. 
&nbsp;

"" If I were grading an exam like this, I would start out assuming they have the maximum points possible, then deduct points as I finds errors.""
find errors??? you mean find code thats not up to your guidance standard&nbsp;or code that errors??? Let say the code does the job. If code is not up to your stardard then yes, some would fail. If you mean Code that does not error, well that would pass.
Anyhow the exam is 4 hours, I could sit here an enhance enhance all day with the code if I like. Most candidates will be cut for time on dressing up there code.
0
Reply x9561 (148650) 4/18/2008 7:10:06 PM

OK, now for an objective comparision here, lets compare my top level VI size to NI's top level VI... Take a look at the pic you will see my VI size is 3.65X smaller the NI VI... Hmmm, maybe if I added all that stuff there making up, uuuhmmm, I mean marking up it would be larger.. I guess :smileysurprised:


MyMemorySize against NI_Soln.PNG:
http://forums.ni.com/attachments/ni/170/317387/1/MyMemorySize against NI_Soln.PNG
0
Reply x9561 (148650) 4/18/2008 8:10:06 PM

richjoh, the point everyone else is trying to make, is that in a task that is fairly trivial, like the car wash example, it doesnt really count for much if you can solve the problem. What counts is the manner in which it is solved, i.e. how you would go about solving a much, much bigger project. If a person has sloppy code on a simple application then it is assumed that things would only go from bad to worse in a real project.In four hours they cannot ask you to do anything really complicated so the give a simple-ish task and see you tackle that, and from that can infer your skill level. It is not a perfect system however.The thing is, if you want to pass (and I have not even done CLAD so I shouldn't be commenting here) then you need to learn the rules to pass the exam (i.e. work the system). What I mean is, if you desire to achieve the end result of having a certification, you have to whatever is necessary to pass, regardless of your personal preferences.&nbsp; The irony is that working out what the rules are, and learning how to trick examiners into thinking you know exactly what is going on, actually ends up with you knowing what you should have known in the first place :smileyvery-happy:my 5 pence
0
Reply x9561 (148650) 4/18/2008 8:10:06 PM

Nrp, I'm no expert at LV, neither do I claim the task of Car Wash as trivial. RULES for passing the&nbsp; CLD exam&nbsp;are known by NI and NI alone otherwise we would all know the grading method,&nbsp;and thats&nbsp;my personal opinion. I remember engineering as being tested on you getting the answer and adding up points showing how the answer was arrived. If the answer was not arrived well you got points for all things put correctly toward a final answer. So we can agree there are rules to follow to pass the exam, I just don't strictly code by them in real life work... I've had more experienced developers tell me conflicting recommendations against NI "stardard" way.
0
Reply x9561 (148650) 4/18/2008 8:40:09 PM

Apparently, the both Authors of the NI practice CLD Traffic Light and Car Wash exam could have followed there own guidelines more strictly. 
For the Traffic LIght exam, my top level VI is 77.2 kbytes vs&nbsp;the Author's&nbsp;259 kbytes!!! Thats 3.35X smaller memory foot print, Wow!!! see attached. (Just like to mention this disclaimer, smaller size always&nbsp; DOESN'T mean&nbsp;better.) Possibly, they didn't put much time into code and left it as is... Its the one thing (the size) I found I could compare.Message Edited by richjoh on 04-18-2008  04:36 PM


MyMemorySize against NI_Soln_TrafficLight.PNG:
http://forums.ni.com/attachments/ni/170/317404/1/MyMemorySize against NI_Soln_TrafficLight.PNG
0
Reply x9561 (148650) 4/18/2008 9:40:06 PM

One thing to mention: The examples are probably saved with LabVIEW 7, thus the disc size is probably twice the size of an 8.x VI.The scoring of the exam is written down:
 Applications are graded on the following three criteria: - Functionality
- Programming style
- Documentation
 Each of the criteria have approximately equal weight.   Passing grade is 75% or higher.
So if your documentatoin is bad (0 points) and your style is bad (0 points) you will fail.I think your examples will pass, but I am not sure with how much.If I tell more I would be violating my CLD agreement.Ton
0
Reply x9561 (148650) 4/19/2008 11:10:05 AM

I think it's fairly obvious that this guy has made up his own mind, and no amount of discussion will sway him, regardless of the fact that it's coming from people with a combined amount of experience that must be in the centuries.  Oh well, I'm sure that he'll probably write up code that will happily keep someone else employed when they have to go and clean it up. :smileyvery-happy:
0
Reply x9561 (148650) 4/19/2008 2:40:05 PM

Just a little sidenote for everyone who never took any certification: If you are thinking about taking the trials, you should get a friend of the NI style guide. And the best thing you can do is NOT to complain about it, but giving it a try in some smaller projects just to incorporate at least some of the styles.And, maybe, maybe not, you will see some advantage for your daily projects by following the styles. If this happens, you will definetly have a much simpler start for your CLD. Nevertheless, it is no guarantee to pass it on your first try!And to sum up the point richjo seems to follow all through the discussion:Building software is a creative way and following too many rules will propably hinder creational thinkings (thinking out of the borders or something like that). That is of course true; but the style guide don't want to constrict the way of building algorithms, but wants to improve readability, scaleability over the whole project. So you can view the guide as a suggestion on how to translate an algorithm into code and not as a rule on how to build algorithms....And never forget, in software engineering, the is no silver bullet ;)just my personal, subjective thinkingsNorbert
0
Reply x9561 (148650) 4/21/2008 8:10:05 AM

Well said, Norbert. I have been programming in LabVIEW since v2, and I have never seen the Style Guide as a hindrance, limitation, or whatever. (Yes, I know the Style Guide wasn't out back then, but you get my point.) Indeed, I have seen the Style Guide as a tool to improve my programming implementation, rather than an impediment to the creative process. Do I agree with everyting that's in the Style Guide? Of course not. However, I think that dismissing it, claiming it's pedantic is hardly justified.
0
Reply x9561 (148650) 4/21/2008 2:10:07 PM

TonP, If the exam were saved in LV 7 (this appears to be true), I resaved NI solutions for the Traffic Light and Car Wash in a project using LV 8.2.1. My VIs are still smaller than NI posted solutions...The stats - Traffic Light 92.2kB vs NI 120kB, but this was a simpler VI/exam for that matter.For Car Wash 101kB vs NI 202kB, this exam was not so simpleIs this bad choices on the block diagram as to why NI's Car Wash soln is TWO TIMES (2x) the size of mine? I'll let you be the judge. Regardless, my Main VI is quite simpler to follow compared to NI's Main VIs.Let's clear up what I'm saying here... - NI solutions for the practice exams are not the best, in fact, I'll post a better one, explaining my steps. Sort of a tutorial... . I looked at NI solutions for guidance and was taken back by there complexity at solving the problem created probably by its author!!!Lastly, over the weekend I started the CLD Security System Exam and didn't come up with a soln right away. The requirements demand even more effort than the Car Wash exam I mentioned about above. I have not look at the solution for the security system yet, I want to come up with mine first. I'll now start from a clean slate to attempt my solution for the CLD Security System examMessage Edited by richjoh on 04-21-2008  01:46 PMMessage Edited by richjoh on 04-21-2008  01:48 PMMessage Edited by richjoh on 04-21-2008  01:49 PM


TrafficLightProj_FileComparision.PNG:
http://forums.ni.com/attachments/ni/170/317792/1/TrafficLightProj_FileComparision.PNG


CarWashProj_FileComparision.PNG:
http://forums.ni.com/attachments/ni/170/317792/2/CarWashProj_FileComparision.PNG
0
Reply x9561 (148650) 4/21/2008 7:10:06 PM

Please don't just show the file size, it is meaningless.
&nbsp;
Show the itemized list from "VI properties...memory usage" before running (but after saving in the current version if upgrading or downgrading). A freshly up- or downconverted VI is often less efficient until saved again in the current version.
0
Reply x9561 (148650) 4/21/2008 7:10:06 PM

Altenbach, excellent suggestion, I can't seem to remember it all...Well here are the stats.My Traffic Light 77.2k vs NI 91.0kMy Car Wash 67.7k vs 90kafter I removed my redundant boolean cluster mention above in the thread. I get this result...My Car Wash 61.1k vs 90k. Thus for the nhay sayers my VI are smaller. In fact I'm only 2/3rd (0.678) the size of NI Car Wash soln. Removing the redundant cluster shaved a mere 6k from memory.Now go and read NI's block diagrams and judge for yourself if they follow their own method defined in the Style, Design handbook... at least give us a good example before going off grading in a subjective fashion, all the while concelling specifically how points are tallied...Message Edited by richjoh on 04-21-2008  02:43 PM


TrafficLightVI_FileComparision.PNG:
http://forums.ni.com/attachments/ni/170/317799/1/TrafficLightVI_FileComparision.PNG


CarWashVI_FileComparision.PNG:
http://forums.ni.com/attachments/ni/170/317799/2/CarWashVI_FileComparision.PNG


RemoveMyRedundantBundle_CarWashVI_FileComparision.PNG:
http://forums.ni.com/attachments/ni/170/317799/3/RemoveMyRedundantBundle_CarWashVI_FileComparision.PNG
0
Reply x9561 (148650) 4/21/2008 8:10:06 PM

While we are so concerned with size of things, and to lighten up this discussion, and be amazed at what some people with too much spare time on their hands can create, please visit <a href="http://www.256b.com/download/225" target="_blank">this </a>URL Download the zip file (nothing dodgy here, I promise), run the .com file in the zip (again nothing dodgy I promise again) and be astounded. (for those that dont get it, the entire program is 256 bytes!!!!)Source code is included in the zip, but its all nonsense to me :-)
0
Reply x9561 (148650) 4/21/2008 8:40:09 PM

richjoh wrote:[...]Let's clear up what I'm saying here... - NI solutions for the practice exams are not the best, in fact, I'll post a better one, explaining my steps. Sort of a tutorial... . I looked at NI solutions for guidance and was taken back by there complexity at solving the problem created probably by its author!!![...]richjoh,i still don't understand why you are complaining about the solutions in such an angry way. Take it like it is: NI creates a style guide, mostly from feedback from customers, who are creating very large applications with LabVIEW. Those style guides, as i already stated several times, it is your own business if you follow them or not in your daily work.On the otherhand, the certification CLD shows the programmer: you are skilled in software engineering, implementation of algorithms in LV and, of course, knowledge and incorporation of the style guides. It does not matter if you like it or not, if you fail the last point, you will somehow most propably always fail the exam.And as to many things: style of source code is like beauty; it's within the eye of the watcher.....Just to clear up what "no silver bullet" means: Frederick Brooks wrote back in the 80's a paper with the same name beginning with a comparison to fantasy: a monster called "werewolf". The werewolf, normal disguised as a known person, suddenly turns into a monster, only killable by a bullet made of silver. In the next clause, he compares a software project with the werewolf and states that in software engineering, there is NO SILVER BULLET since software is not distinctive like a werewolf...... So software has no golden solution for everything. You have to find your own solution, choosing your own way to implement it. Each way is like a medal with a front and a back.Now i am wondering, why you are so "hang up" upon the file size. Sure, file size CAN matter; in this case, i think not. On the other hand, maybe your solution is laking of any documentation leaving the code unreadable and therefore difficult to maintain and scale..... So is your solution better? I cannot judge that since i don't want to look into every peace of both solutions. And, it is not my job...I am very sure that you can get full points in the exam even if your solution is very different to the sample solution if you incorporated every important point for the appraisal. And nobody said, that the NI sample solution is the one and only way how to do it. But keeping close to it will help you getting the CLD, regardless of your personal preferences on programming style.So, from my side, you can post as many further examples on how you think it would be better solved, it will not change the fact that all other people out there, who took and got the CLD, incorporated at least some of the styles and are, surprise surprise, very happy and confident with that.just my personal, subjective thinkings,Norbert
0
Reply x9561 (148650) 4/22/2008 7:40:06 AM

Ravens Fan wrote:






altenbach wrote:



&nbsp;Have you ever seen a light where the red and green are on at the same time? 


You know what? I have.&nbsp; Some places in PA near where my in-laws live have these lights that have a solid red and a green left turn arrow on the same time.&nbsp; Even though the green arrow comes on, the light stays red.&nbsp; I don't know precisely what that means.&nbsp; Does that mean you have to stop before you make a left?&nbsp; 

It may indicate that you&nbsp;may take&nbsp;a FREE-LEFT. :smileyhappy:
0
Reply x9561 (148650) 4/22/2008 9:10:11 AM

Hmmm... Do I reply from the other side? Why not?
Norbert replied saying "i still don't understand why you are complaining about the solutions in such an angry way. "
Norbert,
What I hear John (?) saying but not writting is one of my gripes.&nbsp; The da@# test are being used to decide if people are qualified for LV dev jobs! :smileymad:&nbsp;As mentioned earlier in this thread the guidelines used to judge the code are just suggestions but are used as criteria in the test grading. Since the guidelines are not directly associated with good code or bad (we have a different set of standard in my shop that we think are better than the public standards), using them to grade tests is not reflecting an individuals ability to code. So it seems to me that using the LV tests to judge if a person should be coding in LV is almost like givning someone a spanish test to decide if they would be a good french translater, after they are both languages. :smileysurprised: 
The tests as I last took them, do not appear to give credit for the experience and the knowledge of the developers but (sadly :smileysad: )&nbsp;mainly test a persons ability to gooble-up a bunch of rules and regergitate them on demand.
What would change my opinion? Seeing or hearing feed-back on a test that read "Nice code!" "Novel approach." or "I learned something today!".
Clarification:
I am not knocking the graders. They are just doing their job. It is the test that bugs me.
That's just my 2 cents,
Ben
(still a hater of tests)
0
Reply x9561 (148650) 4/22/2008 11:40:06 AM

Ben, i like your open way to turn in "the other side" ;)Well, just to "defend" NIs way of the tests, i want to explain the following:There are so many developers out there claiming: "I am expert in LV!". Now there arises a problem: If such a developer creates a bad solution full of race conditions, unreadable and goldbergish code, whos fault is that?Since the developer is most often the one and only talking to his customer, NI often faces the problem that such customers are told: "It is not my fault. LabVIEW is not able to solve the issue in a given way. I tried even support, but they just ignored me..." They wouldn't dare to tell their customers we NI would "ignore" them: Sending in the whole app with 100+ MBs of VIs containing nonsense codefragments and unreadable, erroneous algorithms. NI tells those customer: break your issue apart until you have a small example where the issue is reproducable. But sadly, often enough those "developers" are either not able to do that or they don't want to do that.......The point of the certifications is not to determine "good developer &lt;-&gt; bad developer". There are many, many developers out there doing a very good job in LV without taking the exam. But the exam wants to guarantee a certain level of LV knowledge. Since the knowledge of a tool is not the only important thing for taking a project to success, NI tries to test that knowledge, too. The intension is, for endcustomers to ensure that they will roughly get what they want and what they are paying for.This does not mean by any means that someone without CLD or CLA could solve a project faster/better/more intuitive! But the chances for failures are minimized if asking for someone who is certified. And that is the reason why certifications have to be refreshed. And this is why NI tries to standardize on certifications: To provide the endcustomers with working, nice and useful products written by people like everyone who is reading this posting.So, we can discuss the content of the test and/or their purpose nearly endlessly ;)But to address the original statement of this thread: The tests are designed and carried out by NI. NI creates a sample solution and the examinees solution could be compared to it. But there are other ways to look into someones work without comparing to an existing (perharps "bader") solution: For instance, you can use the VI Analyzer tool to check for the NI style guides. Or you can simply made a functional test. Whatever test you are doing, it is somehow subjective since the rules of appraisal are made by humans and humans are always subjective.You just life with that and do what is neccessary to succeed or leave it. just my 5 cents,Norbert
0
Reply x9561 (148650) 4/22/2008 12:10:06 PM

Hey, I have been following this for a while and just wanted to throw my two cents in...
I am what could be called a "classically" trained programmer. I started out in text based languages (and still work with them), such as C/C++, Java, and VB, and have now been working with LabVIEW as well for the past 4 years.
EVERY language has what could be called a "style guide" that programmers (good ones) follow, even if not so strictly. They follow these guidelines so that code is as consistent as possible, while not necessarily being implemented the same (everyone has their own "style" and solutions for a problem). It helps future developers working on the code, it helps others to understand what the code is doing. These style guidelines are a consensus of the population, including NI's 'style guides', its not the developer of language says "HEY!! This is how you do this, other ways are wrong!!!" The population gets together through trail and error and settles on these guidelines for the benefit of population...Whether you can see the reasoning behind these guidelines or not they are there to better serve the population, so follow them...even if loosly.
To reiterate: You can implement things as you see fit...however, the guidelines should always be followed when doing so.
Key guidelines are: DOCUMENT YOUR CODE (including good labels for controls/indicators), use a readable standardized design pattern with good dataflow (top-down, left-right, few or no local variables), and DOCUMENT YOUR CODE!!!!
0
Reply x9561 (148650) 4/22/2008 12:10:11 PM

Ben replies (still wearing the other hat, just for fun :smileywink: ) to Norbert who wrote



The point of the certifications is not to determine "good developer &lt;-&gt; bad developer". There are many, many developers out there doing a very good job in LV without taking the exam. But the exam wants to guarantee a certain level of LV knowledge. Since the knowledge of a tool is not the only important thing for taking a project to success, NI tries to test that knowledge, too. The intension is, for endcustomers to ensure that they will roughly get what they want and what they are paying for.



&nbsp;
But it still strikes me as analogous to "measuring the temperature to asses to&nbsp; 'comfort-index' without taking into concideration the humidity". The tests are NOT a way "to determine "good developer &lt;-&gt; bad developer". ". I can not find the thread (without a lot of looking) but there was a very nice example posted by Christian that illustrated how to very quickly "find and remove all zros from an array" where he did something very clever and elegant. He slipped a wire BEHIND an "index array" function (that also used the value in the wire) to drive a subsequent ooperation. The code was very neat and clean and ran like a blizard, BUT technically he would have lost points because he ran wires behind an object (NOTE: I remember this example because it was the first time I said to myself "Now there is a good example of bending the rules!"). That same code, with the wires routed around the index would have had four wire bends.
Another example that makes me question the ability of the exam to asses a developer. I know of a developer that had passed the CLD and contiued to work with LV every day until it was time to re-certify. It turns out he did not paas the re-cert test. This baffles my mind how someone could be judged certifiable, continue to work and learn for two years and then end up not being a "good developer".
CONFESION TIME!
Failing the CLA exam the next time I have to re-cert is one of my great fears. :smileysad:
So returning to my main theme;
The tests are measuring weight when the real property we are after is mass.
Sharing my thoughts (and fears),
Ben
0
Reply x9561 (148650) 4/22/2008 1:10:08 PM

Ben, i completly understand your point of view and i am not eager (just like you) to take any tests except the daily ones at work :)Nevertheless, let's compare the CL's with tests back at school. Where all tests objective there? NO. Have all teachers used prewritten tests which were 1:1 comparable to previous ones? Hopefully NOT. Have all teachers used simple "templates" to determine which student is "good", which is "bad"? Hopefully NOT.Now, the last question is, as it seems to me, the point of discussion now. NI is just as a teacher back in school; the tests have to be prepared, a project has to be planned, "tested" and written down in a way that it could be used in the test. During this work, maybe different people work on the same thing, so the solution, the comparable piece of work to the "students one", is maybe not consistant in every part. So, just as back in school, we all hope that the grader takes a look into our work without using the premade solution as a template and decrementing points for all differences.I cannot and, to be honest, don't want to defend anyone who appraised a CL-test and failed to reward creative solutions if they were funcational, looking good and having a good documentation. Just as you all, i hope that those graders will die out sooner than later. But the major problem for graders ever was, nowadays is and ever will be that you have go the small ridge between appraising fast and fair. The fastest appraising method is template, the fairest would be going in depth to every bit and byte of your work. You will not have the time for fairest.Using tools as VI Analyzer for appraising is ok for me, if the grader takes a look into the issues the tool finds and deciding right on view if there are points off or not. But sadly, this is something, we can't influence much.....So we can only hope for the lords merci. But this is the nature of a test, taking place in a very short amount of time for testing something with a high duration. Maybe the best comparable test would be the test for the driver's license.... there are so many thing which can go wrong and they even wouldn't be your fault.... so why do you care about things you cannot influence much? Is someone who fails the drivers license on the first try a bad driver? Hopefully NOT. I know some people who are very good in things; but they are afraid of test-situations and because of this fear, they often fail. Due to the failurerate, the fear grows each new try. A visious circle.So its all about knowledge, preparation, mental strenght and, yes, luck.You can train mental strenght, you can prepare yourself as best you can and can build up as much knowledge as possible. But you cannot enforce luck.BUT: does this make tests "evil"? Is it better to grade everyone "passed"?Norbert
0
Reply x9561 (148650) 4/22/2008 1:40:09 PM

Hi Norbert,
Thanks for your replies and thoughts. I did not expect when relying to change the world or the format and contents of the certificaiton tests. I think we agree that (at their&nbsp;best) the tests "are shadows on the wall" (Plato's Republic).
Ben
0
Reply x9561 (148650) 4/22/2008 2:10:05 PM

First off, no one's whining about the NI soln. This is a comparsion of soln... thats the topic the last time I read. I've been aware of NI CLD methods since day 1 of training. I don't stick to all the methods in the handbook. You would be limiting yourself if you did (my opinion). One more time, in this thread, go back and read at least 2 issues I pointed out I don't agree with&nbsp;but is laid down in the handbook bible. I'm not the only LV person either breaking the rules, I've&nbsp;worked with&nbsp;senior LV guys doing it their way. 
&nbsp;
You can expect to fail the CLD or CA because its a judgement call (quite obvious too me), although I'm told its objective. NI will not say the method of tallying points and/or how the judgement call is determined. hellloooo
&nbsp;
Attached you will find code for the CLD Security System exam. At the time I write this, I have not peeked at NI soln for this. I failed to come-up with a Security System soln on the first try. It took while to put this together... several hours. I think this one is too hard for a 4 hours exam... unless you know what to expect of course.
&nbsp;
As I said, the attached VI project is incomplete, it only handles 1 zone like it is. Duplicate the case structure it will handle the six zone with a few changes.


MySecuritySystemCLD Pics.zip:
http://forums.ni.com/attachments/ni/170/318230/1/MySecuritySystemCLD Pics.zip


MySecuritySystemCLD_Soln.zip:
http://forums.ni.com/attachments/ni/170/318230/2/MySecuritySystemCLD_Soln.zip
0
Reply x9561 (148650) 4/22/2008 11:40:10 PM

OK, found or missed&nbsp;a&nbsp;BUG in the CLD Security System project I posted above. If you enable all three states, Tamper, Bypass Alarm and then disable respectfully&nbsp;in the same order&nbsp;state, the Status does not update... an easy fix I think can be done in the formula node. Anyhow later for this...I'll post the fix later, any ideas...
&nbsp;
Then again as I read the spec its written&nbsp;confusously, if that a word.Message Edited by richjoh on 04-22-2008  06:56 PMMessage Edited by richjoh on 04-22-2008  06:59 PM
0
Reply x9561 (148650) 4/23/2008 12:10:05 AM

richjoh said 
First off, no one's whining about the NI soln.
richjoh also said
Anyhow, I took a look at NI soln and I would take a few points off for how the final block diagram is done. 

Maybe someone can learn from this cus NI example is well, I'll let you be the judge.

Attached is another post of NI block diagram case
anyone didn't see this case... you can take off points, I see bent wire
on here too

Take a look at the pic you will see my VI size is
3.65X smaller the NI VI... Hmmm, maybe if I added all that stuff there
making up, uuuhmmm, I mean marking up it would be larger.. I guess

Apparently, the both Authors of the NI practice
CLD Traffic Light and Car Wash exam could have followed there own
guidelines more strictly.

Is this bad choices on the block diagram as to
why NI's Car Wash soln is TWO TIMES (2x) the size of mine? I'll let you
be the judge. Regardless, my Main VI is quite simpler to follow
compared to NI's Main VIs.

Now go and read NI's block diagrams and judge for
yourself if they follow their own method defined in the Style, Design
handbook.
0
Reply x9561 (148650) 4/23/2008 2:10:06 PM

Funny, you cut and paste post out of context. seems the whining is about my comments. I'm NOT in bed with NI, thus free to say my thoughts and respond to question like "i dont understand why..."
Nothing gained from your last post or this one... mention something thats of some useful hereMessage Edited by richjoh on 04-23-2008  09:16 AM
0
Reply x9561 (148650) 4/23/2008 2:40:09 PM

richjoh wrote:

Funny, you cut and paste post out of context. seems the whining is about my comments. I'm NOT in bed with NI, thus free to say my thoughts and respond to question like "i dont understand why..."
Nothing gained from your last post or this one... mention something thats of some useful hereI just found it quite humorous as to how you contradicted yourself with your statement, as well as before when you first were arguing that nowadays we all have fast machines, and a little extra code, like extra copies of clusters, would make no difference, and then was arguing that "my code is smaller, thus better". Frankly, I find the comment I'm NOT in bed with NI offensive, as it alludes that I am. You clearly know nothing about me, or else you would know that I am quite critical of NI in many ways. It also seems that the only "useful" posts to you are the ones that agree with you. In this particular case your approach to this issue doesn't seem to have garnered a whole lot of support, even if you had a valid point, and that seems to be lost to you. Perhaps in the future you may want to consider a more diplomatic approach.
0
Reply x9561 (148650) 4/23/2008 2:40:12 PM

I have an alternate soln for the Security System CLD exam. First though,&nbsp;my&nbsp;initial soln above I described a bug whenever all three Switches were enabled. One way to work-around is to disable the third switch whenever 2 switches are enabled. This could be&nbsp;determined inside the soln formula node and outside of it set with a property node.
Since I want to fully meet the requirements, I went ahead and rewrote the soln using an event structure and queues. For me a state machine&nbsp;using queues was just to hard to debug. (I remember a&nbsp;Senior developer always mentioned this about queues, now I know first hand).&nbsp;My Event stucture releaves me the burden of boolen states and determining what Zone the boolean is in. I was not able to do this without the use of setting an indicator to view the current item in Zone Queue (there is no other way to see whats in the queue). You can't set a probe on a queue and see whats currently in it.
Since I'm no expert on LV I found this problem to be quite challenging till I setup a way to see what in my queue. I&nbsp;think&nbsp;this problem is the most difficult out of the three practice exams. I&nbsp;peeked at NI soln for this and my personal opinion is my soln is easier to add feature and upgrade to include more alarms and zones. You make your own judgement. As far as memory size using&nbsp;LV 7.1, my Soln 255.2k, NI soln 163.7k. Of course, i must include this disclaimer, you need to add stuff e.g.&nbsp;subvi, notes etc etc...&nbsp;to my soln for a passing grade on the CLD as I have mention many times in this thread.
Well now this thread has three alternative soln versus&nbsp;NI CLD exam soln. Pulling out hairs, Alas!


MyAlarmSystemSoln_CD_Exam.zip:
http://forums.ni.com/attachments/ni/170/338775/1/MyAlarmSystemSoln_CD_Exam.zip
0
Reply x9561 (148650) 7/8/2008 8:10:10 PM

Follow-up to the prior post, Security System CLD soln is attached. Added the log file functionality.&nbsp;No errors (remove the debug queue indicator I mentioned above). My contribution to the future CLD examiners.


MyAlarmSystemSoln_CD_Exam.zip:
http://forums.ni.com/attachments/ni/170/339212/1/MyAlarmSystemSoln_CD_Exam.zip
0
Reply x9561 (148650) 7/9/2008 6:40:04 PM

76 Replies
124 Views

(page loaded in 0.201 seconds)


Reply: