{{indexmenu_n>3}}
====== MKWare_MaterialConsumption ======
Whenever a work center consumes or receives a starting material, the function module reports the corresponding quantity to //MK|Ware//.
Via the [[en:software:mksupervisor:strukturbaum:arbeitsplatz:sps-data-collector:materialverbrauch_konfigurieren:start| MKSupervisor configuration]] a direct transfer to the higher-level ERP system is carried out.
Examples:
- Single item: here one flank of a Boolean is sufficient
- More than one part at a time: Integer with number of parts used and a Boolean for a rising flank
- 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
- Summarizing liquid: floating-point data type with total quantity; change is recognized by MK|Ware
===== VAR_INPUT =====
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 =====
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
===== Example of a function block =====
{{:de:interfaces:mkcollector:general:materialverbrauch:pasted:20241029-122814.png}}