Restrictions in the case of a multiple-channel controller structure
When the CNC starts up, for each NC channel the "GLOBALLY" declared variables are added incrementally to any existing variables. The memory layout in its entirety is only defined after start-up has completed. The start address to the common memory is than made available to the PLC.
The #EXPORT function can only be started in one channel.
- It therefore only uses the "GLOBAL" variables declared in that channel. Variables from other channels that are assigned other index values, for example, are invisible. Therefore, they are also no entered in the VE_GLOBAL_DATA_FROM_CH_? structure.
- For each channel-specific V.E. list, an independent
VE_GLOBAL_-DATA_FROM_CH_? structure comes into being and - the "mixed operation" of index-based addressing and the Auto_Mem method that is possible due to an 'unfavourable' "GLOBAL" declaration cannot be detected across several channels.
Only the PLC programmer can provide a solution to the problems, or a solution must be worked out in close cooperation with the person who creates the V.E. lists. There is no "typical" approach, however.
Below, you will find a few suggestions on how to reach a decision on the approach ultimately chosen:
Scenario (A)
All "GLOBAL" variables are declared in each channel (as a copy) and (if necessary) are only distinguished by the access methods (var[?].access_rights). Below, all VE_GLOBAL_DATA_-FROM_CH_? structures generated for each channel are identical. For access on the part of the PLC, it suffices to use one of the structures as the basis for access to the "GLOBAL" memory.
Scenario (B)
The "GLOBAL" variables of the various channels differ partly or completely. Thus, the generated PLC structures are different.
A first approach is to mix the exported structures manually and to access the memory with a new user-defined structure. The disadvantage here is that responsibility for correct access once again lies with the PLC programmer. Moreover, the operation must be repeated if only one of the V.E. lists changes and a new #EXPORT operation is triggered.
A second possible approach leaves the distinction according to channels as it is and defines several independent channel-specific pointers (to the identical GLOBAL memory) in the PLC. Here, the PLC programmer must make sure that the required variable is accessed with the 'right' PLC variable.