我想在HTML文件中加载一个带有“require”的本地版本的节点-opcua,但是它并不真正有效。代码片段如下:
<script type="text/javascript" src="path_to_require.js"></script>
<script>
var opcua = require(["path_to_node-opcua"]); <!-- Yes, the path is correct >
var client = new opcua.OPCUAClient();
我正在使用node OPC-UA客户端,并收到以下错误
Error: cannot coerce value=4 to Enum
at _decode_enumeration (/Users/xxx/apps/node-opcua-sample/node_modules/node-opcua-factory/src/factories_enumerations.js:52:23)
at UserTokenPolicy.decode (/Users/xxx/apps/node-opcua-sample/node_modules/node-opcua-service-endpoints/_gen
我对pyinstaller有问题,我使用库opcua进行通信,在pycharm中正常运行,一切正常工作,在使用pyinstaller创建.exe之后,在几秒钟或几分钟后通信停止。
from opcua import Client
from opcua.crypto import security_policies
from opcua.ua import MessageSecurityMode
from opcua import ua
def connect(self):
try:
self.client.set_security(policy=sec
我是OpcUa的新手,我正在使用node opcua堆栈。
我使用SIOME创建了一个信息模型。
我现在正在尝试将其导入服务器。
下面是代码:
const opcua = require("node-opcua");
var nodeset_filename1 ="Opc.Ua.Di.NodeSet2.xml";
var nodeset_filename2 ="custom.NodeSet2.xml" //this one is getting me error
var server_options = {
nodeset_file
我现在已经安装了Python2.7.15,我正在尝试导入Python模块。我这样做专门是为了访问Server方法。到目前为止,我已经尝试了两种方法,这两种方法都给出了同样的错误。
ImportError:没有名为opcua的模块
第一种方法:
from opcua import Server
第二种方法:
from __future__import opcua
在使用opcua模块之前,我首先需要安装一个单独的包吗?
这就是我想要创造的,这对我来说是全新的。我希望有人能帮助我。
//this is the part I cannot figure out, maby anyone knows a tool how to find this port
const endpointUrl = "opc.tcp://145.49.49.3:???";
const opcua = require("node-opcua");
const AttributeIds = opcua.AttributeIds;
const OPCUAClient = opcua.OPCUAClient;
我在github中找到了一个更好的项目节点--opcua,使用这个项目的简单例子可以创建opc服务器和客户端,并且在本地可以访问,我现在需要访问远程opc服务器,提供几个参数是: IP网络节点(如10.195.156.150),opc服务(例如ArchestrA )。FSGateway)、opc组(如ArchestrA)、opc TagName (例如HXi1_P201_00 )。我可以使用节点-opcua访问它吗?谢谢!
sample_server代码:
var opcua = require("node-opcua");
var os = require("os
我正在学习节点opc-ua,并遵循了sample_server.js和simple_client.js的GitHub页面中提供的示例。
在sample_server中,我在构建服务器的地址空间时添加了一个变量,例如:
//this code is in the server
addressSpace.addVariable({
componentOf: device,
nodeId: "ns=1;s=variable_1",
browseName: "MyVariable1",
dataTy
您好,我正在尝试将我的OPC-UA服务器注册到本地运行(目前)本地发现服务器。因此,当我在registerServerMethod设置为lds的情况下运行我的服务器时,我得到了这个错误: RegisterServer to the LDS has failed during secure connection => please check that you server certificate is trusted by the LDS. err: The connection has been rejected by server,
Please check that clie
我有一台西门子1200 PLC。使用node-opcua客户端和Kepserver,我能够读取变量并更改值。现在,我想从KepServer中的node-opcua创建一个新的变量。
我尝试使用node-opcua服务器,因为在示例中我已经看到了如何创建变量,但我得到了一个错误,因为我正在尝试连接到与KepServer相同的端口。
var server = new opcua.OPCUAServer({
port: 49320, // the port of the listening socket of the server
resourcePath: ""
我刚刚在OPCUA规范中发现支持图像(BMP、GIF、JPG和PNG) (请参阅)。我还查看了org.eclipse.milo.opcua.stack.core.Identifiers,我发现有一些类型可以处理这些图像格式:
public static final NodeId ImageBMP = init(2000);
public static final NodeId ImageGIF = init(2001);
public static final NodeId ImageJPG = init(2002);
public static final N
我尝试用下面的例子写入值:opc ua client to server 但是我有这个错误: Exception "unhandled opcua.ua.uaerrors._auto.BadTypeMismatch"
"The value supplied for the attribute is not of the same type as the attribute"s value."(BadTypeMismatch)
File: C:\Users\lari\AppData\Local\Programs\Python\Python38\lib\
当我试图将一些消息发布到代理时,我得到了以下错误:
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.8/site-packages/opcua/client/client.py", line 66, in run
self.cli