06-22-2009 05:38 PM
I was reading NI Intermediate manual to prepare for the CLD exam, and noticed that they used Functional global variable in combination with timed loop for the software timing. Also, the error handling was implemented using functional global.
However, I was reading in one post( not this forum) that the functional global is obsolete, can anyone shed any light on this issue, why would the functional global be obsolete: and if it is, what are acceptable design for software timing.
Thank you.
06-22-2009 06:22 PM
I dont see why a global would be obsolete.
There are some instances when using a global variable is the best option, especially in cases when a resource will be used on several different computers.
If you trust your programming, you can use a timed loop to ensure that you dont have two computers trying to access the same global simultaneously, but again there is a better option.
If you use a 'semaphore', you can ensure that only 1 computer can access this resource at a time. This helps eliminate race conditions.
Where did you see someone say that globals are obsolete?
06-22-2009 06:32 PM
Thanks.
I saw the post here http://decibel.ni.com/content/groups/designing-drafting-developing-the-lv-advanced-course/blog/2009/...
06-22-2009 08:51 PM
06-22-2009 11:30 PM
Cory K wrote:I dont see why a global would be obsolete.
There are some instances when using a global variable is the best option, especially in cases when a resource will be used on several different computers.
A functional global variable isn't the same thing as a global variable. A functional global variable is what was used before global variables were introduced in LabVIEW 3. It is the heart of an Action Engine.
As for their obsolesence... Hah! That's all I have to say on that.
As to the original post: I'm a tad suspicious. What kind of software timing and error handling is being done with a functional global variable? Can you post the code?