node-opcua-address-space 2.57.0 → 2.61.0

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.
Files changed (88) hide show
  1. package/dist/source/address_space_ts.d.ts +0 -2
  2. package/dist/source/helpers/argument_list.js +12 -1
  3. package/dist/source/helpers/argument_list.js.map +1 -1
  4. package/dist/source/helpers/multiform_func.d.ts +11 -0
  5. package/dist/source/helpers/multiform_func.js +74 -0
  6. package/dist/source/helpers/multiform_func.js.map +1 -0
  7. package/dist/source/loader/load_nodeset2.js +47 -64
  8. package/dist/source/loader/load_nodeset2.js.map +1 -1
  9. package/dist/source/set_namespace_meta_data.js +1 -1
  10. package/dist/src/address_space.js +12 -6
  11. package/dist/src/address_space.js.map +1 -1
  12. package/dist/src/alarms_and_conditions/condition_snapshot.js +3 -3
  13. package/dist/src/alarms_and_conditions/condition_snapshot.js.map +1 -1
  14. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +2 -1
  15. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
  16. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +1 -1
  17. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  18. package/dist/src/alarms_and_conditions/ua_condition_impl.js +8 -6
  19. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  20. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +1 -1
  21. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
  22. package/dist/src/base_node_impl.js +2 -0
  23. package/dist/src/base_node_impl.js.map +1 -1
  24. package/dist/src/base_node_private.d.ts +3 -3
  25. package/dist/src/base_node_private.js +198 -25
  26. package/dist/src/base_node_private.js.map +1 -1
  27. package/dist/src/event_data.js +1 -1
  28. package/dist/src/event_data.js.map +1 -1
  29. package/dist/src/namespace_impl.js +5 -5
  30. package/dist/src/namespace_impl.js.map +1 -1
  31. package/dist/src/nodeset_tools/nodeset_to_xml.js +15 -9
  32. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  33. package/dist/src/nodeset_tools/typedictionary_to_xml.js +17 -10
  34. package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +1 -1
  35. package/dist/src/reference_impl.js +1 -1
  36. package/dist/src/reference_impl.js.map +1 -1
  37. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +20 -13
  38. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
  39. package/dist/src/ua_data_type_impl.d.ts +15 -5
  40. package/dist/src/ua_data_type_impl.js +129 -51
  41. package/dist/src/ua_data_type_impl.js.map +1 -1
  42. package/dist/src/ua_method_impl.d.ts +3 -2
  43. package/dist/src/ua_method_impl.js +7 -1
  44. package/dist/src/ua_method_impl.js.map +1 -1
  45. package/dist/src/ua_object_impl.js +2 -1
  46. package/dist/src/ua_object_impl.js.map +1 -1
  47. package/dist/src/ua_variable_impl.d.ts +12 -18
  48. package/dist/src/ua_variable_impl.js +285 -215
  49. package/dist/src/ua_variable_impl.js.map +1 -1
  50. package/dist/src/ua_variable_type_impl.d.ts +3 -4
  51. package/dist/src/ua_variable_type_impl.js +60 -52
  52. package/dist/src/ua_variable_type_impl.js.map +1 -1
  53. package/dist/src/ua_view_impl.js +1 -1
  54. package/dist/src/ua_view_impl.js.map +1 -1
  55. package/distHelpers/add_event_generator_object.js.map +1 -1
  56. package/distHelpers/mock_session.js +1 -1
  57. package/distHelpers/mock_session.js.map +1 -1
  58. package/package.json +35 -35
  59. package/source/address_space_ts.ts +0 -1
  60. package/source/helpers/argument_list.ts +13 -3
  61. package/source/helpers/multiform_func.ts +76 -0
  62. package/source/loader/load_nodeset2.ts +64 -80
  63. package/source/set_namespace_meta_data.ts +1 -1
  64. package/src/address_space.ts +16 -7
  65. package/src/alarms_and_conditions/condition_snapshot.ts +4 -4
  66. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +7 -6
  67. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +2 -2
  68. package/src/alarms_and_conditions/ua_condition_impl.ts +29 -15
  69. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +1 -1
  70. package/src/base_node_impl.ts +3 -1
  71. package/src/base_node_private.ts +282 -36
  72. package/src/event_data.ts +1 -1
  73. package/src/namespace_impl.ts +6 -6
  74. package/src/nodeset_tools/nodeset_to_xml.ts +20 -10
  75. package/src/nodeset_tools/typedictionary_to_xml.ts +17 -7
  76. package/src/reference_impl.ts +3 -3
  77. package/src/state_machine/ua_shelving_state_machine_ex.ts +32 -19
  78. package/src/ua_data_type_impl.ts +168 -61
  79. package/src/ua_method_impl.ts +21 -7
  80. package/src/ua_object_impl.ts +10 -2
  81. package/src/ua_variable_impl.ts +419 -325
  82. package/src/ua_variable_type_impl.ts +86 -52
  83. package/src/ua_view_impl.ts +1 -1
  84. package/test_helpers/add_event_generator_object.ts +4 -3
  85. package/test_helpers/mock_session.ts +1 -1
  86. package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +18 -0
  87. package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +9 -1
  88. package/test_helpers/test_fixtures/mini.Node.Set2.xml +22 -1
@@ -10,7 +10,7 @@ import { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object
10
10
  import { DataTypeIds, VariableTypeIds } from "node-opcua-constants";
11
11
  import { BrowseDirection, NodeClass, QualifiedName } from "node-opcua-data-model";
12
12
  import { ExtensionObject } from "node-opcua-extension-object";
13
- import { coerceExpandedNodeId, makeNodeId, NodeId, NodeIdLike, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
13
+ import { coerceExpandedNodeId, coerceNodeId, makeNodeId, NodeId, NodeIdLike, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
14
14
  import { ObjectRegistry } from "node-opcua-object-registry";
15
15
  import { BrowseResult } from "node-opcua-service-browse";
16
16
  import { StatusCodes } from "node-opcua-status-code";
@@ -44,6 +44,7 @@ import {
44
44
  UAView,
45
45
  RaiseEventData
46
46
  } from "node-opcua-address-space-base";
47
+ import { make_errorLog } from "node-opcua-debug";
47
48
 
48
49
  import { adjustBrowseDirection } from "../source/helpers/adjust_browse_direction";
49
50
  import { UARootFolder } from "../source/ua_root_folder";
@@ -65,10 +66,13 @@ import { UAReferenceTypeImpl } from "./ua_reference_type_impl";
65
66
  import { BaseNodeImpl } from "./base_node_impl";
66
67
 
67
68
  const doDebug = false;
69
+ const errorLog = make_errorLog(__filename);
70
+
68
71
  // tslint:disable-next-line:no-var-requires
69
72
  const Dequeue = require("dequeue");
70
73
 
71
74
  const regexNumberColumnString = /^([0-9]+):(.*)/;
75
+ const enumerationTypeNodeId = coerceNodeId(DataTypeIds.Enumeration);
72
76
 
73
77
  function _extract_namespace_and_browse_name_as_string(
74
78
  addressSpace: AddressSpace,
@@ -472,10 +476,8 @@ export class AddressSpace implements AddressSpacePrivate {
472
476
  dataTypeNode.constructor.name
473
477
  );
474
478
  }
475
- dataTypeNode = dataTypeNode as UADataType;
476
479
 
477
- const enumerationType = this.findDataType("Enumeration")!;
478
- if (sameNodeId(enumerationType.nodeId, dataTypeNode!.nodeId)) {
480
+ if (sameNodeId(enumerationTypeNodeId, dataTypeNode!.nodeId)) {
479
481
  return DataType.Int32;
480
482
  }
481
483
 
@@ -484,10 +486,17 @@ export class AddressSpace implements AddressSpacePrivate {
484
486
  return DataType.Null; //which one ?
485
487
  }
486
488
 
487
- if (dataTypeNode.nodeId.namespace === 0 && DataType[dataTypeNode.nodeId.value as number]) {
489
+ if (dataTypeNode.nodeId.namespace === 0 && dataTypeNode.nodeId.value === 0) {
490
+ return DataType.Null;
491
+ }
492
+
493
+ if (dataTypeNode.nodeId.namespace === 0 && dataTypeNode.nodeId.value <= 25) {
488
494
  return dataTypeNode.nodeId.value as DataType;
489
495
  }
490
- return this.findCorrespondingBasicDataType(dataTypeNode.subtypeOfObj as UADataType);
496
+
497
+ const result = this.findCorrespondingBasicDataType(dataTypeNode.subtypeOfObj as UADataType);
498
+
499
+ return result;
491
500
  }
492
501
 
493
502
  /**
@@ -1267,7 +1276,7 @@ export class AddressSpace implements AddressSpacePrivate {
1267
1276
  try {
1268
1277
  func();
1269
1278
  } catch (err) {
1270
- console.log("err");
1279
+ errorLog("modelChangeTransaction", (err as Error)?.message);
1271
1280
  throw err;
1272
1281
  } finally {
1273
1282
  endModelChange.call(this);
@@ -9,7 +9,7 @@ import { UInt16 } from "node-opcua-basic-types";
9
9
  import { coerceLocalizedText, LocalizedText, LocalizedTextLike, NodeClass } from "node-opcua-data-model";
10
10
  import { DataValue } from "node-opcua-data-value";
11
11
  import { checkDebugFlag, make_debugLog } from "node-opcua-debug";
12
- import { NodeId } from "node-opcua-nodeid";
12
+ import { NodeId, sameNodeId } from "node-opcua-nodeid";
13
13
  import { UAAcknowledgeableCondition } from "node-opcua-nodeset-ua";
14
14
  import { StatusCode, StatusCodes } from "node-opcua-status-code";
15
15
  import { SimpleAttributeOperand, TimeZoneDataType } from "node-opcua-types";
@@ -175,14 +175,14 @@ export class ConditionSnapshot extends EventEmitter {
175
175
  // a nodeId/Variant map
176
176
  _record_condition_state(this, condition);
177
177
 
178
- if (branchId === NodeId.nullNodeId) {
178
+ if (sameNodeId(branchId, NodeId.nullNodeId)) {
179
179
  _installOnChangeEventHandlers(this, condition, "");
180
180
  }
181
181
  this._set_var("branchId", DataType.NodeId, branchId);
182
182
  }
183
183
 
184
184
  public _constructEventData(): IEventData {
185
- if (this.branchId === NodeId.nullNodeId) {
185
+ if (this.branchId && sameNodeId(this.branchId, NodeId.nullNodeId)) {
186
186
  _ensure_condition_values_correctness(this, this.condition!, "", []);
187
187
  }
188
188
  const c = this.condition as UAConditionImpl;
@@ -594,7 +594,7 @@ export class ConditionSnapshot extends EventEmitter {
594
594
  }
595
595
 
596
596
  public isCurrentBranch(): boolean {
597
- return this._get_var("branchId") === NodeId.nullNodeId;
597
+ return sameNodeId(this._get_var("branchId"), NodeId.nullNodeId);
598
598
  }
599
599
 
600
600
  // -- ACKNOWLEDGEABLE -------------------------------------------------------------------
@@ -5,9 +5,10 @@ import { UAAcknowledgeableCondition_Base, UAAcknowledgeableCondition, UAConditio
5
5
  import { assert } from "node-opcua-assert";
6
6
  import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
7
7
  import { NodeId } from "node-opcua-nodeid";
8
- import { StatusCode, StatusCodes } from "node-opcua-status-code";
8
+ import { CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
9
9
  import { DataType, VariantLike } from "node-opcua-variant";
10
10
  import { INamespace, RaiseEventData, ISessionContext, UAEventType, UAMethod } from "node-opcua-address-space-base";
11
+ import { CallMethodResultOptions } from "node-opcua-service-call";
11
12
 
12
13
  import { UATwoStateVariableEx } from "../../source/ua_two_state_variable_ex";
13
14
  import { AddressSpacePrivate } from "../address_space_private";
@@ -106,10 +107,10 @@ export class UAAcknowledgeableConditionImpl extends UAConditionImpl implements U
106
107
  }
107
108
 
108
109
  public static install_method_handle_on_type(addressSpace: AddressSpacePrivate): void {
109
- const acknowledgeableConditionType = addressSpace.findEventType("AcknowledgeableConditionType");
110
+ const acknowledgeableConditionType = addressSpace.findEventType("AcknowledgeableConditionType") as unknown as UAAcknowledgeableCondition_Base;
110
111
  assert(acknowledgeableConditionType !== null);
111
- (acknowledgeableConditionType as any).acknowledge.bindMethod(_acknowledge_method);
112
- (acknowledgeableConditionType as any).confirm.bindMethod(_confirm_method);
112
+ acknowledgeableConditionType.acknowledge.bindMethod(_acknowledge_method);
113
+ acknowledgeableConditionType.confirm?.bindMethod(_confirm_method);
113
114
  }
114
115
 
115
116
  public _raiseAuditConditionAcknowledgeEvent(branch: ConditionSnapshot): void {
@@ -296,7 +297,7 @@ export class UAAcknowledgeableConditionImpl extends UAConditionImpl implements U
296
297
  }
297
298
  }
298
299
 
299
- function _acknowledge_method(inputArguments: VariantLike[], context: ISessionContext, callback: any) {
300
+ function _acknowledge_method(inputArguments: VariantLike[], context: ISessionContext, callback: CallbackT<CallMethodResultOptions>) {
300
301
  UAConditionImpl.with_condition_method(
301
302
  inputArguments,
302
303
  context,
@@ -321,7 +322,7 @@ function _acknowledge_method(inputArguments: VariantLike[], context: ISessionCon
321
322
  *
322
323
  * @private
323
324
  */
324
- function _confirm_method(inputArguments: VariantLike[], context: ISessionContext, callback: any) {
325
+ function _confirm_method(inputArguments: VariantLike[], context: ISessionContext, callback: CallbackT<CallMethodResultOptions>) {
325
326
  UAConditionImpl.with_condition_method(
326
327
  inputArguments,
327
328
  context,
@@ -6,7 +6,7 @@ import { isEqual } from "lodash";
6
6
  import { assert } from "node-opcua-assert";
7
7
  import { NodeClass } from "node-opcua-data-model";
8
8
  import { DataValue } from "node-opcua-data-value";
9
- import { NodeId } from "node-opcua-nodeid";
9
+ import { NodeId, sameNodeId } from "node-opcua-nodeid";
10
10
  import { StatusCodes } from "node-opcua-status-code";
11
11
  import { DataType } from "node-opcua-variant";
12
12
  import { UAAlarmCondition_Base } from "node-opcua-nodeset-ua";
@@ -498,7 +498,7 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
498
498
  if (this.currentBranch().getRetain()) {
499
499
  // we need to create a new branch so the previous state could be acknowledged
500
500
  const newBranch = this.createBranch();
501
- assert(newBranch.getBranchId() !== NodeId.nullNodeId);
501
+ assert(!sameNodeId(newBranch.getBranchId(), NodeId.nullNodeId));
502
502
  // also raised a new Event for the new branch as branchId has changed
503
503
  this.raiseNewBranchState(newBranch);
504
504
  }
@@ -21,8 +21,8 @@ import { DataValue } from "node-opcua-data-value";
21
21
  import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
22
22
  import { minDate } from "node-opcua-factory";
23
23
  import { coerceNodeId, makeNodeId, NodeId, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
24
- import { StatusCode, StatusCodes } from "node-opcua-status-code";
25
- import { TimeZoneDataType } from "node-opcua-types";
24
+ import { CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
25
+ import { CallMethodResultOptions, TimeZoneDataType } from "node-opcua-types";
26
26
  import { DataType, Variant, VariantLike } from "node-opcua-variant";
27
27
  import { UAVariable, INamespace, ISessionContext, UAEventType, BaseNode, UAObject } from "node-opcua-address-space-base";
28
28
  import { UACondition_Base, UAConditionVariable, UACondition } from "node-opcua-nodeset-ua";
@@ -238,7 +238,7 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
238
238
  */
239
239
  public post_initialize(): void {
240
240
  assert(!this._branch0);
241
- this._branch0 = new ConditionSnapshot(this, NodeId.nullNodeId);
241
+ this._branch0 = new ConditionSnapshot(this, new NodeId());
242
242
 
243
243
  // the condition OPCUA object alway reflects the default branch states
244
244
  // so we set a mechanism that automatically keeps self in sync
@@ -258,13 +258,13 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
258
258
  }
259
259
 
260
260
  public getBranches(): ConditionSnapshot[] {
261
- return Object.keys(this._branches).map((x: any) => {
261
+ return Object.keys(this._branches).map((x) => {
262
262
  return this._branches[x];
263
263
  });
264
264
  }
265
265
 
266
266
  public getBranchIds(): NodeId[] {
267
- return this.getBranches().map((b: any) => b.getBranchId());
267
+ return this.getBranches().map((b) => b.getBranchId());
268
268
  }
269
269
 
270
270
  /**
@@ -284,7 +284,7 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
284
284
  */
285
285
  public deleteBranch(branch: ConditionSnapshot): void {
286
286
  const key = branch.getBranchId().toString();
287
- assert(branch.getBranchId() !== NodeId.nullNodeId, "cannot delete branch zero");
287
+ assert(!sameNodeId(branch.getBranchId(), NodeId.nullNodeId), "cannot delete branch zero");
288
288
  assert(Object.prototype.hasOwnProperty.call(this._branches, key));
289
289
  delete this._branches[key];
290
290
  this.emit("branch_deleted", key);
@@ -560,7 +560,7 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
560
560
  public raiseNewBranchState(branch: ConditionSnapshot): void {
561
561
  this.raiseConditionEvent(branch, true);
562
562
 
563
- if (branch.getBranchId() !== NodeId.nullNodeId && !branch.getRetain()) {
563
+ if (!sameNodeId(branch.getBranchId(), NodeId.nullNodeId) && !branch.getRetain()) {
564
564
  // xx console.log(" Deleting not longer needed branch ", branch.getBranchId().toString());
565
565
  // branch can be deleted
566
566
  this.deleteBranch(branch);
@@ -789,7 +789,7 @@ function UACondition_instantiate(
789
789
  // install initial branch ID (null NodeId);
790
790
  conditionNode.branchId.setValueFromSource({
791
791
  dataType: DataType.NodeId,
792
- value: NodeId.nullNodeId
792
+ value: new NodeId()
793
793
  });
794
794
 
795
795
  // install 'Comment' condition variable
@@ -920,7 +920,9 @@ function UACondition_instantiate(
920
920
  conditionNode.sourceNode.setValueFromSource(conditionSourceNode.readAttribute(null, AttributeIds.NodeId).value);
921
921
 
922
922
  // set source Name (defined in UABaseEventType)
923
- conditionNode.sourceName.setValueFromSource(conditionSourceNode.readAttribute(null, AttributeIds.DisplayName).value);
923
+ const displayName: LocalizedText = conditionSourceNode.readAttribute(null, AttributeIds.DisplayName).value
924
+ .value as LocalizedText;
925
+ conditionNode.sourceName.setValueFromSource({ dataType: DataType.String, value: displayName.text });
924
926
  }
925
927
  }
926
928
 
@@ -953,7 +955,7 @@ function UACondition_instantiate(
953
955
  */
954
956
  const baseConditionClassType = addressSpace.findObjectType("ProcessConditionClassType");
955
957
  // assert(baseConditionClassType,"Expecting BaseConditionClassType to be in addressSpace");
956
- let conditionClassId = baseConditionClassType ? baseConditionClassType.nodeId : NodeId.nullNodeId;
958
+ let conditionClassId = baseConditionClassType ? baseConditionClassType.nodeId : new NodeId();
957
959
  let conditionClassName = baseConditionClassType ? baseConditionClassType.displayName[0] : "";
958
960
  if (options.conditionClass) {
959
961
  if (typeof options.conditionClass === "string") {
@@ -1028,7 +1030,7 @@ function UACondition_instantiate(
1028
1030
  return conditionNode;
1029
1031
  }
1030
1032
 
1031
- function _disable_method(inputArguments: VariantLike[], context: ISessionContext, callback: any) {
1033
+ function _disable_method(inputArguments: VariantLike[], context: ISessionContext, callback: CallbackT<CallMethodResultOptions>) {
1032
1034
  assert(inputArguments.length === 0);
1033
1035
 
1034
1036
  const conditionNode = context.object;
@@ -1047,7 +1049,7 @@ function _disable_method(inputArguments: VariantLike[], context: ISessionContext
1047
1049
  });
1048
1050
  }
1049
1051
 
1050
- function _enable_method(inputArguments: VariantLike[], context: ISessionContext, callback: any) {
1052
+ function _enable_method(inputArguments: VariantLike[], context: ISessionContext, callback: CallbackT<CallMethodResultOptions>) {
1051
1053
  assert(inputArguments.length === 0);
1052
1054
  const conditionNode = context.object;
1053
1055
  assert(conditionNode);
@@ -1063,7 +1065,11 @@ function _enable_method(inputArguments: VariantLike[], context: ISessionContext,
1063
1065
  });
1064
1066
  }
1065
1067
 
1066
- function _condition_refresh_method(inputArguments: VariantLike[], context: ISessionContext, callback: any) {
1068
+ function _condition_refresh_method(
1069
+ inputArguments: VariantLike[],
1070
+ context: ISessionContext,
1071
+ callback: CallbackT<CallMethodResultOptions>
1072
+ ) {
1067
1073
  // arguments : IntegerId SubscriptionId
1068
1074
  assert(inputArguments.length === 1);
1069
1075
  const addressSpace = context.object!.addressSpace as AddressSpacePrivate;
@@ -1119,7 +1125,11 @@ function _perform_condition_refresh(addressSpace: AddressSpacePrivate, inputArgu
1119
1125
  return StatusCodes.Good;
1120
1126
  }
1121
1127
 
1122
- function _condition_refresh2_method(inputArguments: VariantLike[], context: ISessionContext, callback: any) {
1128
+ function _condition_refresh2_method(
1129
+ inputArguments: VariantLike[],
1130
+ context: ISessionContext,
1131
+ callback: CallbackT<CallMethodResultOptions>
1132
+ ) {
1123
1133
  // arguments : IntegerId SubscriptionId
1124
1134
  // arguments : IntegerId MonitoredItemId
1125
1135
  assert(inputArguments.length === 2);
@@ -1142,7 +1152,11 @@ function _condition_refresh2_method(inputArguments: VariantLike[], context: ISes
1142
1152
  });
1143
1153
  }
1144
1154
 
1145
- function _add_comment_method(inputArguments: VariantLike[], context: ISessionContext, callback: any) {
1155
+ function _add_comment_method(
1156
+ inputArguments: VariantLike[],
1157
+ context: ISessionContext,
1158
+ callback: CallbackT<CallMethodResultOptions>
1159
+ ) {
1146
1160
  //
1147
1161
  // The AddComment Method is used to apply a comment to a specific state of a Condition
1148
1162
  // instance. Normally, the NodeId of the object instance as the ObjectId is passed to the Call
@@ -79,7 +79,7 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
79
79
  const normalState = addressSpace._coerceNode(options.normalState)! as UAVariable;
80
80
  // assert(normalState, "Expecting a valid normalState node");
81
81
 
82
- const normalStateNodeId = normalState ? normalState.nodeId : NodeId.nullNodeId;
82
+ const normalStateNodeId = normalState ? normalState.nodeId : new NodeId();
83
83
  alarmNode.normalState.setValueFromSource({ dataType: DataType.NodeId, value: normalStateNodeId });
84
84
 
85
85
  if (inputNode) {
@@ -38,7 +38,7 @@ import {
38
38
  AccessRestrictionsFlag
39
39
  } from "node-opcua-data-model";
40
40
  import { DataValue } from "node-opcua-data-value";
41
- import { dumpIf, make_warningLog } from "node-opcua-debug";
41
+ import { dumpIf, make_warningLog, make_errorLog } from "node-opcua-debug";
42
42
  import { coerceNodeId, makeNodeId, NodeId, NodeIdLike, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
43
43
  import { NumericRange } from "node-opcua-numeric-range";
44
44
  import { ReferenceDescription } from "node-opcua-service-browse";
@@ -83,6 +83,7 @@ import { coerceRolePermissions } from "./role_permissions";
83
83
 
84
84
  const doDebug = false;
85
85
  const warningLog = make_warningLog(__filename);
86
+ const errorLog = make_errorLog(__filename);
86
87
 
87
88
  function defaultBrowseFilterFunc(context?: ISessionContext): boolean {
88
89
  return true;
@@ -1205,6 +1206,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
1205
1206
  result = this.addressSpace.findReferenceType(referenceType)!;
1206
1207
  /* istanbul ignore next */
1207
1208
  if (!result) {
1209
+ errorLog("referenceType ", referenceType, " cannot be found");
1208
1210
  throw new Error("Cannot coerce reference with name " + referenceType);
1209
1211
  }
1210
1212
  } else if (referenceType instanceof NodeId) {