08-26-2013 05:35 AM
Hi All
Could someone please clarify the following CLAD question for me.
Which is not an important part of creating a Functional Global Variable?
a. Using Shift Registers to store information
b. Changing the VI’s execution settings to Reentrant
c. Setting the VI to inline into calling VIs
d. Setting the While Loop to stop after one iteration
Options A and B are important for creating a Functional Global Variable. Leaving options C or D as the answer.
Option B.... the VI definately does not want to be reentrant, so changing the VI’s execution settings to reentrant is not important.
Option C.... the VI does not want to be inline as that also sets the VI to rentrant. So setting the VI to inline is also not important.
The answer has been given as Option C, but I feel it should be 'B and C' or am I missing something?
Thanks in advance
08-26-2013 05:46 AM
Well, I can see the scenario where you would want the FGV to be reentrant. Look at the Point-To-Point functions. They are set to reentrant and are technically FGVs. That is done so you can keep several running totals of some kind. Inlining removes any debugging capabilities, so I can see why C would be the "best" answer. But I agree, B and C are both not important.
08-26-2013 05:48 AM
IMO the answer is D. Setting the While Loop to stop after one iteration is not a strict requirement, although it may have an impact on performance.
I rather partially miss your post; you write
Option B.... the VI definately does not want to be reentrant, so changing the VI’s execution settings to reentrant is not important.
If the VI definately does not want to be reentrant (and indeed it should not be), this is a reason why this setting IS an important part, don't you agree?
08-26-2013 05:48 AM
Thanks Crossrulz I wasn't aware there was a scenario where you would want FGV to be reentrant. Guess a little more studying is in order.
08-26-2013 05:59 AM
Well, after reading crossrulz's answer, I wonder what's the exact meaning of the question.
I meant: what can affect how the FGV vi is properly working?
Certainly I would never set a FGV vi to Reentrant, because this would break the Global attribute.
May a Functional Global Variable only be used locally?
08-26-2013 06:03 AM
Hi,
If we are talking about FGV, FGV should not be reentrant. If it is reentrant every user can call this variable at same time and it will create a race condition.
D is right because this loop should run only one time to store value in shift register for accessible to all other VIs
08-26-2013 06:16 AM
Himanshu_Goyal wrote:If we are talking about FGV, FGV should not be reentrant. If it is reentrant every user can call this variable at same time and it will create a race condition.
Well, only if you set it to Shared Clones. If you use preallocate clones, then each call to the reentrant FGV has its own memory space. Therefore no race condition.
A and D define a FGV. So those are kind of really important. Then again, there is the variant that Darren introduced by using feedback nodes with no loop that I tend to prefer.
08-26-2013 09:06 AM
You should be aware that there are problems with some of the CLAD questions, particularly with the sample exams (my understanding is that the actual test is generally better), so you need to learn how to answer these questions (which is the important thing for passing the CLAD). In this case, C is the answer purely because you wouldn't actually do that.
For any of the other answers, I have created FGVs without using what's described in them, so I don't think they're actually important either, but they are generally used in what is commonly called an FGV (which is another problem with this question, because people use the term to refer to different things). Like I said, learn how to answer the question (in this case, by finding the most irrelevant one).
08-26-2013 11:33 AM
From the original question written here exactly as it appears on the exam surely setting the VI to 'reentrant' (B) or to 'inline' (C) are NOT important therefore B and C are correct. If it crops up on the exam I will put 'C' as the answer but add a note about FGV's and reentrant VI's. Hopefully my exam result is not borderline pass/fail.
Thanks all for taking part in the discussion. I figure this is all down to a poorly written exam question.
08-27-2013 08:27 AM
@crossrulz wrote:
Well, I can see the scenario where you would want the FGV to be reentrant. Look at the Point-To-Point functions. They are set to reentrant and are technically FGVs.
"Techincally", this statement makes no sense. There is nothing "global" about them once they are reentrant. Maybe you could call them something else. FLV? Nah!