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 sample exam 1

Try this on your VI, it is very easy to do. Put an "equal to" comparator on you block D. and wire the output to your stop terminal. Add a constant of 2 to one side of the comparator and the other comparator input to the itteration terminal of your VI.

 

Now start your VI and a Stop Watch (or just use your watch) . The itteration counter on your VI will hit 2 at exactly the 2 minute mark! the condition is clearly met to STOP your VI... BUT.......... It runs for one more minute! So the itteration term on your VI indicates the number of minutes minus one!

 

Try it, I just did.

 

Alan

0 Kudos
Message 31 of 55
(1,149 Views)

Hi Alan,

 

why should I modify my VI? I don't want to. What are your answers for the questions I placed on the frontpanel of my VI?

0 Kudos
Message 32 of 55
(1,145 Views)

Hi,

 

Well I thought I did answer it, but I thought you *might* want some proff? 

 

The answer is clearly that your indicator indicates the number of minutes minus one and that the itteration terminal is one count behind the actuall number of itterations that occur.

 

My modification to your VI was one dramiticly clear way to demonstrate this, you actually see the stop condition being met by the loop counter yet the VI continues to RUN, one more time, loop counter =2 elapsed time =3 min.

 

Alan

 

0 Kudos
Message 33 of 55
(1,136 Views)
The output always shows the amount of loop cycles executed - 1. Discussion of time is irrelevant.
0 Kudos
Message 34 of 55
(1,133 Views)

Isn't that the amount of loop cycles minus one?

 

Alan

0 Kudos
Message 35 of 55
(1,129 Views)
SORRY, I did not see the minus one in your answer...
0 Kudos
Message 36 of 55
(1,127 Views)

Hi Alan,

 

do you realy think it indicates the number of elapsed minutes minus one?

 

Take a look onto a stopwatch while starting the vi.

 

The value changes from 0 to 1 after one minute elapsed. So it counts the minutes. 

0 Kudos
Message 37 of 55
(1,124 Views)
Actually your code is irrelevant to the question at hand.  Your loop never ends so the iteration terminal never "returns" anything.  If you replace your stop constant with a control you clearly get the answer 'C'.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 38 of 55
(1,122 Views)

The issue of time was relevent to answer the question though.... If one loop takes one minute , then 3 loops take 3 minutes. (in this VI)

So 3 loops, 3 minutes, itteration counter =2  .....  One less than the amount of minutes. Answer to question: the VI  loop counter is the number of minutes minus 1.

 

It doesn't matter if it is minutes or drops of water. I was just trying to answer the questions posed on thee FP of the VI

 

Alan

0 Kudos
Message 39 of 55
(1,120 Views)

Actually your code is irrelevant to the question at hand.  Your loop never ends so the iteration terminal never "returns" anything.  If you replace your stop constant with a control you clearly get the answer 'C'.

 

 

what?

it returns a value every single cycle

0 Kudos
Message 40 of 55
(1,117 Views)