A method of operating a programmable logic controller (110E, 110F) over a plurality of scan cycles in a multi-layered automation system comprising a control layer, the method comprising: selecting, by the programmable logic controller (110E, 110F), one or more soft-sensors (245, 240) available in a control program corresponding to a production unit, each soft-sensor (245, 240) comprising a local control layer parameter or variable used by the control program, wherein the local control layer parameter or variable is used only internally within the programmable logic controller (110E, 110F) and exists only as long as needed to assist in the calculation of a control output parameter; determining, by the programmable logic controller (110E, 110F), updated soft-sensor values corresponding to the one or more soft-sensors (245, 240) during each scan cycle; storing, by the programmable logic controller (110E, 110F), the updated soft-sensor values during each scan cycle on a non-volatile computer-readable storage medium operably coupled to the programmable logic controller; annotating, by the programmable logic controller (110E, 110F), the updated soft-sensor values with automation system context information to generate contextualized data, wherein the automation system context information comprises one or more of an indication a structural description of an automation system comprising the programmable logic controller, a system working mode indicator, one or more of a description of automation software utilized by the programmable logic controller (110E, 1 10F) or a status indictor indicative of a status of the automation software while the updated soft-sensor values were determined, information about a product that was produced while the updated soft-sensor values were determined, control knowledge, product-specific information, and event information; retrieving, by the programmable logic controller (110E, 110F), one or more historical soft-sensor values from the non-volatile computer-readable storage medium; and executing, by the programmable logic controller (110E, 110F), one or more data analytics algorithms on the one or more historical soft-sensor values, to analyze execution of the production unit control program and yield analytics data, the method further comprising; applying, by the programmable logic controller (110E, 110F), the one or more data analytics algorithms to at least one of the contextualized data and the updated soft-sensor values to yield calculated data; and adjusting one or more data generation parameters of the production unit based on the calculated data. selecting, by the programmable logic controller (110E, 110F), one or more soft-sensors (245, 240) available in a control program corresponding to a production unit, each soft-sensor (245, 240) comprising a local control layer parameter or variable used by the control program, wherein the local control layer parameter or variable is used only internally within the programmable logic controller (110E, 110F) and exists only as long as needed to assist in the calculation of a control output parameter; determining, by the programmable logic controller (110E, 110F), updated soft-sensor values corresponding to the one or more soft-sensors (245, 240) during each scan cycle; storing, by the programmable logic controller (110E, 110F), the updated soft-sensor values during each scan cycle on a non-volatile computer-readable storage medium operably coupled to the programmable logic controller; annotating, by the programmable logic controller (110E, 110F), the updated soft-sensor values with automation system context information to generate contextualized data, wherein the automation system context information comprises one or more of an indication a structural description of an automation system comprising the programmable logic controller, a system working mode indicator, one or more of a description of automation software utilized by the programmable logic controller (110E, 1 10F) or a status indictor indicative of a status of the automation software while the updated soft-sensor values were determined, information about a product that was produced while the updated soft-sensor values were determined, control knowledge, product-specific information, and event information; retrieving, by the programmable logic controller (110E, 110F), one or more historical soft-sensor values from the non-volatile computer-readable storage medium; and executing, by the programmable logic controller (110E, 110F), one or more data analytics algorithms on the one or more historical soft-sensor values, to analyze execution of the production unit control program and yield analytics data, the method further comprising; applying, by the programmable logic controller (110E, 110F), the one or more data analytics algorithms to at least one of the contextualized data and the updated soft-sensor values to yield calculated data; and adjusting one or more data generation parameters of the production unit based on the calculated data.