nodalis-compiler 1.0.30 → 1.0.32

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 (98) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +4 -1
  3. package/src/compilers/CPPCompiler.js +176 -2
  4. package/src/compilers/JSCompiler.js +15 -0
  5. package/src/compilers/st-parser/expressionConverter.js +8 -0
  6. package/src/compilers/support/generic/modbus.cpp +57 -18
  7. package/src/compilers/support/jint/nodalis/NodalisEngine/NodalisEngine.csproj +2 -2
  8. package/src/compilers/support/jint/nodalis/NodalisEngine/OPCClient.cs +63 -10
  9. package/src/compilers/support/jint/nodalis/NodalisEngine/OPCServer.cs +69 -9
  10. package/src/compilers/support/jint/nodalis/NodalisEngine/README.md +5 -0
  11. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.deps.json +263 -162
  12. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.dll +0 -0
  13. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.pdb +0 -0
  14. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.xml +2 -1
  15. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/NodalisEngine.1.0.10.nupkg +0 -0
  16. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/NodalisEngine.1.0.11.nupkg +0 -0
  17. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/NodalisEngine.1.0.12.nupkg +0 -0
  18. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.deps.json +263 -162
  19. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.dll +0 -0
  20. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.pdb +0 -0
  21. package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.xml +2 -1
  22. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.AssemblyInfo.cs +3 -3
  23. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.AssemblyInfoInputs.cache +1 -1
  24. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.assets.cache +0 -0
  25. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.csproj.AssemblyReference.cache +0 -0
  26. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.csproj.CoreCompileInputs.cache +1 -1
  27. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.dll +0 -0
  28. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.pdb +0 -0
  29. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.sourcelink.json +1 -1
  30. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.xml +2 -1
  31. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/ref/NodalisEngine.dll +0 -0
  32. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/refint/NodalisEngine.dll +0 -0
  33. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/NodalisEngine.csproj.nuget.dgspec.json +2 -2
  34. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/NodalisEngine.csproj.nuget.g.targets +3 -2
  35. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/NodalisEngine.1.0.10.nuspec +2 -2
  36. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/NodalisEngine.1.0.11.nuspec +31 -0
  37. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/NodalisEngine.1.0.12.nuspec +31 -0
  38. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.AssemblyInfo.cs +3 -3
  39. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.AssemblyInfoInputs.cache +1 -1
  40. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.assets.cache +0 -0
  41. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.csproj.AssemblyReference.cache +0 -0
  42. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.csproj.CoreCompileInputs.cache +1 -1
  43. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.dll +0 -0
  44. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.pdb +0 -0
  45. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.sourcelink.json +1 -1
  46. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.xml +2 -1
  47. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/ref/NodalisEngine.dll +0 -0
  48. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/refint/NodalisEngine.dll +0 -0
  49. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/project.assets.json +495 -224
  50. package/src/compilers/support/jint/nodalis/NodalisEngine/obj/project.nuget.cache +24 -19
  51. package/src/compilers/support/jint/nodalis/NodalisPLC/Program.cs +14 -5
  52. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/BouncyCastle.Cryptography.dll +0 -0
  53. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Esprima.dll +0 -0
  54. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Jint.dll +0 -0
  55. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
  56. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
  57. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Newtonsoft.Json.dll +0 -0
  58. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisEngine.dll +0 -0
  59. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisEngine.pdb +0 -0
  60. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisEngine.xml +0 -693
  61. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC +0 -0
  62. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.deps.json +0 -358
  63. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.dll +0 -0
  64. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.pdb +0 -0
  65. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.runtimeconfig.json +0 -12
  66. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Client.dll +0 -0
  67. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Configuration.dll +0 -0
  68. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Core.dll +0 -0
  69. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Gds.Client.Common.dll +0 -0
  70. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Gds.Server.Common.dll +0 -0
  71. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Security.Certificates.dll +0 -0
  72. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Server.dll +0 -0
  73. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/System.IO.Pipelines.dll +0 -0
  74. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/System.Text.Encodings.Web.dll +0 -0
  75. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/System.Text.Json.dll +0 -0
  76. package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll +0 -0
  77. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +0 -4
  78. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.AssemblyInfo.cs +0 -22
  79. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.AssemblyInfoInputs.cache +0 -1
  80. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.GeneratedMSBuildEditorConfig.editorconfig +0 -15
  81. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.GlobalUsings.g.cs +0 -8
  82. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.assets.cache +0 -0
  83. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.AssemblyReference.cache +0 -0
  84. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.CoreCompileInputs.cache +0 -1
  85. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.FileListAbsolute.txt +0 -37
  86. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.Up2Date +0 -0
  87. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.dll +0 -0
  88. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.genruntimeconfig.cache +0 -1
  89. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.pdb +0 -0
  90. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.sourcelink.json +0 -1
  91. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/apphost +0 -0
  92. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/ref/NodalisPLC.dll +0 -0
  93. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/refint/NodalisPLC.dll +0 -0
  94. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/NodalisPLC.csproj.nuget.dgspec.json +0 -282
  95. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/NodalisPLC.csproj.nuget.g.props +0 -15
  96. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/NodalisPLC.csproj.nuget.g.targets +0 -7
  97. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/project.assets.json +0 -3181
  98. package/src/compilers/support/jint/nodalis/NodalisPLC/obj/project.nuget.cache +0 -51
@@ -21,6 +21,7 @@ using Opc.Ua.Configuration;
21
21
  using Opc.Ua.Server;
22
22
  using System;
23
23
  using System.Collections.Generic;
24
+ using System.IO;
24
25
  using System.Threading.Tasks;
25
26
 
26
27
  namespace Nodalis
@@ -57,8 +58,9 @@ namespace Nodalis
57
58
  /// <summary>
58
59
  /// Starts the server.
59
60
  /// </summary>
61
+ /// <param name="hostname">The hostname or IP address for the server.</param>
60
62
  /// <returns></returns>
61
- public async Task StartAsync()
63
+ public async Task StartAsync(string hostname = "localhost")
62
64
  {
63
65
  _application = new ApplicationInstance
64
66
  {
@@ -71,30 +73,83 @@ namespace Nodalis
71
73
  {
72
74
  ApplicationName = "NodalisServer",
73
75
  ApplicationType = ApplicationType.Server,
74
- ApplicationUri = "urn:localhost:NodalisServer",
76
+ ApplicationUri = $"urn:{hostname}:NodalisServer",
75
77
  ServerConfiguration = new ServerConfiguration
76
78
  {
77
- BaseAddresses = { "opc.tcp://localhost:4840/UA/Nodalis" }
79
+ BaseAddresses = { $"opc.tcp://{hostname}:4840/UA/Nodalis" },
80
+ SecurityPolicies =
81
+ {
82
+ new ServerSecurityPolicy
83
+ {
84
+ SecurityMode = MessageSecurityMode.None,
85
+ SecurityPolicyUri = SecurityPolicies.None
86
+ }
87
+ },
88
+ UserTokenPolicies =
89
+ {
90
+ new UserTokenPolicy
91
+ {
92
+ TokenType = UserTokenType.Anonymous
93
+ }
94
+ }
78
95
  },
79
96
  TransportQuotas = new TransportQuotas { OperationTimeout = 15000 },
80
- SecurityConfiguration = new SecurityConfiguration
81
- {
82
- ApplicationCertificate = new CertificateIdentifier(),
83
- AutoAcceptUntrustedCertificates = true
84
- },
97
+ SecurityConfiguration = CreateSecurityConfiguration(),
85
98
  CertificateValidator = new CertificateValidator(),
86
99
  //DiagnosticsConfiguration = new DiagnosticsConfiguration { Enabled = true },
87
100
  Extensions = new XmlElementCollection()
88
101
  };
89
102
 
90
103
  await config.Validate(ApplicationType.Server);
104
+ await config.CertificateValidator.UpdateAsync(config, default);
91
105
 
92
106
  _application.ApplicationConfiguration = config;
107
+ await _application.CheckApplicationInstanceCertificatesAsync(false, 0);
93
108
 
94
109
  _server = new NodalisServer(_engine, _addressMap);
95
110
  _application.Start(_server);
96
111
 
97
- Console.WriteLine("OPC UA Server started at: opc.tcp://localhost:4840/UA/Nodalis");
112
+ Console.WriteLine($"OPC UA Server started at: opc.tcp://{hostname}:4840/UA/Nodalis");
113
+ }
114
+
115
+ private static SecurityConfiguration CreateSecurityConfiguration()
116
+ {
117
+ string pkiRoot = Path.Combine(AppContext.BaseDirectory, "pki");
118
+ string ownStore = Path.Combine(pkiRoot, "own");
119
+ string trustedPeerStore = Path.Combine(pkiRoot, "trusted");
120
+ string trustedIssuerStore = Path.Combine(pkiRoot, "issuer");
121
+ string rejectedStore = Path.Combine(pkiRoot, "rejected");
122
+
123
+ Directory.CreateDirectory(ownStore);
124
+ Directory.CreateDirectory(trustedPeerStore);
125
+ Directory.CreateDirectory(trustedIssuerStore);
126
+ Directory.CreateDirectory(rejectedStore);
127
+
128
+ return new SecurityConfiguration
129
+ {
130
+ ApplicationCertificate = new CertificateIdentifier
131
+ {
132
+ StoreType = CertificateStoreType.Directory,
133
+ StorePath = ownStore,
134
+ SubjectName = "CN=NodalisServer"
135
+ },
136
+ TrustedPeerCertificates = new CertificateTrustList
137
+ {
138
+ StoreType = CertificateStoreType.Directory,
139
+ StorePath = trustedPeerStore
140
+ },
141
+ TrustedIssuerCertificates = new CertificateTrustList
142
+ {
143
+ StoreType = CertificateStoreType.Directory,
144
+ StorePath = trustedIssuerStore
145
+ },
146
+ RejectedCertificateStore = new CertificateTrustList
147
+ {
148
+ StoreType = CertificateStoreType.Directory,
149
+ StorePath = rejectedStore
150
+ },
151
+ AutoAcceptUntrustedCertificates = true
152
+ };
98
153
  }
99
154
  /// <summary>
100
155
  /// Stops the server.
@@ -222,6 +277,7 @@ namespace Nodalis
222
277
  var variable = new BaseDataVariableState(folder)
223
278
  {
224
279
  SymbolicName = name,
280
+ ReferenceTypeId = ReferenceTypeIds.Organizes,
225
281
  NodeId = new NodeId(name, NamespaceIndex),
226
282
  BrowseName = new QualifiedName(name, NamespaceIndex),
227
283
  DisplayName = name,
@@ -251,6 +307,7 @@ namespace Nodalis
251
307
  }
252
308
  };
253
309
 
310
+ folder.AddChild(variable);
254
311
  AddPredefinedNode(SystemContext, variable);
255
312
  }
256
313
  }
@@ -261,6 +318,7 @@ namespace Nodalis
261
318
  else if (address.Contains("X")) return _engine.ReadByte(address);
262
319
  else if (address.Contains("W")) return _engine.ReadWord(address);
263
320
  else if (address.Contains("D")) return _engine.ReadDWord(address);
321
+ else if (address.Contains("L")) return _engine.ReadLWord(address);
264
322
  return false;
265
323
  }
266
324
 
@@ -272,6 +330,7 @@ namespace Nodalis
272
330
  case byte bt: _engine.WriteByte(address, bt); break;
273
331
  case ushort us: _engine.WriteWord(address, us); break;
274
332
  case uint ui: _engine.WriteDWord(address, ui); break;
333
+ case ulong ui64: _engine.WriteLWord(address, ui64); break;
275
334
  default: throw new InvalidCastException($"Unsupported value type: {value?.GetType()?.Name}");
276
335
  }
277
336
  }
@@ -283,6 +342,7 @@ namespace Nodalis
283
342
  else if (address.Contains("X")) return DataTypeIds.Byte;
284
343
  else if (address.Contains("W")) return DataTypeIds.UInt16;
285
344
  else if (address.Contains("D")) return DataTypeIds.UInt32;
345
+ else if (address.Contains("L")) return DataTypeIds.UInt64;
286
346
  return DataTypeIds.Boolean;
287
347
  }
288
348
 
@@ -88,6 +88,11 @@ NodalisEngine is distributed under the Apache 2.0 license. See the headers insid
88
88
 
89
89
  # Changelog
90
90
 
91
+ ## [1.0.12] - 2026-05-04
92
+ - Added ability to set hostname for OPCServer.
93
+ - Added support for LWord types to OPCServer.
94
+ - Fixed problems with connecting to OPCServer
95
+
91
96
  ## [1.0.9] - 2026-02-12
92
97
 
93
98
  - Fixed TP function block.