Understand quality management sample generation
- Last UpdatedOct 23, 2024
- 3 minute read
The MES middleware maintenance service initiates a stored procedure to generate future samples in the database. The future sample generation logic is complex and depends on the configuration of the MES Client. If no MES middleware is running, samples are not created. The MES middleware maintenance service does not create samples in the past if it loses connection with the database or is shutdown for a period of time.
The frequency of sample generation is based on the Frequency to call sample updates (in seconds) system parameter, which is located in the Data Entry group. This system parameter has a default value of 30 seconds (the minimum). If the value is set to 0, then sample generation is called as part of the minutely task.
All future samples are regenerated as per the current date and time if any of the following configuration data changes:
-
A QM specification
-
The set of characteristics linked to a QM specification
-
A sample plan
-
A sample plan frequency
If one action takes an inordinately long time, a separate thread starts for the tasks at each frequency so that the effect on other actions is minimized.
Eligible Entities
First, the sample generation functionality determines which entities are eligible to have samples generated for them.
You can collect samples for an entity if its Can collect QM data setting is selected in the entity Properties pane. For more information on the Can collect QM data capability, see the MES Client User Guide or online help. The corresponding sample plan frequency and QM characteristics are ignored if the Can collect QM data setting has not been selected for the entity.
Sample Generation and QM Specifications
A QM specification can have multiple versions. But at a given time, only one version can be active and generate future samples. If there are more than one version of a QM specification (and all share the same specification name and context information), the active version is the one that has the following:
-
The start effectivity is either current or in the past, and it is the highest (most recent) specification with the same specification name and context.
-
The end effectivity is either Null or in the future.
The samples are generated for an entity using the active QM specification in the following scenarios:
-
If the Can capture QM data entity setting is set to True for an entity and an active QM specification is directly assigned to this entity, samples are generated from an active QM specification.
-
If the Can capture QM data entity setting is set to True for an entity and there is no QM specification assigned or if the assigned one is not active, the next higher ancestor entity in the hierarchy (which has an active QM specification) is used to generate the samples for an entity.
If no such active QM specification is found, no future samples will be generated by using the specifications at the current time.
For each QM specification with a sample frequency of Shift or a Calendar, Equipment run time, or Equipment production count linked to it, the MES middleware generates future samples for the entity. The sample frequency is linked through the sample plan at the QM specification level or characteristic override level.
Sample Generation and Shifts
If the value of the current shift is none (0), the system cannot generate future or ready samples for the Shift frequency type. Samples are generated based on the Future Sample Generation parameter for the Calendar, Equipment run time, or Equipment production count frequencies:
-
If the setting is Null, then no future samples are generated when no shift is defined.
-
If the setting has some value, then future samples are generated up to the time limit specified even when no shift is defined.
When defined, a shift frequency generates samples up to the end of the current shift. If the setting for Future Sample Generation is Null for the Calendar, Equipment run time, or Equipment production count frequencies, then future samples are generated up to the end of the current shift, otherwise they are generated up to the setting for Future Sample Generation.
If multiple QM specifications have the same sample plan at a given time, a sample is generated with all characteristics of the specifications.