Using the ATEasy Name Search

Letting ATEasy search for the named object is by far the easiest way to access a named object. You should use caution, however, because you could get unexpected results when you change your application.

For example, assume you have a System procedure that is calling its Driver1 driver to access the nLoopCount variable.

Months later, you add another instrument driver called Driver4 to the same system. Driver4 also uses a variable called nLoopCount. After rebuilding your test application, you discover that the System function using nLoopCount no longer works. When ATEasy searched for nLoopCount, it found the one in Driver4 rather than the one in Driver1. This is a difficult bug to troubleshoot.

You can minimize problems associated with duplicate names by making all the names unique. You could use nLoopCount1 for Driver1 and nLoopCount4 for Driver4. You can also use dot notation to clarify the name.

Other ways of protecting from global variable misuse include:

        Creating Get/Set function to read and write to the variable data and making the variable non-public.

        Referring to the driver using it scope (i.e. Driver1.nLoopCounter)