C0046: Identifier 'XXXX' Not Defined - Precompile Error in PAM 1.3.0

In PAM 1.3.0 the programming environment now attempts to enforce better programming discipline when generating a Global Variable List (GVL) or Enumeration Data Unit Type (DUT). 

When the GVL or ENUM file is first created, Parker Automation Manager will automatically add a new precompile directive {attribute 'qualified_only'} as the first line.  This precompile directive causes the pre-compilation syntax check to expect the full variable "declaration path" (aka - namespace) in all references to the variable rather than simply the variable name itself as in the previous versions.

For example:   I add a Global Variable List named GVL.  I have a variable declared in GVL named bSwitch_State which is of type Boolean.  When I reference this variable in my POU(s) it should be referenced as GVL.bSwitch_State to clearly indicate which variable I am referring to.  There could be other declarations of a variable named bSwitch_State in other files and this requirement makes it clear which one I am referring to. 

Without the explicit namespace the compiler will do its best to resolve which instance to use but clearly this could lead to the wrong instance being used.  Good programming practice is to explicitly reference each variable with its namespace and not simply the variable name itself unless it is truly just a local variable.  This is also a good way to differentiate external variables from a local one when debugging and supporting code later on.

This pre-compile error is more of a warning than a functional error.  You can still complete the code generation, download, and run as before (assuming that your variables resolve correctly), in essence you can ignore this pre-compile error.  However, we recommend correcting the variable references to include the namespace for more robust code and supportability. 

To get the environment to behave like it did in version 1.2.1 and 1.2.0 you can also delete this first line from the Global Variable List or Enumeration file and the pre-compile syntax check for this will not be utilized.

gvl_3137-20240521-000853.jpg

 

 

c0046_3138-20240521-000853.jpg

 

 

 

Note - there is a bug in the current compiler (3.5.9.0) with the Auto Declare dialog in that it doesn't prefix the namespace as the pre-compiler syntax check expects.  Simply add the prefix namespace or see the alternative solution described above to remove this pre-compile requirement.

glh  6/2017