For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: Constant list: //{attribute 'qualifiedonly'} VAR_GLOBAL CONSTANT test :INT := 3; END_VAR Network variable list: VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR The same is true for enumerations, you can use them, but only if you don't use the fully qualified name. I can't imagine...
For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: Constant list: //{attribute 'qualifiedonly'} VAR_GLOBAL CONSTANT test :INT := 3; END_VAR Network variable list: VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR The same is true for enumerations, you can use them, but only if you don't use the fully qualified name. I can't imagine...
For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: //{attribute 'qualifiedonly'} VAR_GLOBAL CONSTANT test :INT := 3; END_VAR . . . VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR The same is true for enumerations, you can use them, but only if you don't use the fully qualified name. I can't imagine why the compiler can't recognize...
For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: //{attribute 'qualifiedonly'} VAR_GLOBAL CONSTANT test :INT := 3; END_VAR . . . VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR The same is true for enumerations, you can use them, but only if you don't use the fully qualified name. I can't imagine why the compiler can't recognize...
For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: *//{attribute 'qualifiedonly'}* VAR_GLOBAL CONSTANT test :INT := 3; END_VAR . . . VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR The same is true for enumerations, you can use them, but only if you don't use the fully qualified name. I can't imagine why the compiler can't recognize...
For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: *//{attribute 'qualifiedonly'}* VAR_GLOBAL CONSTANT test :INT := 3; END_VAR . . . VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR The same is true for enumerations, you can use them, but only if you don't use the fully qualified name. I can't imagine why the compiler can't recognize...
For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: //*{attribute 'qualifiedonly'}* VAR_GLOBAL CONSTANT test :INT := 3; END_VAR . . . VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR The same is true for enumerations, you can use them, but only if you don't use the fully qualified name. I can't imagine why the compiler can't recognize...
For anyone reading this later, it turns out that you CAN use constants, you just have to remove the auto-populated pragma {attribute 'qualifiedonly'} and then only reference those constants using their un-qualified name. Ex: //*{attribute 'qualifiedonly'}* VAR_GLOBAL CONSTANT test :INT := 3; END_VAR . . . VAR_GLOBAL arr : ARRAY[0..test] OF INT; END_VAR I can't imagine why the compiler can't recognize the variable as a constant if you use its fully qualified name (NVL_Constants.test vs test). That...
I made the assumption that the documentation would not have a sentence that immediately contradicts the sentence that precedes it. Maybe it meant that constant expressions are not allowed but that constants are allowed? The example you included shows an expression after all.
In the documentation for network variables it states that arrays must "have limits defined with a literal or constant". However any constant I have tried to use (defined with VAR_GLOBAL CONSTANT) throws the error: Network Variables: GVL.length. not allowed. literal or constant expected I put together a simple test project to verify this. Defining the following in a network variable is all it takes. The constant can be defined in another global list or it can be defined right in the NVL, it will fail...
In the documentation for network variables it states that arrays must "have limits defined with a literal or constant". However any constant I have tried to use (defined with VAR_GLOBAL CONSTANT) throws the error: Network Variables: GVL.length. not allowed. literal or constant expected I put together a simple test project to verify this. Defining the following in a network variable is all it takes. The constant can be defined in another global list or it can be defined right in the NVL, it will fail...