@amigo9090/ih-libiec61850-node 1.0.33 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builds/linux_arm/addon_iec61850.node +0 -0
- package/builds/linux_arm64/addon_iec61850.node +0 -0
- package/builds/linux_x64/addon_iec61850.node +0 -0
- package/builds/macos_arm64/addon_iec61850.node +0 -0
- package/builds/macos_x64/addon_iec61850.node +0 -0
- package/builds/windows_x64/addon_iec61850.node +0 -0
- package/examples/index_iec61850_client2.js +16 -3
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -33,9 +33,11 @@ const client = new MmsClient((event, data) => {
|
|
|
33
33
|
if (data.timestamp) {
|
|
34
34
|
console.log(` Timestamp: ${data.timestamp}`);
|
|
35
35
|
}
|
|
36
|
-
data.values
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
// data.values - это объект, а не массив
|
|
37
|
+
Object.entries(data.values).forEach(([ref, value], index) => {
|
|
38
|
+
const reason = data.reasons[ref];
|
|
39
|
+
if (reason && reason !== 0) {
|
|
40
|
+
console.log(` ${ref}: ${util.inspect(value, { depth: null })}, Reason: ${reason}`);
|
|
39
41
|
}
|
|
40
42
|
});
|
|
41
43
|
} else if (data.event === 'batchData') {
|
|
@@ -145,6 +147,12 @@ async function handleConnectionOpened() {
|
|
|
145
147
|
console.log(`Enabling reporting for ${rcbRef} with dataset ${dataSetRef}`);
|
|
146
148
|
await client.enableReporting(rcbRef, dataSetRef);
|
|
147
149
|
|
|
150
|
+
// Включение отчётности2
|
|
151
|
+
const rcbRef2 = 'WAGO61850ServerDevice/LLN0.RP.ReportBlock0201';
|
|
152
|
+
const dataSetRef2 = 'WAGO61850ServerDevice/LLN0.DataSet02';
|
|
153
|
+
console.log(`Enabling reporting for ${rcbRef2} with dataset ${dataSetRef2}`);
|
|
154
|
+
await client.enableReporting(rcbRef2, dataSetRef2);
|
|
155
|
+
|
|
148
156
|
} catch (err) {
|
|
149
157
|
console.error('Error in handleConnectionOpened:', err.message);
|
|
150
158
|
}
|
|
@@ -178,6 +186,11 @@ async function main() {
|
|
|
178
186
|
console.log(`Disabling reporting for ${rcbRef}`);
|
|
179
187
|
await client.disableReporting(rcbRef);
|
|
180
188
|
|
|
189
|
+
// Отключение отчётов2
|
|
190
|
+
const rcbRef2 = 'WAGO61850ServerDevice/LLN0.RP.ReportBlock0102';
|
|
191
|
+
console.log(`Disabling reporting for ${rcbRef2}`);
|
|
192
|
+
await client.disableReporting(rcbRef2);
|
|
193
|
+
|
|
181
194
|
console.log('Client status:', client.getStatus());
|
|
182
195
|
console.log('Closing client...');
|
|
183
196
|
await client.close();
|