MKWare_MaterialConsumption

Whenever a work center consumes or receives a starting material, the function module reports the corresponding quantity to MK|Ware. Via the MKSupervisor configuration a direct transfer to the higher-level ERP system is carried out.

Examples:

  1. Single item: here one flank of a Boolean is sufficient
  2. More than one part at a time: Integer with number of parts used and a Boolean for a rising flank
  3. More than one part added up at the same time: Integer with total number of parts used so far; change is detected by MK|Ware
  4. Summarizing liquid: floating-point data type with total quantity; change is recognized by MK|Ware
VAR_INPUT
	Trigger:              BOOL;            (* Trigger variable to start the execution *)
	Reset:                BOOL;            (* Trigger signal reset *)
	Amount:               INT:=1;          (* Number of products that leave the work center *)
	Triggerduration:      TIME:=T#500MS;   (* Extension time for the trigger *)
	DelayTime:            TIME:=T#300MS;   (* Delay time after changes in the number of OK/NOK signals *)
END_VAR
VAR_OUTPUT
	MatConfromPLC_Trigger:   BOOL;	    (* Output to MK|Ware: OK or NOK trigger signal for a product leaving the work center at the exit point *)
	MatConfromPLC_Amount:    INT;	    (* Output to MK|Ware: Quantity of material consumed *)
	Error:                   STRING;    (* Description of the error for error analysis *)
	ErrorID:                 INT;       (* Error ID for error analysis *)
END_VAR