Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

Sprinkler Controller Example

I have done this very quickly but still ran out of time and haven't done documentation and completed full functionality. I tried to complete full functionality but its not working. For some reason, the application jumps while running from east zone to west zone and both North and south zones are skipped completely. With highlight execution turned on, I found that the consumer loop takes two executions to run the command (case name)wired to the enqueue element functions. First time it just ignores it. I cant think of the reason. Maybe I am doing something very stupid. Also my rain selection sensor doesn't stop the controller.

 

Will appreciate feedback and advice.

 

Kind Regards

Austin

0 Kudos
Message 1 of 5
(7,459 Views)

There is quite a lot wrong with this. I know it is very difficult to do in four hours but keep practicing. I only took a quick look at it but these are the things I noticed.

 

  • No context help on front panel controls. Easy points! Do that right away.
  • Your rain sensor boolean text shows continuous run when set to the rain position. Put the boolean text away from the switch so it is not overlapping.
  • Size the front panel so that it is a normal size when opened. You don't need error clusters on the front panel. Use the simple error handler vi on the block diagram of the main vi so it executes last.
  • Wiring is very messy. Way too many bends. I know they say keep the block diagram small but your three loops could be bigger. I would much rather see a larger diagram with neat wires. Just keep it readable. You have wires going behind structures. In your event loop the queue reference is wired to a tunnel on the right side of the loop. That is not necessary but when I see wires behind structures combined with that I have to waste precious brain cells trying to see if it is actually going somewhere behind the loop.
  • The raining sensor doesn't work. Your consumer case does execute when it is pressed and it calls the "Controller_Raining.vi". That vi does nothing. You just preview the queue and if the next element is "Raining" you dequeue the element. You don't do anything else. Wire the raining boolean switch to the variant of the cluster and look at that in your consumer. Otherwise you only know that the value changed but you don't know what the value is.
  • The label for your zone setup array terminal is not shown on the block diagram. Always show labels on block diagram terminals. Besides you have to go out of your way to hide it. That's a valuable three seconds lost forever!
  • Put some kind of free label documentation on the block diagram. Even if the documentation is not very good it is better than none whatsoever.
  • Always label your wires on the left side of your loops. Things like "Consumer queue ref" and "display queue ref". Again make your loops wider so you have room to do that.
  • Put your terminals in places where it makes sense. The "Water Pressure" terminal is just sitting in your consumer loop all by itself. If you have an event handling it then place it in the event case for it. You only have one reference to it in your consumer "Start" case. I would put it there under the reference. And again you hid the label for the reference.
  • I never use block diagram cleanup. But if I was in the final seconds of my exam and had a block diagram that looked like yours, I would definately click on the little broom. If it makes things worse (in your case it won't) then press CTRL-Z or Edit/Undo Cleanup. Even though the BD cleanup is not perfect, NI hopefully will not ding you too much for using their tools. Put a free text label that says you used BD Cleanup and would tweak the wires to perfection and adjust the BD size if you had more time.
  • If you did not complete the exam (most people don't) then always say what you would have done. In the last fifteen minutes or so of the exam stop coding and start explaining what you would have done with more time. You should already know what you would have done because you should not write any code until you do know. It is ok to start on the front panel while you think about your architecture. Go over everything again making sure you have context help for subvis, context help on front panel controls, etc. But my advice is to do those things first when you drop a control or create a subvi. If you get into that habbit you will have more of that last fifteen minutes to document unfinished work.
  • If there is a bug and you know about it then document that you are aware of it. If you have an idea where the problem is or what the cause might be then say what you suspect the problem might be.

There is probably a lot more that I am overlooking but that is all I have time for right now.

 

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


Message 2 of 5
(7,440 Views)

In addition to the many good points that Steve gave you I would take a look at the LabVIEW style guides. To be blunt, this code would never pass a CLD exam. If this is representative of your normal code you will need more practice in order to pass the exam. It is always easy to just drop stuff on the diagram and throw wires around but it is best to get in the habit of keeping things organized, neat and clean from the beginning. Your code will look better, be easier to read and easier to understand. If you wait until the end to do the cleanup you are doing double work. Once creating clean code is a habit you will find it easier to do something the CLD exam with its strict time limit. If you have to think about keeping the code clean you will be too slow to complete the exam. These are good habits to have regardless if you are trying to pass the CLD exam or not and in the long run will serve you well.

 

BTW, given the state of this code in general I didn't dig into it to see why it wasn't working or what bugs existed.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 5
(7,437 Views)

Really appreciate your time Steve. I will try again. Thanks

 

0 Kudos
Message 4 of 5
(7,434 Views)
Hang in there Austin, your vi was not that bad. You are definitely going in the right direction. Mark"s advice is good - always pay close attention to code neatness. Eventually it will not be something you even have to think about. One more tip. You can right click a wire and select cleanup. I use that all the time.
=====================
LabVIEW 2012


Message 5 of 5
(7,416 Views)