{{indexmenu_n>140}}
====== MKWare_GetItemBySN ======
The function block transmits a ProductDesignation and ProductSN to //MK|Ware// and receives a GUID for the current product.
===== VAR_INPUT =====
VAR_INPUT
PDAtoPLC_GotItem: BOOL; (* Output from MK|Ware: variable is set to TRUE when a ProductSN has been read. *)
PDAtoPLC_ProductGUID: STRING; (* Output of MK|Ware: Contains the unique ID for MK|Ware internal identification. *)
Enable: BOOL := TRUE; (* Reset all signals. *)
GetItem: BOOL; (* Start signal to request a new article. *)
ProductDesignation: STRING; (* Product designation *)
ProductSN: STRING; (* Contains the ProductSN for the product. *)
TimeoutTime: TIME :=t#10S; (* Value for timeout. *)
DelayTime: TIME :=t#300ms; (* Value for delay time. )
END_VAR
===== VAR_OUTPUT =====
VAR_OUTPUT
PDAfromPLC_GetItem: BOOL; (* Output to MK|Ware: If the status is TRUE, a ProductSN should be read. *)
PDAfromPLC_ProductDesignation: STRING; (* Output to MK|Ware: Contains the current product. *)
PDAfromPLC_ProductSN: STRING; (* Output to MK|Ware: Contains the ProductSN for the product. *)
TimeoutError: BOOL; (* A TimeoutError is triggered after a specified period of time has elapsed. *)
Busy: BOOL; (* Is TRUE after start signals and FALSE after an abort or the return message from MK|Ware. *)
GotItem: BOOL; (* Pass-through signal from MKWare. *)
ProductGUID: STRING; (* Pass-through signal from MKWare. *)
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:pde:getitembysn:pasted:20241029-100629.png}}