这就是我试图创造的,这对我来说是全新的。我希望有一个人可以帮助我。//this is the part I cannot figure out, maby anyone knows a tool how to find this portconst endpointUrl = "opc.tcp://145.49.49.3:???";const opcua = require("node-opcua");const AttributeIds = opcua.AttributeIds;const OPCUAClient = opcua.OPCUAClient;(async function main(){ const client = new OPCUAClient({}); await client.connect(endpointUrl); const session = await client.createSession({userName: "admin", password: ""}); const dataValue = await session.read({nodeId: "ns=1;s=AcquisitionCount",attributeId: AttributeIds.Value}); console.log(`Count is ${dataValue.value.value.toPrecision(3)}°C.`); await client.closeSession(session,true); await client.disconnect();})();
添加回答
举报
0/150
提交
取消