Allowable point type coercions
- Last UpdatedOct 02, 2024
- 2 minute read
To successfully change a point type attribute, you must change between point types that can be coerced. For example, if you change a point type to int16 and the current snapshot value is negative, the edit fails because int16 does not translate negative values. In this case, the following error is returned.
[-10005] Subscript Under Range
Data from the previous type is coerced to the current type at retrieval time.
If an event cannot be coerced to the edited point type, the digital state Coercion Failed is returned by default. The Coercion Failed digital state acts as a placeholder for an event that PI Snapshot Subsystem failed to coerce. Out-of-order events may also result in a Coercion Failed digital state.
Use the parameter Archive_DataCoercionPolicy to translate a digital state. For details, see Configure error handling.
In the following table, allowable point type coercions are shown with a check mark (✓).
|
int16 |
int32 |
float16 |
float32 |
float64 |
digital |
string |
blob |
timestamp |
|
|---|---|---|---|---|---|---|---|---|---|
|
int16 |
✓ |
✓5 |
✓ |
✓ |
✓ |
✓ |
N/A |
N/A |
|
|
int32 |
✓1 |
✓5 |
✓ |
✓ |
✓3 |
✓ |
N/A |
✓ |
|
|
float16 |
✓1 |
✓2 |
✓ |
✓ |
✓3 |
✓ |
N/A |
N/A |
|
|
float32 |
✓1 |
✓2 |
✓5 |
✓ |
✓3 |
✓ |
N/A |
✓ |
|
|
float64 |
✓1 |
✓2 |
✓5 |
✓ |
✓3 |
✓ |
N/A |
✓ |
|
|
digital |
✓ |
✓ |
✓ |
✓ |
✓ |
✓ |
N/A |
N/A |
|
|
string5 |
✓ |
✓ |
✓ |
✓ |
✓ |
✓4 |
N/A |
✓ |
|
|
blob |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
|
|
timestamp |
N/A |
✓ |
✓ |
✓ |
✓ |
N/A |
✓ |
N/A |
1. Assuming values in the range of 0 to 32767
2. Assuming values in the range of -2,147,450,880 to 2,147,483,647
3. Assuming positive, integer values that are lower than number of digital states
4. Assuming exact, case-insensitive match with a state string
5. Assuming the range of the source is compatible with the range of the target
Note: When you change point types to int16 or digital, you must enter a value for the Zero and Span attributes.