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.
- package/CHANGELOG.md +7 -0
- package/package.json +4 -1
- package/src/compilers/CPPCompiler.js +176 -2
- package/src/compilers/JSCompiler.js +15 -0
- package/src/compilers/st-parser/expressionConverter.js +8 -0
- package/src/compilers/support/generic/modbus.cpp +57 -18
- package/src/compilers/support/jint/nodalis/NodalisEngine/NodalisEngine.csproj +2 -2
- package/src/compilers/support/jint/nodalis/NodalisEngine/OPCClient.cs +63 -10
- package/src/compilers/support/jint/nodalis/NodalisEngine/OPCServer.cs +69 -9
- package/src/compilers/support/jint/nodalis/NodalisEngine/README.md +5 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.deps.json +263 -162
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.pdb +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Debug/net8.0/NodalisEngine.xml +2 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/NodalisEngine.1.0.10.nupkg +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/NodalisEngine.1.0.11.nupkg +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/NodalisEngine.1.0.12.nupkg +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.deps.json +263 -162
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.pdb +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/bin/Release/net8.0/NodalisEngine.xml +2 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.AssemblyInfo.cs +3 -3
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.AssemblyInfoInputs.cache +1 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.assets.cache +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.csproj.AssemblyReference.cache +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.csproj.CoreCompileInputs.cache +1 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.pdb +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.sourcelink.json +1 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/NodalisEngine.xml +2 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/ref/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Debug/net8.0/refint/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/NodalisEngine.csproj.nuget.dgspec.json +2 -2
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/NodalisEngine.csproj.nuget.g.targets +3 -2
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/NodalisEngine.1.0.10.nuspec +2 -2
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/NodalisEngine.1.0.11.nuspec +31 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/NodalisEngine.1.0.12.nuspec +31 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.AssemblyInfo.cs +3 -3
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.AssemblyInfoInputs.cache +1 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.assets.cache +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.csproj.AssemblyReference.cache +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.csproj.CoreCompileInputs.cache +1 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.pdb +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.sourcelink.json +1 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/NodalisEngine.xml +2 -1
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/ref/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/Release/net8.0/refint/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/project.assets.json +495 -224
- package/src/compilers/support/jint/nodalis/NodalisEngine/obj/project.nuget.cache +24 -19
- package/src/compilers/support/jint/nodalis/NodalisPLC/Program.cs +14 -5
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/BouncyCastle.Cryptography.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Esprima.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Jint.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Newtonsoft.Json.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisEngine.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisEngine.pdb +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisEngine.xml +0 -693
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.deps.json +0 -358
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.pdb +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/NodalisPLC.runtimeconfig.json +0 -12
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Client.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Configuration.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Core.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Gds.Client.Common.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Gds.Server.Common.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Security.Certificates.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/Opc.Ua.Server.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/System.IO.Pipelines.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/System.Text.Encodings.Web.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/System.Text.Json.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/bin/Debug/net8.0/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +0 -4
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.AssemblyInfo.cs +0 -22
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.AssemblyInfoInputs.cache +0 -1
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.GeneratedMSBuildEditorConfig.editorconfig +0 -15
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.GlobalUsings.g.cs +0 -8
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.assets.cache +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.AssemblyReference.cache +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.CoreCompileInputs.cache +0 -1
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.FileListAbsolute.txt +0 -37
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.csproj.Up2Date +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.genruntimeconfig.cache +0 -1
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.pdb +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/NodalisPLC.sourcelink.json +0 -1
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/apphost +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/ref/NodalisPLC.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/Debug/net8.0/refint/NodalisPLC.dll +0 -0
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/NodalisPLC.csproj.nuget.dgspec.json +0 -282
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/NodalisPLC.csproj.nuget.g.props +0 -15
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/NodalisPLC.csproj.nuget.g.targets +0 -7
- package/src/compilers/support/jint/nodalis/NodalisPLC/obj/project.assets.json +0 -3181
- 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:
|
|
76
|
+
ApplicationUri = $"urn:{hostname}:NodalisServer",
|
|
75
77
|
ServerConfiguration = new ServerConfiguration
|
|
76
78
|
{
|
|
77
|
-
BaseAddresses = { "opc.tcp://
|
|
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 =
|
|
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://
|
|
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.
|