Control commands
Control commands are transferred both from the CNC to the PLC and also in the reverse direction.
If a user interface (GUI) communicates via the CNC communication objects, there is an option for redirecting each command which can be operated both by the GUI and by the PLC via the PLC. The PLC then makes the decision as to the extent to which the GUI command may be carried through to the CNC.
A so-called control unit is created on the HLI for each control command. The control units are differentiated and named on the basis of the action target.
- Control units serving to influence the CNC are referred to as MC control units (LC acts on MC).
- Control units serving to influence the PLC are referred to as LC control units (MC acts on LC).
The following illustration clearly shows the implemented interaction between the users of a control system using an MC control unit.
If commands from the GUI are to be redirected via the PLC, the PLC must assign the X_Enableelement the value TRUE. The corresponding control commands of the GUI are then applied prior to processing to element X_Request of the MC control unit. This means that the PLC has the option of allowing or rejecting this request of the GUI. If a command of the GUI is allowed by the PLC, the PLC must copy the command from element X_Request to element X_Command.
Likewise, the PLC can task control commands to the CNC even without a prior job from a GUI directly by writing element X_Command.
Element X_State is used to check success of a command. The CNC saves the status corresponding to the command in this element.
An MC control unit features the following structure:
TYPE MCControlUnit:
STRUCT
X_Request : < DATA TYPE A >; (* GUI-commanded data *)
X_Enable : HLI_BOOLEAN; (* PLC uses this command *)
X_Command : < DATA TYPE A >; (* PLC-commanded data *)
X_State : < DATA TYPE B >; (* Acknowledgement of the CNC *))
END_STRUCT
END_TYPE
Note:
- < DATA TYPE A > and < DATA TYPE B > may be identical.
- < DATA TYPE A > and < DATA TYPE B > may also be complex data structures besides the standard data types (e.g. BOOL, INT, UINT, ... ).