Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Exam Solutions for Review

Hi Matt

 

Reviewing code is outside my role, but I can say with confidence your comments of what you can do to do better sound spot-on. The shift from the CLD exam (doing code) to the CLA (planning code) can be challenging. I appreciate you mentioning specific strategies that can help CLA candidates make that shift.

 

Good luck on your prep and exam.

Certification Engineer II
National Instruments

Certified LabVIEW Developer

0 Kudos
Message 591 of 642
(3,995 Views)

Hey Fancy Folk,

 

Finished up the Carwash practice test and was wondering if someone could check this one out.  I'm feeling much more confident with the attempt, took my 3.5 hours to do and the final .5 hours would have gone through adding documentation to all the subVIs and verifying that I put down all the [Covers:xxx] tags.  

 

Main improvements to dev time was basically creating a class upfront with the action engine queue, creating all the type deffs associated with the basic class, and laying out the basic init/UI/dequeue structure.  Once I created that, I copy and pasted it and used that as a template and whenever I needed to make a new class, all the upfront work was done.

 

The problem I'm having now is that I can't really come up with a good way to truly pass information back and forth between the classes.  I am a fan of the DQMH template so I tried something like a request/broadcast, but I was trying to only use the AE queue ref to pass data between the classes instead of generating a user event. Instead of the class generating a user event and the other class listening to is, I had to pass info from class A to class B via creating an API from class B with the desired data and dropping that into class A.  It's messy and weird, but it worked....  The problem that I am having is that I would need to create additional VIs to pass the user events around which I can see taking a while.  

 

I think in my next attempt (elevator) I am going to include an init section for the user events and have 1 user event with a type deff "state" and variant "ADTL Data" so I can easily add to it.  I would assume proper design is to create a typedeff per user event, but I think I can skirt by for the sake of speed with this method.  

 

Anyways, if you get around to judging the code, let me know what you think and where I can use improvements.

 

Matt

If you want to find useful posts, you have to make useful posts. Please try to provide how you solve your posted problems for future users, a better forum helps the community out.
0 Kudos
Message 592 of 642
(3,955 Views)

Hay

I have build a new timer with pause and resume functionality, can anyone review it?

Download All
0 Kudos
Message 593 of 642
(3,799 Views)
  • You forgot the VI icons.
  • You forgot the VI descriptions.
  • You forgot diagram documentation (subdiagram labels).
  • Don't label an enum "enum" (or an array "array", a string "string"). E.g. "Function" would be a name that adds value to the reader of the code.

The automatic analyzer tools will pick those up and you automatically  loose a lot of points for style. Icons wouldn't pass my style guide, but I personally don't use VI Documentation a lot.

 

  • "Current time" shift register isn't used, so you didn't need to make (save time). I doubt it will cost you points.

 

If you put the shift registers in a class's private data, and each function in a VI you'll get 1) simpler VIs, 2) a timer you can use multiple times, 3) a 'by wire" timer. But don't try this out for the first time on your exam, do what you're comfortable with. I promise a good grasp of OO is worth your while though 😊.

 

Keep in mind that at the CLD you ideally would have to make this VI in max 10 min., preferably <5 min.

0 Kudos
Message 594 of 642
(3,788 Views)

Thanks for the reply,, i just left out the documentation, i was more focusing on functionality, did you check the functionality? is this the functionality required for most of the exams?

0 Kudos
Message 595 of 642
(3,784 Views)

I didn't test functionality, because I'm sure it does what it's programmed to do. If that is what is desired, I don't know; there's no specification.

The code is lean and clean, so I doubt there's much wrong with it.

 

Yes, it's very likely you need some sort of a timer. You might not need the pause functionality, but it's good to know how to do that.

 

A timer like this goes a long way, although you can only use it for 1 timer. If you make it reentrant you can use it more then once, but it stops working as a functional global... That's why I prefer to program "by wire", but YMMV.

0 Kudos
Message 596 of 642
(3,773 Views)
Thanks for the info, I had one more doubt, 
I have  been doing projects in state machine using string arrays 
 
Is there any mandatory that we should use enum for state machine? 
 
Im not confident with enum, but pretty confident with array of strings 
 

 

0 Kudos
Message 597 of 642
(3,765 Views)

@Altira wrote:
Thanks for the info, I had one more doubt, 
I have  been doing projects in state machine using string arrays 
 
Is there any mandatory that we should use enum for state machine? 
 
Im not confident with enum, but pretty confident with array of strings 

There used to be a "instant disqualification" rule for not using an enum state machine. All example exams have this warning:

 

Use a state machine that either uses a type-defined enumerated control, queue, or Event structure for state management

 

Not sure what the status on that is. I don't like to be forced towards an implementation (I wouldn't use a state machine at all). I've been ranting about this to everyone and their dog, but never got the idea they where even considering to change it.

 

I'd try to get to know type def'd enums a bit better.

 

Simply make an enum, make it a type def, and you never have to type a string in a case again, risking typos.

 

The only really bad thing with comparing enums in a case structure is when LabIVEW automatically 'groups' them, turning "One", "Two", "Three" into "One".."Three". This is a problem, because you want your code to break when you insert "Two and a half"... However, with strings you wouldn't get that either.   

0 Kudos
Message 598 of 642
(3,758 Views)

HI Thanks for the reply, i dif post a query to NI regarding strings and their answer was ...

 

"Thank you for contacting us and sorry for the delay in replying. Good luck with your preparations. Enums are not required for case structures, but they're probably best practice. "

 

another doubt i had is , when testing vi through vi analyzer, i get these common errors

 

  • This VI has Automatic Error Handling enabled
  • his VI has debugging enabled
  • This VI has the 'Separate compiled code from source file' setting disabled.
  • The Default case of this case structure is shared with one or more other selector values ("Set Timer"). This impairs readability. Eliminate the redundant selector value(s).

Does these errors have anything to do with points in CLD exam?

 

 

 

0 Kudos
Message 599 of 642
(3,749 Views)

Hi

I have updated my VI, can you please have a look on to it?

 

im taking a remote test, so where should i save my sub vis? is there any specific folder structure to follow?

does spelling mistake loose points?

0 Kudos
Message 600 of 642
(3,724 Views)