Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Light CLD How's my coding?

Hey All, I made the attached vi for the stoplight CLD problem. I would appreciate some input as to how I did and if there is anything my code is missing. Here's the Challenge for the exam

 

My solution Main VI:
Main LoopMain Loop

 

State TimerState TimerEnum to CTLEnum to CTL

0 Kudos
Message 1 of 7
(6,861 Views)

Hello,

Here are my recommendations:

  • You can use a functional Global Variable to manage the timing.
  • Try not use back-wires since it does not meet best practices.
  • Another recommendation for the CLD is the use of clusters to pass data.

Regards,

MJR.

0 Kudos
Message 2 of 7
(6,780 Views)

Your code looks clean and is well documented. I would ignore the comment about backward flowing wires. Your use of the feedback nodes is perfectly acceptable and your wires must flow backward when using them. You could make use of clusters for the application but it isn't absolutely necessary in this case.



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
0 Kudos
Message 3 of 7
(6,767 Views)

I've heard differing views on needing to use the LabVIEW quit function.  My take is that you needed to invoke this node in LV versions 7.x and older for executables, but not necessary after that.  I've based that on posts that I've read, but sometimes my recollection is not accurate.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 7
(6,763 Views)
@Mark_Yedinak wrote:

Your code looks clean and is well documented. I would ignore the comment about backward flowing wires. Your use of the feedback nodes is perfectly acceptable and your wires must flow backward when using them. You could make use of clusters for the application but it isn't absolutely necessary in this case.


In terms of clustering: the only place I would see to use them would be combining the two feedback nodes in the "State Timer" Vi. Although I agree that you can do that, doesn't it create an additional level of complexity? 

0 Kudos
Message 5 of 7
(6,742 Views)

Remind me again, do you get a template with the controls already in place or do you need to design from scratch?

 

I am not sure about your icon with arbitrary (=non-rectangular) shape (i.e. your "enum to CTL"). I have used them in the past (example), but they are typically rare. In your case, there is no real justification for that protrusion at the bottom of the icon.

 

One problem with the UI is the fact that the off states are too bright, especially the yellow. I would make all the off states black or very dark grey. Starting from scratch, it would be much more reasonable to use a radiobutton indicator for the lights. Now the state is a simple typedef'd enum with three states. Attached is a trivially simple draft to show the idea, of course one would need to adapt the rest of the code, but I think it would simplify things. (create a second radiobutton for the left turn and create a cluster of the two for the full indicator, etc.).

 

trafficradio.png

0 Kudos
Message 6 of 7
(6,695 Views)

@altenbach wrote:

Remind me again, do you get a template with the controls already in place or do you need to design from scratch?

 

I am not sure about your icon with arbitrary (=non-rectangular) shape (i.e. your "enum to CTL"). I have used them in the past (example), but they are typically rare. In your case, there is no real justification for that protrusion at the bottom of the icon.

 

One problem with the UI is the fact that the off states are too bright, especially the yellow. I would make all the off states black or very dark grey. Starting from scratch, it would be much more reasonable to use a radiobutton indicator for the lights. Now the state is a simple typedef'd enum with three states. Attached is a trivially simple draft to show the idea, of course one would need to adapt the rest of the code, but I think it would simplify things. (create a second radiobutton for the left turn and create a cluster of the two for the full indicator, etc.).

 

trafficradio.png


That's a cool application of a radio button, I'll keep that in mind for future projects. I think you are given the panel.

 

As for making Icons, I'll keep that in mind. As long as it's a rectangle though you're good, or should they only be full size icons? 

0 Kudos
Message 7 of 7
(6,689 Views)