Represents something you measure, for example a temperature, a pressure, a speed, or a humidity. In the Excel templates, measurements are registered on the What you measure sheet.
A measurement defines a code and how its values are read. The values themselves are submitted as readings.
Values that are commanded rather than measured, such as a target temperature, are registered as setpoints instead.
Measurements are a shared entity. They work the same way in every manufacturing domain model.
The Measurement object
{
"code": "oven-temp",
"name": "Oven temperature",
"unit": "°C",
"valueType": 0,
"cadenceMinutes": 5,
"plausibleMin": 0,
"plausibleMax": 400
}
Fields
| Field | Type | Description | Example |
|---|---|---|---|
code |
string | Unique business code of the measurement. Readings refer to it. | "oven-temp" |
name |
string | Human-readable name of the measurement. | "Oven temperature" |
unit |
string or null | Unit of the values. Leave it empty for yes/no values and categories. | "°C" |
valueType |
integer | Kind of value, as a number. See Kinds of value. | 0 |
cadenceMinutes |
integer or null | How often the value is read, in minutes. Leave it empty for values that are recorded only when they change. | 5 |
plausibleMin |
number or null | Lowest value that can plausibly be measured. Values below it are kept, but marked as suspect. | 0 |
plausibleMax |
number or null | Highest value that can plausibly be measured. Values above it are kept, but marked as suspect. | 400 |
Important
code must be unique across measurements, setpoints, and the other codes Pulse uses for values. A code that is already used for something else, for example a setpoint, is refused.
Kinds of value
valueType |
Kind of value | Meaning | In the Excel templates |
|---|---|---|---|
0 |
Continuous | A number on a continuous scale, such as a temperature. | a number |
1 |
Ordinal | A ranked value, such as a grade. | a grade |
2 |
Categorical | A value from a list of categories. | a category |
3 |
Boolean | Yes or no. | yes/no |
If you leave out valueType, it is 0 (continuous).
How values are read
-
With
cadenceMinutes: the value is sampled at that interval, for example every 5 minutes. -
Without
cadenceMinutes: the value is recorded only when it changes, for example a switch that is on or off.
A value outside plausibleMin and plausibleMax is not rejected. Pulse keeps it and marks it as suspect, so that it can be excluded from the analysis.
Pulse works out how to summarize the values from valueType: an average for continuous values, and the most frequent value otherwise. You do not send this.
Reserved codes
Each domain model reserves some codes for values it calculates or records itself, for example production results. These codes cannot be registered as measurements, and they are not returned by this resource.
API resource
| Resource | Base path |
|---|---|
Measurement |
/manufacturing/v1/measurements |
For the operations shared by all shared entities, see Shared entities API.
API methods
Create a measurement
POST /manufacturing/v1/measurements/insert
Creates a new measurement and returns its Pulse identifier.
Request
POST /manufacturing/v1/measurements/insert
Content-Type: application/json
{
"code": "oven-temp",
"name": "Oven temperature",
"unit": "°C",
"valueType": 0,
"cadenceMinutes": 5,
"plausibleMin": 0,
"plausibleMax": 400
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string | yes | Unique business code of the measurement. |
name |
string | yes | Human-readable name of the measurement. |
unit |
string or null | no | Unit of the values. |
valueType |
integer | no | Kind of value, as a number. Default: 0 (continuous). |
cadenceMinutes |
integer or null | no | How often the value is read, in minutes. |
plausibleMin |
number or null | no | Lowest plausible value. |
plausibleMax |
number or null | no | Highest plausible value. |
Update a measurement
PUT /manufacturing/v1/measurements/update
Updates an existing measurement. The measurement must already exist.
An update replaces all fields. Fields you leave out are removed, and valueType returns to 0 (continuous). To change only some fields, use patch.
Request
PUT /manufacturing/v1/measurements/update
Content-Type: application/json
{
"code": "oven-temp",
"name": "Oven temperature, zone 1",
"unit": "°C",
"valueType": 0,
"cadenceMinutes": 1,
"plausibleMin": 0,
"plausibleMax": 400
}
Parameters
The parameters are the same as for creating a measurement. code identifies the measurement to update.
Patch a measurement
PATCH /manufacturing/v1/measurements/patch
Partially updates an existing measurement.
The fields to update are supplied in the properties object. The measurement is identified by its business code, which cannot be changed. Fields you leave out keep their current values. To remove a value, send it as null.
Request
PATCH /manufacturing/v1/measurements/patch
Content-Type: application/json
{
"properties": {
"code": "oven-temp",
"cadenceMinutes": 1
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
properties |
object | yes | Fields included in the partial update. |
properties.code |
string | yes | Business code of the measurement to update. |
properties.name |
string | no | New name. |
properties.unit |
string or null | no | New unit, or null to remove it. |
properties.valueType |
integer | no | New kind of value, as a number. |
properties.cadenceMinutes |
integer or null | no | New interval in minutes, or null to record values only when they change. |
properties.plausibleMin |
number or null | no | New lowest plausible value, or null to remove it. |
properties.plausibleMax |
number or null | no | New highest plausible value, or null to remove it. |
Retrieve a measurement
GET /manufacturing/v1/measurements/select
Returns the measurement identified by its business code. If no measurement has this code, the response is empty.
Request
GET /manufacturing/v1/measurements/select?id=oven-temp
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Business code of the measurement to retrieve. |
Example response
{
"code": "oven-temp",
"name": "Oven temperature",
"unit": "°C",
"valueType": 0,
"cadenceMinutes": 5,
"plausibleMin": 0,
"plausibleMax": 400
}
List measurements
GET /manufacturing/v1/measurements/query
Returns measurements matching the supplied filters.
Request
GET /manufacturing/v1/measurements/query?codes=oven-temp
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
codes |
string or array of strings | no | Limits results to measurements with the specified business codes. |
Example response
[
{
"code": "oven-temp",
"name": "Oven temperature",
"unit": "°C",
"valueType": 0,
"cadenceMinutes": 5,
"plausibleMin": 0,
"plausibleMax": 400
}
]
Delete a measurement
DELETE /manufacturing/v1/measurements/delete
Deletes the measurement identified by its business code. If no measurement has this code, nothing happens.
Request
DELETE /manufacturing/v1/measurements/delete?id=oven-temp
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Business code of the measurement to delete. |