Data Types of Models¶
The attributes, measurement points, and commands of a model need to be described through data, and each piece of data has a type. The elements of EnOS models support the following data types.
Note
The supported data types vary depending on the selected element type and measurement point type.
For attributes and measurement points, if the data type is not enum or struct, you can select some built-in units in the system, such as kilometers, decimeters, and percentages.
Data Type |
Description |
Format Example |
---|---|---|
boolean |
Boolean data, used to represent two states: True or False. |
True |
date |
Date type data. |
2024-09-30 15:30:00 |
dataTime |
Date and time data, accurate to milliseconds. |
2024-09-30T15:30:00.123Z |
double |
Double-precision floating-point data. |
3.14159265359 |
float |
Floating-point data. |
3.14 |
integer |
32-bit signed integer. |
42 |
string |
String type with a length of 1–1024 bytes. Subtypes include URL and Internationalized Strings. |
|
object |
Object type data representing a composite data structure, suitable for describing complex entities. Subtypes include data, dateTime, string, double, integer, float, enum, boolean |
{“name”: “John”, “age”: 30, “isStudent”: false} |
enum |
Enumerated data. |
Option 1 |
array |
Array type data. Array members can only be of type integer, float, double, or string. The data type of the elements in the array must be specified during use. |
[1, 2, 3, 4, 5] |
map |
Map type data, capable of defining custom key-value pairs or applying internationalized field templates, suitable for storing associated data. Subtypes include data, dateTime, string, double, integer, float, boolean. |
{“key1”: “value1”, “key2”: 42} |