This Article Applies From:
DeMeter |
Introduction
The present article purpose is to introduce DeMeter Tightening Results API, its usage and purpose.
TABLE OF CONTENTS Introduction2 - DeMeter Tightening API2.1 - API: definition, purpose and overview 2.2 - Working with DeMeter API2.2.1 - API V1 Connection String 2.2.2 - API V2 Connection string |
1 - Pre- requisites
We advise you to read through the following articles before diving in:
2 - DeMeter Tightening API
2.1 - API: definition, purpose and overview
API stands for Application Programming Interface.
It is a software intermediary allowing two application to exchange information or "talk" to each other without having to know how either one works. An API is therefore often the preferred solution to simplify connectivity between several systems.
The specific benefits of using DeMeter provided API to retrieve tightening data rather than relying on database queries are:
- Database scheme change: the API will remain stable over the versions, regardless of any changes brought to the database by new features (additional data - change to the data string...).
- Performances: the risk of performance slow-down is lowered by retrieving data via the API rather than by querying the DeMeter database.
Developing a software to retrieve tightening data via the API will therefore have the benefits of a lower maintenance when compared to database queries (since the later may need adjustment from version to version).
Early version of the DeMeter tightening results API lets you retrieve only the tightening results associated to a specific VIN: this is DeMeter Open AI V1.
DeMeter Open AI V2 extends the range of retrieved Tightening Results: all results (up to 1000) within a time frame can be retrieved.
Note: API documentation is embedded in DeMeter. It can be accessed via the connection string http(s)://127.0.0.1:(portNumber)/api-docs/index.html?urls.primaryName=DeMeter%20Open%20API.
2.2 - Working with DeMeter API
2.2.1 - API V1 Connection String
The DeMeter API can be accessed via the following connection string:
- DeMeter_IP is the IP address of your server.
- DeMeter_Port is your DeMeter server API port number. Refer to DeMeter installation procedure for additional details about DeMeter port configuration.
- Vin lets you provide the identifier for the tightening result(s) you wish to retrieve.
- IncludeCurve: set to false by default. Setting the value to true will let you retrieve the numerical values for each point of the target result(s) stored curves.
- IncludeSteps: set to false by default. Setting the value to true will let you retrieve the numerical result for each step within a specific tightening strategy, rather than only the end result.
Note: ensure the connection string references the secured port if your DeMeter server uses a certificate. In such a case, you will need to replace http by https in the connection string.
The aforementioned string can be used in any web browser to display the tightening results for tests purpose.
Note: while the connection string can be used with any browser, Firefox wraps the data for a better rendering. Therefore, if Firefox is among the browser allowed by your IT, we advise you to favour it.
2.2.2 - API V2 Connection string
It is now mandatory to define a Time Frame for the data you wish to retrieve. To set it up, the following parameters are necessary:
- A startTime: all records taken after the provided value will be considered for retrieval.
- An endTIme: the last retrieved entry must have been recorded before this date.
- A dateMode: this setting can either be set to:
- controller: it is the date time of the issuer of the record that will be taken into account for the filtering.
- demeter: it is the date time at which DeMeter has received the record.
This version of the API requires, in addition to a time frame, at least one of the following parameter:
- A VIN. Lets take the example of identifier VIN_Example. The request URL would be:
- A Controller Name. Lets take the example of a controller named CPS_CVI3_Controller. The request URL would be:
https://127.0.0.1:4551/getdata/v2/tighteningresults?startTime=2023-07-21T22%3A00%3A00.000%2B01%3A00&endTime=2024-04-22T22%3A00%3A00.000%2B01%3A00&dateMode=controller&controllerName=CPS_CVI3_Controller&includeCurve=false&includeSteps=false
- A Controller Serial Number. Lets take the example of a controller with serial number 46262000436. The request URL would be:
https://127.0.0.1:4551/getdata/v2/tighteningresults?startTime=2023-07-21T22%3A00%3A00.000%2B01%3A00&endTime=2024-04-22T22%3A00%3A00.000%2B01%3A00&dateMode=controller&controllerSerialNumber=46262000436&includeCurve=false&includeSteps=false
- A Tightening Unit Name. Lets take the example of a Tightening Unit named CPS_TU. The request URL would be:
https://127.0.0.1:4551/getdata/v2/tighteningresults?startTime=2023-07-21T22%3A00%3A00.000%2B01%3A00&endTime=2024-04-22T22%3A00%3A00.000%2B01%3A00&dateMode=controller&tighteningUnitName=CPS_TU&includeCurve=false&includeSteps=false
- A Tightening Unit Number. Lets take the example of Tightening Unit number 53.
https://127.0.0.1:4551/getdata/v2/tighteningresults?startTime=2023-07-21T22%3A00%3A00.000%2B01%3A00&endTime=2024-04-22T22%3A00%3A00.000%2B01%3A00&dateMode=controller&tighteningUnitNumber=53&includeCurve=false&includeSteps=false
Note:
- By default, output from a query to API V2 will be a single JSON formated answer limited to 1000 results.
- It is possible to stream the query results by changing .../getdata/v2/... to .../getdata/v2-stream/... Each result will be JSON formated. Please note that this approach is more resource efficient, thus allowing for the retrieval of up to 10000 results.
2.2.3 - API Tightening Data: an overview
The API will provide you all the tightening results sharing the same VIN in a single response.
Firefox use case:
The snapshot below shows you an example where the VIN is associated to 6 tightening results (all associated to a single Assembly Process).
A specific result can be accessed to retrieve the information for a specific tightening.
Results' data are grouped by category that you can expand. The below snapshot shows you how to access final angle, final torque an report:
Note: keep in mind that the example above is just for discovery purpose of the existing API fields. The real value of the feature is that it can be accessed by developing a software capable of extracting all the required data.
Feel free to contact your remote support team if you feel you need additional information about this feature. |
3 - Further reading
The following articles provides you with further details about tightening results Enum Fields :
- Relation between the Stop Source Enum and the actual Stop Source: DeMeter API - What does the Stop Source Code value stands for ?.
- Relation between the Torque Unit Enum and the corresponding Torque Unit: Desoutter Industrial Tools : What does DeMeter API Torque Unit value stands for.
- Relation between the Tightening Trend Enum and the corresponding Monitoring and Target value status: Desoutter Industrial Tools : DeMeter API - What do the Trend Values stand for ?.
- Relation between the Result Type Enum and the corresponding type of action done: Desoutter Industrial Tools : What does the Result Type stands for in the DeMeter API ?.