Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

review my sprinkler code . exam on july 1st

Hi,

 

I have my CLD exam on july 31st.  I have practise one example sprinkler code. kidnly review it provide inputs.

 

I generally use even based and queue based events with two prodcuer and consure for loops one for execution and other for updation. after seeing ATM and carwash solutions, i was trying to use simple state machine and do the sprinker code. to be hoset I almost too 7 hours to complete, was think complex way for simple solution and time was ran out. 

Now I plan to pracitse on time for next one week. any suggestion are helpful.

 

 

thanks in advacne.

 

regards,

Ashok.

0 Kudos
Message 1 of 4
(5,328 Views)

There's a decent number of wires going backwards and unncessary wire bends.  And VI Analyzer found objects under wires often too.

 

Why didn't you use an event structure?  I see lot of time where work is repeated over and over (with no wait time).  If you run the VI you go into and out of the Initialize case about once every millisecond or less on my machine.  In that one millisecond we are re-enabling several controls, redisabling a control, re-reading the file information, and setting a global.  Doing this once is all that is required.  If you choose to stick with this design I would urge you to at least put in a wait 0ms or something to prevent hogging CPU usage.  This is what is meant by this.

 

"Respond to front panel controls (within 100 ms) and not utilize 100 % of CPU time."

 

I don't see this function working:

 

"If it begins to rain during the operation of the controller, simulated by the Rain Sensor switch, the controller must stop servicing the zones and display Rain in the Controller Status indicator, even if a zone has not completed its timing cycle."

 

I see the Status indicator blank when this happens. 

 

"Enum" is not a very descripting control name.  I would suggest "Method" for the functional global.

 

SubVI controls on the front panel could be aligned better, same with block diagram terminals.

 

I'm not a fan of full screen subVIs.

 

Instead of using Application Directory in the ReadFile.vi I suggest using the current VI path as relative path to the CSV.  If you try to just run the ReadFile.vi it generates an error because it is the top level..

 

Why are we setting the zone VIG in initialize, and then setting it again in setup?  I think you can remove the one in initialize and still get the same functionality.

 

Node density in general seems high.

 

What does the Type Cast do for you in the controlenable.vi?

 

Good level of comments, maybe too much for my liking but good for a CLD.  I'd suggest having at least one comment for each case in the state machine, I saw a couple simple ones without a comment.

 

Couldn't the sequence structure be removed by having a case before Initialize in your state machine that only runs once?

 

Overall I think you did well.  Hard to say if NI thinks it would be good enough to pass, but if I were grading I think it would be.

0 Kudos
Message 2 of 4
(5,323 Views)

Also remember to use tip strips on the main front panel and add documentation for all subvis (you only missed one).

Matt J | National Instruments | CLA
0 Kudos
Message 3 of 4
(5,312 Views)

Hi,

 

i have tried two examples with time limit and doing in my normal control stye. please review and share your inputs

Download All
0 Kudos
Message 4 of 4
(5,287 Views)