Closed shreeramk closed 4 years ago
There is not enough information to understand the issue and reproduce it, I am afraid, please fill the form.
Or call parameter aggregate function is just wrong? Value 2342 should be 'Average' or some other aggregate.
const dataValues = await session.readAggregateValue(
{ nodeId: "ns=5;s=Simulation Examples.Functions.Sine1" },
"2015-06-10T09:00:00.000Z",
"2015-06-10T09:01:00.000Z", 'Average', 3600000);
@erossignon On running the sample code that I mentioned above(Get Aggregate(Average) for two tags between a date range), then I m getting an error which says:
Error: Error: serviceResult = BadAggregateListMismatch (0x80d40000)
Is the full call stack required here?
The error that you see there BadAggregateListMismatch is generated by the remote server.
@shreeramk the missing information is about the server
I guess that you are using javascript and not typescript, therefore there are some type mismatch in passing argument to the method that cannot be detected. Strictly speaking the signature of the readAggregateValue method is :
public async readAggregateValue(
nodesToRead: HistoryReadValueIdOptions[],
startTime: DateTime,
endTime: DateTime,
aggregateFn: AggregateFunction,
processingInterval: number
) : Promise<HistoryReadResult[]>;
therefore the correct use should be:
const dataValues = await session.readAggregateValue(
{ nodeId: "ns=5;s=Simulation Examples.Functions.Sine1" },
new Date("2015-06-10T09:00:00.000Z"),
new Date("2015-06-10T09:01:00.000Z"),
AggregateFunction.Average, 36000);
Note: I realize the sample provided in the code is wrong ... this need fixing
comment fixed in 77d46dd1d7062a45b50e1fba6a82f24c04d9374f
Comment fix available in 2.19.0
@shreeramk please confirm that this helped
UA Tunneller: Matrikon OPC node-opcua: 2.14.0 and 2.19.0 Using Javascript.
Summary: If I try to get aggregated data for one nodeId, it works fine. _const nodeToRead = [{nodeId: "ns=6;s=2:\\osipiserver\Generator.ACTIVEPOWER"}];
But when I try to get aggregated data for more than one nodeId then below error is thrown Error: Error: serviceResult = BadAggregateListMismatch (0x80d40000)
_const nodeToRead = [{nodeId: "ns=6;s=2:\\osipiserver\Generator.UNIT4_ACTIVE_POWER"},{nodeId: "ns=6;s=2:\\osipiserver\Generator.GEN_CORE_TEMP3"},];
Ok. I suggest you contact Matrikon support about it. This error is raised by the server itself.
@shreeramk
*BadAggregateListMismatch means The requested number of Aggregates does not match the requested number of NodeIds
We need to add the ability to pass an arry of AggregateFunctions when mutilple nodeId are specified.
const dataValues = await session.readAggregateValue(
[
{ nodeId: "ns=5;s=Simulation Examples.Functions.Sine1" },
{ nodeId: "ns=5;s=Simulation Examples.Functions.Sine2" }
],
new Date("2015-06-10T09:00:00.000Z"),
new Date("2015-06-10T09:01:00.000Z"),
[
AggregateFunction.Average,
AggregateFunction.Average
],
36000);
@erossignon Yes agreed.
@erossignon can i create a pull request for this? Or if you have already made the changes for same, then if you can merge & release it?
@shreeramk , yes, sure! you're welcome, I haven't made the change yet, so go first.
@shreeramk thanks for your contribution, your enhancement is now available in node-opcua@2.22.0
Error: Error: serviceResult = BadAggregateListMismatch (0x80d40000)
Sample Code: