From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLAD help (reference to online exam)

Hi All,

 

This is a cheeky one, but its sunday after all.. so not work related!

 

Im preparing for teh CLAD exam. I have made my way through the practice papers online (there are two). Would anyone be able to help me out with the Q6 on the second paper :-

 

http://download.ni.com/pub/devzone/epd/clad_sample_exam2.pdf

 

I cannot get my head around this one!!

 

Any help would be appreciated..

 

Thanks,

 

Richard.

0 Kudos
Message 1 of 3
(2,953 Views)

Hello!

 

Let's start from the beginning.

 

  1. When we start we have an array {1, 8, 6, 2}
  2. In a first iteration (remember that iteration counter starts from 0) insert into array inserts 0 to index 1 (also 0-based) so we have: {1, 0, 8, 6, 2}
  3. Second iteration we insert 1 to index 1 {1, 1, 0, 8, 6, 2}
  4. Third iteration 2 to index 1 {1, 2, 1, 0, 8, 6, 2}
  5. Fourth iteration 3 to index 1 {1, 3, 2, 1, 0, 8, 6, 2}
  6. Last, fifth iteration 4 to index 1 {1, 4, 3, 2, 1, 0, 8, 6, 2} -> Answer C

If you are not easy with Feedback Node just replace it with Shift Register - it works exactly the same. We initialize it with an array and it shifts the value from previous iteration to the next one.

 

Remember that Insert Into Array inserts value, what means that it increases the size of an array - as you can see in this example.

 

I hope this helps! If you have any questions, don't hesitate to ask! 🙂

 

Marcin

              

Think Dataflow - blog.mtapp.tech
Message 2 of 3
(2,950 Views)

Typically, you'll find more excited help for certication questions in the certification forum.  I'd also suggest remaking these small examples and watching the highlight executation for anything that you don't fully understand so you can watch it work.

 

Now, let's take a look at this.  You have an initialized feedback node.  This behaves the same as an initialized shift register.  You'll want to be aware of this to note the initial state of the array.  The first step for any of these questions is taking time to see how many iterations will run for a loop.  With no auto-indexing tunnels, the count terminal's value of 5 is our answer.

 

So, we know we want to look at what happens through 5 iterations based on an array that starts with {1,8,6,2}.

 

Inside the loop, we use "insert into array" to add the current iteration into element 1.  It's important to know both the iteration terminal and arrays are 0 indexed.  This means we're going to be putting '0' into the second element.  After the first iteration, our array is now {1,0,8,6,2}.

 

Let's follow this one more time.  In the second iteration, the location (index) of the array is constant.  The value being added is the iteration.  So, now we'll add '1' into the 2nd element.  We get {1,1,0,8,6,2}. 

 

As we're using an easy to see pattern here (the number added just increases by one and pushes everything else to the right), we can skip the rest once we know what the value will be for the 5th iteration (4).  If we jump ahead, we see {1,4,3,2,1,0,8,6,2} which is C.  If you verify against the answers, you'll see that answer matches.

Message 3 of 3
(2,948 Views)