MKWare_AddItem
A virtual product is created within the MK|Ware and reserved with a product serial number. This serial number is transferred to the PLC function block and processed further there. A configuration in MKSupervisor specifies that a Produkt SN is generated there and transferred to the PLC. The SN to be created can be predefined from the PLC using the sample.
VAR_INPUT
VAR_INPUT
PDAtoPLC_ItemAdded: BOOL; (* Output from MK|Ware: variable is set to TRUE when a product serial number has been generated. *)
PDAtoPLC_ProductSN: STRING; (* Output from MK|Ware: contains the product serial number ProductSN for the product. *)
PDAtoPLC_ProductGUID: STRING; (* Output from MK|Ware: contains the unique ID for MK|Ware internal identification. *)
PDAtoPLC_Timestamp: STRING; (* Output from MK|Ware: timestamp of when the product was created. **OPTIONAL** *)
Enable: BOOL := TRUE; (* Reset all signals. *)
AddItem: BOOL; (* Start signal to request a new ProductSN. *)
ProductDesignation: STRING; (* Product designation *)
Template: STRING; (* Template for ProductSN (e.g.: ddmmyy00000&) *)
ProductSNadditional: STRING; (* Optional: The text is added in to the serial number at the "&" position of the template variable *)
TimeoutTime: TIME :=t#10S; (* Value for timeout. *)
DelayTime: TIME :=t#300ms; (* Value for delay time. *)
END_VAR
VAR_OUTPUT
VAR_OUTPUT
PDAfromPLC_AddItem: BOOL; (* Output to MK|Ware: If the status is TRUE, a product SN should be generated. *)
PDAfromPLC_ProductDesignation: STRING; (* Output to MK|Ware: Contains the current product. *)
PDAfromPLC_Template: STRING; (* Output to MK|Ware: Specifies a template for creating the product SN. *)
PDAfromPLC_ProductSNadditional: STRING; (* Output to MK|Ware: Contains additional characters that may extend the template. *)
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. *)
ItemAdded: BOOL; (* Pass-through signal from MKWare. *)
ProductSN: STRING; (* Pass-through signal from MKWare. *)
ProductGUID: STRING; (* Pass-through signal from MKWare. *)
TimeStamp: STRING; (* Pass-through signal from MKWare. *)
Error: STRING; (* Description of the error for error analysis *)
ErrorID: INT; (* Error ID for error analysis *)
END_VAR
