|
|
All non-automatic variables (that is, variables not automatically allocated in channel control blocks as inline variables) in the driver are considered ``module-global data'', regardless of whether the data is local to particular functions or compilation units, or truly global to the driver code.
Module-global data is read-only throughout the execution of a UDI driver and is visible to all instances of a driver within a given domain (for that reason, it is sometimes called ``domain-global data'' in the UDI Specifications).
C global variables (i.e., C variables defined outside of any function) may only be used for module-global data, and therefore must be declared read-only. It is recommended that all such variables be declared as static constants using the C language const and static keywords. Note that the UDI environment will always treat such data as read-only, even if you omit the recommended keywords.