Skip to content

Commit

Permalink
docs: Added updates according with #5432 (#5433)
Browse files Browse the repository at this point in the history
* Added updates according with #5432

* added a note on long size.
  • Loading branch information
salvatore-coppola authored Oct 14, 2024
1 parent ced46d8 commit 80a72ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/connect-field-devices/asset-implemetation.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ Once defined the Channels in an Asset, a simple Java application that leverages
- **enabled**: each channel can be separately enabled using this flag.
- **name**: unique user-friendly name for a channel
- **type**: represents the type of operation supported. Possible values are: _READ_, _WRITE_, _READ/WRITE_
- **value.type**: represents the data type that will be used when creating the Wire Envelope for the connected components.

- **value.type**: represents the data type that will be used when creating the Wire Envelope for the connected components and the output value for _READ_ channel.
- **scale**: an optional scaling factor to be applied only to the numeric values retrieved from the field. It is parsed as a double. See below for more details.
- **offset**: an optional offset value that will be added only to the numeric values retrieved from the field. It is parsed as a double. See below for more details.
- **scaleoffset.type**: Allows to customise the way scale and offset is applied. See below for more details.
- **unit**: an optional string value that will be added to the asset channel read to represent the unit of measure associated to that specific channel.
- **listen**: if supported by the associated driver, allows to receive notifications by the driver on events. This flag currently has effect only inside Kura Wires.

For the _READ_ and _READ/WRITE_ channels, the Asset typically asks the driver to provide a value based on the **value.type**.
If the **scaleoffset.type** is _LONG_ or _DOUBLE_, the type requested will be one of these and the final value (after the scale and offset operation) will be transformed into the data type expected by **value.type**.

### Arithmetic with scale and offset
The Asset supports applying a scale and offset to the values obtained by the attached Driver during read operations and to the values received in listen mode.

Expand All @@ -64,7 +66,7 @@ The values of the **scale** and **offset** parameters are parsed from channel co

The **mode** can be selected in the following way:

- If the **scaleoffset.type** is set to `DOUBLE` the corrisponding **mode** will be used.
- If the **scaleoffset.type** is set to `DOUBLE` or `LONG` the corrisponding **mode** will be used. The largest representable `LONG` is 2^53
- If the **scaleoffset.type** value is `DEFINED_BY_VALUE_TYPE` the operation **mode** is determinated by **value.type**.

Example of `DOUBLE` **mode**:
Expand Down

0 comments on commit 80a72ea

Please sign in to comment.