@amigo9090/ih-libiec61850-node 1.0.54 → 1.0.55
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 +70 -94
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,12 +4,6 @@ const util = require('util');
|
|
|
4
4
|
const client = new MmsClient((event, data) => {
|
|
5
5
|
console.log(`Event: ${event}, Data: ${util.inspect(data, { depth: null })}`);
|
|
6
6
|
|
|
7
|
-
/*if (event === 'conn' && data.event === 'opened') {
|
|
8
|
-
console.log('Connection opened, browsing data model...');
|
|
9
|
-
//handleConnectionOpened();
|
|
10
|
-
handleConnectionOpened2();
|
|
11
|
-
}*/
|
|
12
|
-
|
|
13
7
|
if (event === 'conn' && data.event === 'opened') {
|
|
14
8
|
console.log('Connection opened');
|
|
15
9
|
// Теперь пользователь сам решит, как исследовать модель
|
|
@@ -29,7 +23,6 @@ const client = new MmsClient((event, data) => {
|
|
|
29
23
|
exploreModel();
|
|
30
24
|
}
|
|
31
25
|
|
|
32
|
-
|
|
33
26
|
if (event === 'data' && data.type === 'data') {
|
|
34
27
|
if (data.event === 'logicalDevices') {
|
|
35
28
|
console.log(`Logical Devices received: ${util.inspect(data.logicalDevices, { depth: null })}`);
|
|
@@ -248,94 +241,81 @@ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
|
248
241
|
}*/
|
|
249
242
|
|
|
250
243
|
async function handleConnectionOpened() {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
244
|
+
try {
|
|
245
|
+
const dataModel = await client.browseDataModel();
|
|
246
|
+
|
|
247
|
+
const dataSets = [];
|
|
248
|
+
const reports = [];
|
|
249
|
+
|
|
250
|
+
dataModel.forEach(ld => {
|
|
251
|
+
console.log(`\nLogical Device: ${ld.name}`);
|
|
256
252
|
|
|
257
|
-
|
|
258
|
-
console.log(
|
|
253
|
+
ld.logicalNodes.forEach(ln => {
|
|
254
|
+
console.log(` Logical Node: ${ln.name} (${ln.reference})`);
|
|
259
255
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
console.log(`
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}
|
|
281
|
-
if (report.reportId) {
|
|
282
|
-
console.log(` Report ID: ${report.reportId}`);
|
|
283
|
-
}
|
|
284
|
-
console.log(` Enabled: ${report.enabled !== undefined ? report.enabled : 'Unknown'}`);
|
|
285
|
-
reports.push(report);
|
|
286
|
-
});
|
|
287
|
-
} else {
|
|
288
|
-
console.log(` No reports found`);
|
|
289
|
-
}
|
|
290
|
-
});
|
|
256
|
+
// Вывод DataSets (только то, что доступно в корневом обходе)
|
|
257
|
+
if (ln.dataSets && ln.dataSets.length > 0) {
|
|
258
|
+
console.log(` Datasets (${ln.dataSets.length}):`);
|
|
259
|
+
ln.dataSets.forEach(ds => {
|
|
260
|
+
console.log(` - ${ds.reference}`);
|
|
261
|
+
dataSets.push(ds);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Вывод отчетов (только то, что доступно в корневом обходе)
|
|
266
|
+
if (ln.reports && ln.reports.length > 0) {
|
|
267
|
+
console.log(` Reports (${ln.reports.length}):`);
|
|
268
|
+
ln.reports.forEach((report, index) => {
|
|
269
|
+
console.log(` [${index + 1}] ${report.reference}`);
|
|
270
|
+
console.log(` Type: ${report.type} (${report.description || 'N/A'})`);
|
|
271
|
+
reports.push(report);
|
|
272
|
+
});
|
|
273
|
+
} else {
|
|
274
|
+
console.log(` No reports found`);
|
|
275
|
+
}
|
|
291
276
|
});
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
console.log('\n=== SUMMARY ===');
|
|
280
|
+
console.log(`Total Logical Devices: ${dataModel.length}`);
|
|
281
|
+
|
|
282
|
+
let totalDataSets = 0;
|
|
283
|
+
let totalReports = 0;
|
|
284
|
+
|
|
285
|
+
dataModel.forEach(ld => {
|
|
286
|
+
ld.logicalNodes.forEach(ln => {
|
|
287
|
+
totalDataSets += (ln.dataSets ? ln.dataSets.length : 0);
|
|
288
|
+
totalReports += (ln.reports ? ln.reports.length : 0);
|
|
304
289
|
});
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
console.log(`Total Datasets found: ${totalDataSets}`);
|
|
293
|
+
console.log(`Total Reports found: ${totalReports}`);
|
|
294
|
+
|
|
295
|
+
// Выводим все найденные отчеты для удобства
|
|
296
|
+
console.log('\n=== ALL FOUND REPORTS ===');
|
|
297
|
+
reports.forEach((report, index) => {
|
|
298
|
+
console.log(`${index + 1}. ${report.reference} (${report.type})`);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
console.log('\n=== RECOMMENDED REPORTS FOR ENABLING ===');
|
|
302
|
+
// Ищем отчеты с DataSet01 (как в примере)
|
|
303
|
+
const recommendedReports = reports.filter(r =>
|
|
304
|
+
r.reference.includes('ReportBlock0101')
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
if (recommendedReports.length > 0) {
|
|
308
|
+
recommendedReports.forEach((report, index) => {
|
|
309
|
+
console.log(`${index + 1}. ${report.reference}`);
|
|
310
|
+
console.log(` To enable: client.enableReporting("${report.reference}", "<datasetRef>")`);
|
|
311
|
+
console.log(` (Get datasetRef by calling browseDataModel("${report.reference}"))`);
|
|
318
312
|
});
|
|
319
|
-
|
|
320
|
-
console.log('
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
if (recommendedReports.length > 0) {
|
|
327
|
-
recommendedReports.forEach((report, index) => {
|
|
328
|
-
console.log(`${index + 1}. ${report.reference}`);
|
|
329
|
-
console.log(` Dataset: ${report.datasetRef}`);
|
|
330
|
-
console.log(` To enable: client.enableReporting("${report.reference}", "${report.datasetRef}")`);
|
|
331
|
-
});
|
|
332
|
-
} else {
|
|
333
|
-
console.log('No reports with DataSet01 found.');
|
|
334
|
-
// Предлагаем другие отчеты
|
|
335
|
-
if (reports.length > 0) {
|
|
336
|
-
console.log('\nAvailable reports with datasets:');
|
|
337
|
-
reports.filter(r => r.datasetRef).forEach((report, index) => {
|
|
338
|
-
console.log(`${index + 1}. ${report.reference} -> ${report.datasetRef}`);
|
|
313
|
+
} else {
|
|
314
|
+
console.log('No reports with ReportBlock0101 found.');
|
|
315
|
+
if (reports.length > 0) {
|
|
316
|
+
console.log('\nAvailable reports:');
|
|
317
|
+
reports.forEach((report, index) => {
|
|
318
|
+
console.log(`${index + 1}. ${report.reference} -> ${report.type}`);
|
|
339
319
|
});
|
|
340
320
|
}
|
|
341
321
|
}
|
|
@@ -720,10 +700,6 @@ async function main() {
|
|
|
720
700
|
console.log('Waiting for data and reports...');
|
|
721
701
|
await sleep(30000);
|
|
722
702
|
|
|
723
|
-
/*const rcbRef = 'A01LD0/LLN0.BR.repTS1';
|
|
724
|
-
console.log(`Disabling reporting for ${rcbRef}`);
|
|
725
|
-
await client.disableReporting(rcbRef);*/
|
|
726
|
-
|
|
727
703
|
const rcbRef2 = 'WAGO61850ServerDevice/LLN0.RP.ReportBlock0101';
|
|
728
704
|
console.log(`Disabling reporting for ${rcbRef2}`);
|
|
729
705
|
await client.disableReporting(rcbRef2);
|