-
Notifications
You must be signed in to change notification settings - Fork 3
/
enum.js
executable file
·179 lines (175 loc) · 4.75 KB
/
enum.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
MIT License Copyright 2021, 2022 - Bitpool Pty Ltd
*/
module.exports.ModbusRegDecoderTypes = {
LIST: "LIST",
BINARY: "BINARY",
};
module.exports.ModbusFunctionCode = {
F1_READ_COILS: 1,
F2_INPUT_COILS: 2,
F3_HOLDING_REGS: 3,
F4_INPUT_REGS: 4,
F5_SINGLE_COIL: 5,
F6_SINGLE_HOLDING_REG: 6,
F15_MULTIPLE_COILS: 15,
F16_MULTIPLE_HOLDING_REGS: 16,
};
module.exports.ModbusDataType = {
T_8_BIT_INT: "8BIT_INT",
T_8_BIT_UINT: "8BIT_UINT",
T_16_BIT_INT_HI_FIRST: "16BIT_INT_HI_FIRST",
T_16_BIT_INT_LOW_FIRST: "16BIT_INT_LOW_FIRST",
T_16_BIT_UINT_HI_FIRST: "16BIT_UINT_HI_FIRST",
T_16_BIT_UINT_LOW_FIRST: "16BIT_UINT_LOW_FIRST",
T_32_BIT_FLT_1234: "32BIT_FLOAT_1234",
T_32_BIT_FLT_4321: "32BIT_FLOAT_4321",
T_32_BIT_FLT_2143: "32BIT_FLOAT_2143",
T_32_BIT_FLT_3412: "32BIT_FLOAT_3412",
T_32_BIT_INT_1234: "32BIT_INT_1234",
T_32_BIT_INT_4321: "32BIT_INT_4321",
T_32_BIT_INT_2143: "32BIT_INT_2143",
T_32_BIT_INT_3412: "32BIT_INT_3412",
T_32_BIT_UINT_1234: "32BIT_UINT_1234",
T_32_BIT_UINT_4321: "32BIT_UINT_4321",
T_32_BIT_UINT_2143: "32BIT_UINT_2143",
T_32_BIT_UINT_3412: "32BIT_UINT_3412",
T_64_BIT_INT_12345678: "64BIT_INT_12345678",
T_64_BIT_INT_56781234: "64BIT_INT_56781234",
T_64_BIT_UINT_12345678: "64BIT_UINT_12345678",
T_64_BIT_UINT_56781234: "64BIT_UINT_56781234",
T_ASCII: "ASCII",
};
module.exports.EngineeringUnits = {
VOLTAGE_L1_VOLTS: 0,
VOLTAGE_L2_VOLTS: 1,
VOLTAGE_L3_VOLTS: 2,
VOLTAGE_LN_AVG_VOLTS: 3,
VOLTAGE_LN_SUM_VOLTS: 4,
VOLTAGE_L1L2_VOLTS: 5,
VOLTAGE_L2L3_VOLTS: 6,
VOLTAGE_L3L1_VOLTS: 7,
VOLTAGE_LL_AVG_VOLTS: 8,
VOLTAGE_LL_SUM_VOLTS: 9,
VOLTAGE_PHASE_SEQUENCE: 10,
CURRENT_L1_AMPS: 11,
CURRENT_L2_AMPS: 12,
CURRENT_L3_AMPS: 13,
CURRENT_N_AMPS: 14,
CURRENT_TOTAL_AMPS: 15,
CURRENT_TOTAL_AVG_AMPS: 16,
CURRENT_L1_THD_PCT: 17,
CURRENT_L1_F_HARMONIC_PCT: 18,
CURRENT_L1_3RD_ORDR_PCT: 19,
CURRENT_L1_5TH_ORDR_PCT: 20,
CURRENT_L1_7TH_ORDR_PCT: 21,
CURRENT_L1_9TH_ORDR_PCT: 22,
CURRENT_L1_11TH_ORDR_PCT: 23,
CURRENT_L1_13TH_ORDR_PCT: 24,
CURRENT_L1_15TH_ORDR_PCT: 25,
CURRENT_L1_17TH_ORDR_PCT: 26,
CURRENT_L1_19TH_ORDR_PCT: 27,
CURRENT_L1_21ST_ORDR_PCT: 28,
CURRENT_L1_23RD_ORDR_PCT: 29,
CURRENT_L1_25TH_ORDR_PCT: 30,
CURRENT_L2_THD_PCT: 31,
CURRENT_L2_F_HARMONIC_PCT: 32,
CURRENT_L2_3RD_ORDR_PCT: 33,
CURRENT_L2_5TH_ORDR_PCT: 34,
CURRENT_L2_7TH_ORDR_PCT: 35,
CURRENT_L2_9TH_ORDR_PCT: 36,
CURRENT_L2_11TH_ORDR_PCT: 37,
CURRENT_L2_13TH_ORDR_PCT: 38,
CURRENT_L2_15TH_ORDR_PCT: 39,
CURRENT_L2_17TH_ORDR_PCT: 40,
CURRENT_L2_19TH_ORDR_PCT: 41,
CURRENT_L2_21ST_ORDR_PCT: 42,
CURRENT_L2_23RD_ORDR_PCT: 43,
CURRENT_L2_25TH_ORDR_PCT: 44,
CURRENT_L3_THD_PCT: 45,
CURRENT_L3_F_HARMONIC_PCT: 46,
CURRENT_L3_3RD_ORDR_PCT: 47,
CURRENT_L3_5TH_ORDR_PCT: 48,
CURRENT_L3_7TH_ORDR_PCT: 49,
CURRENT_L3_9TH_ORDR_PCT: 50,
CURRENT_L3_11TH_ORDR_PCT: 51,
CURRENT_L3_13TH_ORDR_PCT: 52,
CURRENT_L3_15TH_ORDR_PCT: 53,
CURRENT_L3_17TH_ORDR_PCT: 54,
CURRENT_L3_19TH_ORDR_PCT: 55,
CURRENT_L3_21ST_ORDR_PCT: 56,
CURRENT_L3_23RD_ORDR_PCT: 57,
CURRENT_L3_25TH_ORDR_PCT: 58,
POWER_L1_KW: 59,
POWER_L2_KW: 60,
POWER_L3_KW: 61,
POWER_TOTAL_KW: 62,
POWER_DEMAND_KW: 63,
POWER_L1_KVAR: 64,
POWER_L2_KVAR: 65,
POWER_L3_KVAR: 66,
POWER_TOTAL_KVAR: 67,
POWER_L1_KVA: 68,
POWER_L2_KVA: 69,
POWER_L3_KVA: 70,
POWER_TOTAL_KVA: 71,
POWER_DEMAND_KVA: 72,
POWER_FACTOR_L1: 73,
POWER_FACTOR_L2: 74,
POWER_FACTOR_L3: 75,
POWER_FACTOR_TOTAL: 76,
FREQUENCY_HZ: 77,
ENERGY_IMP_L1_KWH: 78,
ENERGY_IMP_L2_KWH: 79,
ENERGY_IMP_L3_KWH: 80,
ENERGY_IMP_TOTAL_KWH: 81,
ENERGY_IMP_L1_KVARH: 82,
ENERGY_IMP_L2_KVARH: 83,
ENERGY_IMP_L3_KVARH: 84,
ENERGY_IMP_TOTAL_KVARH: 85,
ENERGY_IMP_L1_KVAH: 86,
ENERGY_IMP_L2_KVAH: 87,
ENERGY_IMP_L3_KVAH: 88,
ENERGY_IMP_TOTAL_KVAH: 89,
ENERGY_EXP_L1_KWH: 90,
ENERGY_EXP_L2_KWH: 91,
ENERGY_EXP_L3_KWH: 92,
ENERGY_EXP_TOTAL_KWH: 93,
ENERGY_EXP_L1_KVARH: 94,
ENERGY_EXP_L2_KVARH: 95,
ENERGY_EXP_L3_KVARH: 96,
ENERGY_EXP_TOTAL_KVARH: 97,
ENERGY_EXP_L1_KVAH: 98,
ENERGY_EXP_L2_KVAH: 99,
ENERGY_EXP_L3_KVAH: 100,
ENERGY_EXP_TOTAL_KVAH: 101,
ENERGY_L1_KWH: 102,
ENERGY_L2_KWH: 103,
ENERGY_L3_KWH: 104,
ENERGY_TOTAL_KWH: 105,
ENERGY_L1_KVARH: 106,
ENERGY_L2_KVARH: 107,
ENERGY_L3_KVARH: 108,
ENERGY_TOTAL_KVARH: 109,
ENERGY_L1_KVAH: 110,
ENERGY_L2_KVAH: 111,
ENERGY_L3_KVAH: 112,
ENERGY_TOTAL_KVAH: 113,
TEMPERATURE_CELSIUS: 114,
BINARY_INPUTS: 115,
BINARY_OUPUTS: 116,
BINARY_STATE: 117,
VOLTAGE_BATTERY_VOLTS: 118,
VOLTAGE_DC_BUS_POSITIVE: 119,
VOLTAGE_DC_BUS_NEGATIVE: 120,
PRESSURE_BAR: 121,
PRESSURE_PASCAL: 122,
TIME_MSEC: 123,
TIME_SEC: 124,
TIME_HOUR: 125,
TIME_DAY: 126,
TIME_WEEK: 127,
TIME_MONTH: 128,
TIME_YEAR: 129,
REVS_PER_MIN: 130,
};