LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Traffic Light CLD Soln vs mine

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 but is laid down in the handbook bible. I'm not the only LV person either breaking the rules, I've worked with senior LV guys doing it their way.
 
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
 
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.
 
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.
Download All
0 Kudos
Message 71 of 85
(2,258 Views)
OK, found or missed a BUG in the CLD Security System project I posted above. If you enable all three states, Tamper, Bypass Alarm and then disable respectfully in the same order 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...
 
Then again as I read the spec its written confusously, if that a word.


Message Edited by richjoh on 04-22-2008 06:56 PM

Message Edited by richjoh on 04-22-2008 06:59 PM
0 Kudos
Message 72 of 85
(2,250 Views)
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.


Message 73 of 85
(2,215 Views)

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 here



Message Edited by richjoh on 04-23-2008 09:16 AM
0 Kudos
Message 74 of 85
(2,206 Views)

@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 here


I 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.
Message 75 of 85
(2,192 Views)

I have an alternate soln for the Security System CLD exam. First though, my 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 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 using queues was just to hard to debug. (I remember a Senior developer always mentioned this about queues, now I know first hand). 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 think this problem is the most difficult out of the three practice exams. I 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 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. subvi, notes etc etc... 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 NI CLD exam soln. Pulling out hairs, Alas!

Oh there is an error at shut down, since queue is empty. To fix remove the Debug Queue case structure, otherwise eror free.



Message Edited by richjoh on 07-08-2008 03:15 PM
0 Kudos
Message 76 of 85
(2,065 Views)
Follow-up to the prior post, Security System CLD soln is attached. Added the log file functionality. No errors (remove the debug queue indicator I mentioned above). My contribution to the future CLD examiners.
0 Kudos
Message 77 of 85
(2,038 Views)

I looked at the NI solution and tried to come up with a different approach to the state machine.

My main goal was to create a very simple solution and one where the sequence could be edited and checked easily.

 

I must confess I haven't looked at the style guide recently but just tried to follow common sense when laying out the program but I would be interested to know what the NI examiners might of made of my submission!

 

I created a custom control for "Light Sequence" although I think it is mostly redundant as changes to the data do not carry through to the copy in the sub vi.

 

The solution is in Labview 8.5. I only implemented the east left turn switch in the sequence although it should be easy to add the others as they are catered for in the program.

 

My main concern with this example is not with the NI solution but with the way the exam question is worded. Particularly the timings they give for the on times of the lights. To be honest without looking at their solution I wouldn't have been able to see how the lights were supposed to work.

0 Kudos
Message 78 of 85
(1,878 Views)

Hi RevaD,

Can you post in version 8.2. (I'm stuck in a time warp with 8.2 for now...)

0 Kudos
Message 79 of 85
(1,810 Views)

RevaD wrote:

I looked at the NI solution and tried to come up with a different approach to the state machine.

My main goal was to create a very simple solution and one where the sequence could be edited and checked easily.


I have not looked at the overall logic, but here are a few points I noticed:

  1. (traffic lights.vi) The "ms time" in the typedef should be U32 to match the wait function.
  2. (traffic lights.vi) The sequence structure in the toplevel VI is not needed. The wait cannot start until the "get lights.vi" has completed, and the bundle operations take virtually no time. The VI will behave exactly the same without the sequence, so why clutter the diagram?
  3. (getlights.vi)  Instead of a one-iteration FOR loop with the sole purpose to carry the shift regsiters, you could use globally initialzed feedback nodes (no loop needed. This also eliminates the "first call" primitives and "select" nodes.
  4. (getlights.vi) Instead of rotating the array with the complicated data structure, you could rotate through the indices instead and leave the array in place. (Wrap according to the number of elements in the array and keep the index in a feedback node between calls)  This way, the "light seqence" could even be a simple diagram constant, no need to place it in a shift register.
  5. ...
Message 80 of 85
(1,799 Views)