node-opc-da
node-opc-da copied to clipboard
Error: unknown.queryInterface is not a function when getGroupByName() in opcServer.js
When I try to use the function "getGroupByName (name)" it returns an error. After a superficial debug I found that "resultObj.getResults ()" returns two _type and _obj objects, the initialization must be done in _obj.
let result = resultObj.getResults(); if (hresult != 0) { if (result.lenght == 0) throw new Error(String(hresult)); else debug(new Error(String(hresult))); }
let group = new OPCGroupStateManager();
await group.init(result[0]._obj); // <= here line 257 of "opcServer.js"
debug("Successfully get request for group \"" + name +"\".");
return group;
}
After that, the error will no longer occur and degug.log returns us: Successfully get request for group "XYZ_Test".