Table of Contents MKWare_GetInsertValuesBySN VAR_INPUT VAR_OUTPUT Example of a function block Book Creator Add this page to your book Book Creator Remove this page from your book Manage book(0 page(s)) Help MKWare_GetInsertValuesBySN This function block first determines the corresponding ProductGUID internally based on the ProductSN and ProductDesignation. The values for the determined ProductGUID are then stored in the MK|Ware database. VAR_INPUT VAR_INPUT PDAtoPLC_GotValues: BOOL; (* Output from MK|Ware: variable is set to TRUE when a product serial number has been read. *) PDAtoPLC_ValuesInserted: BOOL; (* Output from MK|Ware: variable is set to TRUE when values have been inserted. *) PDAtoPLC_ProductGUID: STRING; (* Output of MK|Ware: Contains the unique ID for MK|Ware internal identification. *) PDAtoPLC_bInsertValue[1..8]: BOOL; (* Value 1 of type BOOL*) PDAtoPLC_iInsertValue1: INT; (* Value 1 of type INT *) PDAtoPLC_sInsertValue1: STRING (* Value 1 of type STRING *) Enable: BOOL := TRUE; (* Reset all signals. *) InsertValues: BOOL; (* Start signal to insert values. *) ProductDesignation: STRING; (* Product designation *) ProductSN: STRING; (* Contains the ProductSN for the product. *) bValue[1..8]: BOOL; (* Value 1 of type BOOL*) iValue1: INT; (* Value 1 of type INT *) sValue1: STRING; (* Value 1 of type STRING *) TimeoutTime: TIME :=t#10S; (* Value for timeout. *) DelayTime: TIME :=t#300ms; (* Value for delay time. ) END_VAR VAR_OUTPUT VAR_OUTPUT PDAfromPLC_GetValues: BOOL; (* Output to MK|Ware: If the status is TRUE, values are being read from the MK|Ware. *) PDAfromPLC_InsertValues: BOOL; (* Output to MK|Ware: If the status is TRUE, values from the MK|Ware are inserted. *) PDAfromPLC_ProductDesignation: STRING; (* Output to MK|Ware: Contains the current product. *) PDAfromPLC_ProductSN: STRING; (* Output to MK|Ware: Contains the ProductSN for the product. *) PDAfromPLC_ProductGUID: STRING; (* Output to MK|Ware: Contains the unique ID for MK|Ware internal identification. *) PDAfromPLC_bValue[1..N]: BOOL; (* Output to MK|Ware: This variable transfers product data of the type BOOL (e.g. OK/NOK). *) PDAfromPLC_iValue1: BOOL; (* Output to MK|Ware: This variable transfers product data of type INTEGER (e.g. nest number). *) PDAfromPLC_sValue1: STRING; (* Output to MK|Ware: This variable transfers product data of the type STRING (e.g. recipe name). *) TimeoutError_GetValues: BOOL; (* A TimeoutError is triggered after a specified period of time has elapsed. *) TimeoutError_InsertValues: 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. *) ValuesInserted: BOOL; (* Pass-through signal from MKWare. *) ProductGUID: STRING; (* Pass-through signal from MKWare. *) bGetValue[1..8]: BOOL; (* Value 1 of type BOOL *) iGetValue1: INT; (* Value 1 of type INT *) sGetValue1: STRING; (* Value 1 of type STRING *) CopyDatafromPLC: BOOL; (* Start signal for copying data from the PLC to MKWare *) ResetDatafromPLC: BOOL; (* Start signal to reset the PLC data to prevent old values from being present before sending *) CopyDatatoPLC: BOOL; (* Starting signal for copying data from MKWare to PLC variables *) ResetDatatoPLC: BOOL; (* Start signal to reset MKWare data to prevent old values from being present before sending *) Error: STRING; (* Description of the error for error analysis *) ErrorID: INT; (* Error ID for error analysis *) END_VAR Example of a function block