Control unit with usage check
If the requested or commanded data is not applied statically and if, rather, an individual change is to be transferred at this point, the data of the corresponding control unit features an additional usage check.
TYPE MCControlUnit:
STRUCT
X_Request : < DATA TYPE A >; (*GUIcommanded data *)
X_Enable : HLI_BOOLEAN; (* PLC uses this command *)
X_Command : < DATA TYPE A >; (* PLC-commanded data *)
X_RequestSemaphore : HLI_BOOLEAN; (* Request valid *)
X_CommandSemaphore : HLI_BOOLEAN; (*Command valid *)
X_State : < DATA TYPE B >; (*Ackn. of the CNC *))
END_STRUCT
END_TYPE
Example:
CNC accepts the commanded data if the command semaphore has the value TRUE and sets this element to value FALSE after complete transfer of the data.
PLC can write data for commanding if the command semaphore has the value FALSE. If all data to be commanded has been written, the PLC sets this element to value TRUE.
CNC writes the data requested by the GUI if the request semaphore is FALSE and then sets this element to TRUE.
PLC reads the data requested by the GUI if the request semaphore is TRUE. After the data has been fully transferred to the PLC, the PLC sets this element to FALSE.