Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD-R Question 32

Why is the answer A? Don't both methods execute the VI?

 

CLD-R Question 32.png

0 Kudos
Message 1 of 13
(7,077 Views)

The only thing I can think of is that you won't be able to get the result back with B.  But the question doesn't state that explicitly.  The both will run, so the answer (IMHO) would be C.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 13
(7,062 Views)

Thanks crossrulz, I was thinking the same thing too. How am I suppose to make that kind of assumption based on how the question is stated? Is this something you can dispute with NI in a real test?

0 Kudos
Message 3 of 13
(7,058 Views)

Talk about bad word choice!  "Method" should be replaced with something like "Code Segment" or "Implementation" to avoid the confusion with the invoke node's selected Method.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 13
(7,047 Views)

Hi,


There is more to the story regarding static references, using the run property of the invoke node, and call by reference.  Building the two methods in a block diagram is one direction to go to explore this question some more.  

 

This question gives some good coverage for understanding the different ways a VI can be called, and the types of VI references.  After diving into this solution one would be well prepared for any similar or parallel type questions.  This is one of the recommended methods for preparing for the CLD-R, that is, to re-consider the questions with small changes to the "set up".  For example, what would happen if in this question one or both of the references were changed to not be strict?

 

 

Here is a follow up to 32, if we were to use this following block diagram, would the result be different from the result of running the block diagram of Q32, in as far as the run invoke Node is concerned?

(not an official CLD-R question 🙂 

 

 

CLD-R 1 Q34.PNG

 

I hope this gives some good questions to consider regarding calling methods.

 

Mark Ramsdale
Program Manager & CLA
Global Demo and Equipment at National Instruments
Message 5 of 13
(7,039 Views)

Well I'll be.  You can't run a Strict Typed VI using the invoke node.  It gives error 1198 when you do.  A plain Static VI Reference will work, just not a Strict VI Reference.

 

There you go.  I learned something today.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 13
(7,031 Views)

@crossrulz wrote:

Well I'll be.  You can't run a Strict Typed VI using the invoke node.  It gives error 1198 when you do.  A plain Static VI Reference will work, just not a Strict VI Reference.

 

There you go.  I learned something today.


Just what the help file says:

Run VI Method

Short Name: Run VI

Requires: Base Development System

Class: VI Methods

To Use: Create a method.

Starts the VI execution, similar to the Run button. This method is different than calling a VI because it uses the current values of all front panel controls for execution rather than using data passed in through parameters. This method also ignores the Execution:Show Front Panel On Call property of a VI and the Execution:Close After Call property.

Note  This method requires the VI to have a front panel. If you are using the Application Builder, make sure you do not remove the front panel.

You cannot use this method to run a VI that is already reserved for execution by another VI.

If you use the Open VI Reference function and wire the type specifier VI Refnum input, you cannot use the reference returned by the function with this method. Instead, you must use the Call By Reference node.

 

Also:

Static VI Reference Function

Use a strictly typed VI reference if you want to call the referenced VI with the Call By Reference node or the Start Asynchronous Call node. When you create a strictly typed VI reference, you cannot wire vi reference to the Run VI method

 

Which is somwhat misleading since you can wire it just fine and the compiler doesn't even thow a warning but the run time error throws anywaySmiley Frustrated

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 13
(7,026 Views)

If the subVI is reentrant, method 1 and 2 will allows the execution of the subVI, with the exception that you can set the control values using the Call By Reference node. Also, if the code in each sequence was written in separate VIs, method 1 and 2 still allows the execution of the subVI. So I still think that both methods allows the execution of the subVI, otherwise, the question needs to be reworded or more explicit. 

0 Kudos
Message 8 of 13
(7,016 Views)

@SLee2004 wrote:

If the subVI is reentrant, method 1 and 2 will allows the execution of the subVI, with the exception that you can set the control values using the Call By Reference node. Also, if the code in each sequence was written in separate VIs, method 1 and 2 still allows the execution of the subVI. So I still think that both methods allows the execution of the subVI, otherwise, the question needs to be reworded or more explicit. 


 


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 13
(7,011 Views)

Hi,

 

I wanted to chime in again, just to push the merits of using these questions in a more dynamic way when preparing for the CLD-R (or CLA-R or CLAD).


There are a few steps that you bring up which are not in the question.  For example, if not explicitly stated as re-entrant, the VI's would not be re-entrant.  But, re-entrancy adds a dynamic to the question, essentially the VI is no longer "reserved".  However, many times a VI can not be made re-entrant, when you care about internal values in registers, so that is not a way to solve the issue of wanting to use the Invoke Node Run VI.

 

For the second part, "Also, if the code in each sequence was written in separate VIs, method 1 and 2 still allows the execution of the subVI."  Not necessarily, what would be the result if both separate VI's in were part of the same caller? Then there could be a problem as the VI ( custom add) itself would therefore still be reserved for execution (in memory) because it is part of the overall hierarchy.  Please note, a test question would not have this level of "what if" as part of the reasoning.  

 

In two examples below, using two different methods of calling the custom add VI in separate VI's in conjunction with the invoke node, in both cases the first call still interferes with the Invoke node method even though the two calls are not in the same VI's, because the separate VI's are part of the same caller.  (forgive this wordy run on)

 

Version 1) using subVI as one call with the Run VI node.

 

CLD-R 1 Q34 num 2.PNG

 

Version 2) , like the CLD-R question 32 , using the call by static reference with the Run VI node.

 

CLD-R 1 Q34 num 3.PNG

 

 

Two points:

 

1) Make the VI's from the CLD-R prep and test them, if and when, questions arise  🙂

 

2) During the exam concentrate on what the questions asks, and don't bring in extra considerations, like re-entrancy, separate VI's, etc...  

 

During preparation it is a bit the opposite, after answering the question on it's face value,it is recommended to consider some of these other possibilities and how they affect the question, to get a dynamic understanding of the moving parts, so to speak, as discussed in an earlier post.

 

I hope this helps understand the original question, that the underlying issues are about calling a VI, something that can be done in multiple ways in LabVIEW.

 

Mark Ramsdale
Program Manager & CLA
Global Demo and Equipment at National Instruments
Message 10 of 13
(7,007 Views)