I am developing an object containing Object, Base and Peripheral as usual. In my Base there are some constants defined for usage in Object and also in Peripheral e.g.:
MyBaseConstants
{attribute 'qualified_only'}
VAR_GLOBAL CONSTANT
MY_DEVICE_PAR_COUNT : DINT := 5;
END_VAR
In some examples I found different approaches how to access this constant from object or peripheral:
- Use directly MyBaseConstants.MY_DEVICE_PAR_COUNT.
- Use namesapace OC_MyBase.MY_DEVICE_PAR_COUNT. Probably without attribute 'qualified only'.
- Use namesapace +ย global variable list OC_MyBase.MyBaseConstants.MY_DEVICE_PAR_COUNT. Too long for coding.
What is the right way how to handle it?