A metric denotes a sensor measurement or equipment control setpoint channel on an Edge device or User UI.
A typical metric might be a temperature measurement, pressure reading, the state of a switch, valve position, etc.
Metrics can have more than one value. For example the recipe that is being run specifies a temperature setpoint. A user may specify a different setpoint. The controller program then decides if that setpoint is proper and outputs its desired setpoint to an Edge device. Then a sensor is used to measure the actual temperature. In addition the temperature can have a lower and upper alarm value. The temperature can also have a lower and upper valid range which can be used to detect problems with the sensor.
Metrics can also have a status - ok, in alarm, out of range. A metric can also be stale - has it been updated recently.
The LabTime administrator client keeps track of all of this, sets and removes alarms and checks for stale-ness, and publishes a message when something changes. In addition upon request the administrator will publish the full state of a metric.
Actions
The action is the name given to the different values of a metric. It is also the second field of a topic. All MQTT messages with the following actions use the InfluxDB Line Protocol as the format for the payload.
- inp - Input value from reading a sensor on an edge device
- out - Output value requested that an edge device set
- hum - Human input from the HMI - slider, button, numeric entry
- upper - Upper alarm value
- lower - Lower alarm value
- high - Upper valid range value
- low - Lower valid range value
Metric ID
Each metric has a metric ID. This ID is a compound name with fields separated by underscores.
Examples:
- Middle_Window_K_F
- Bathroom_Door_K_F
- Chamber_PS_V
- Chamber_PS_A
- Chamber_ISO_MFC_NA_Helium_ccm
The fields in a LabTime metric ID are defined as:
1 - Group - Chamber/Reactor, Building, Room
2 - Component - ISO Chamber, Cryo Pump, Gimble
3 - Device (optional) - Voltmeter, K (thermocouple), Mass Spec
4 - Position (optional) - Top Right, 42, Front
5 - Composition (optional) - Nitrogen, Tungsten, Ultraviolet, Gamma
Last Field - Units - V, A, F, C, RPM
These fields are stored as tags in the historian. This means that in Grafana you can sort, filter and group by these fields.
By being consistent in creating metric ID's it's possible to make them short and concise. It is suggested you create a list of valid values for each of the fields and use abbreviations when possible. The goal is to have names that people can generate in their head without having to look it up.
Metric ID's can be identical in different projects
Metrics can be repeated in different projects. For example you may have 4 identical pieces of equipment each with a 'TopCenter' temperature sensor. Each project can use the same Metric IDs. This makes it easy to duplicate an experiment without having to dream up unique names for each of those reactors sensors.