View Issue Details

IDProjectCategoryView StatusLast Update
0007637CTT UA Scripts1 - Script Issuepublic2022-09-02 15:49
ReporterElliot Gawthrop Assigned ToAlexander Allmendinger  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.03.501 
Summary0007637: Monitor Value Change 041.js fails with 2D float arrays
Description

If a 2D array is configured in NodeIds/Static/All Profiles/Multi-Dimensional-Arrays/Float, the Assert.Equal on line 97 of Monitor Value Change / 041.js will fail, even though arrays appear to be equal.

All other data types seem to work (except Variant, but this may be a separate issue as I am having trouble on lots of tests when it comes to Variants).

Steps To Reproduce
  1. Run Opc Ua ReferenceServer
    2.Configure NodeIds/Static/All Profiles/Multi-Dimensional-Arrays/Float to point to Scalar_Static_Arrays2D_Float
  2. Run Monitor Value Change / 041.js
Additional Information

I tested whether the arrays were equal by adding the following code just before the failing Assert.

<code>
if (TC_Variables.MDArrays[s].Value.Value.DataType == 10) {
var lhs = TC_Variables.MDArrays[s].Value.Value;
var rhs = PublishHelper.ReceivedDataChanges[t].MonitoredItems[i].Value.Value;
var rawDimensions = TC_Variables.MDArrays[s].Value.Value.FloatMatrix;
var dimensions = rawDimensions.substring(1, rawDimensions.length - 1).split('][').map(function(x) { return parseInt(x); });
var rank = dimensions.length;
if (rank == 2) {
for (var xi = 0; xi < dimensions[0]; xi++) {
var xistr = "[" + xi + "]";
for (var xj = 0; xj < dimensions[1]; xj++) {
var xjstr = "[" + xj + "]";
Assert.Equal(lhs[xistr][xjstr], rhs[xistr][xjstr], "Unexpected value for " + xistr + xjstr);
}
}
}
}
</code>

TagsNo tags attached.
Files Affected

Activities

Alexander Allmendinger

2022-03-03 14:53

developer   ~0016156

The code has been extended by a special handling for Float arrays (like already done for Double and Variant from line 76).

Incidentally during testing, another logical error was discovered in Assert.Equal for which ( 1, NaN ) returns false and an error message, while( NaN, 1 ) is also false, but does not return an error message. The logic has been modified to return an error message in both cases.

Paul Hunkar

2022-09-02 15:49

administrator   ~0017502

reviewed code in call , agreed to updates and closed issue

Issue History

Date Modified Username Field Change
2022-01-24 13:19 Elliot Gawthrop New Issue
2022-02-25 16:27 Paul Hunkar Assigned To => Alexander Allmendinger
2022-02-25 16:27 Paul Hunkar Status new => assigned
2022-03-03 14:53 Alexander Allmendinger Status assigned => resolved
2022-03-03 14:53 Alexander Allmendinger Resolution open => fixed
2022-03-03 14:53 Alexander Allmendinger Note Added: 0016156
2022-08-02 20:03 Paul Hunkar Project Compliance Test Tool (CTT) Unified Architecture => CTT UA Scripts
2022-09-02 15:49 Paul Hunkar Status resolved => closed
2022-09-02 15:49 Paul Hunkar Fixed in Version => 1.03.501
2022-09-02 15:49 Paul Hunkar Note Added: 0017502