View Issue Details

IDProjectCategoryView StatusLast Update
0004439Compliance Test Tool (CTT) Unified Architecture5 - General Problempublic2019-07-25 15:00
ReporterHannes Mezger Assigned ToAlexander Allmendinger  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSWindowsOS Version8.1
Product Version1.03.341.383 
Target Version1.03Fixed in Version1.03.341.383 
Summary0004439: Data Access/Data Access PercentDeadBand/008.js sporadically fails
Description

Tested with UnifiedAutomation AnsiC Demoserver 1.8.3

When running Data Access/Data Access PercentDeadBand/008.js a few times in a row, the test sometimes fails. The initial value of the used node (ns=4;s=Demo.CTT.DAProfile.AnalogType.Byte) seems not to have an impact of the result. The error says:

Expected a dataChange for written a value of '24'. The item was previously modified with a DeadbandPercent of 0, so the
value should have been returned.

TagsNo tags attached.
Files Affected

Activities

Bernd Edlinger

2018-11-15 07:03

reporter   ~0009598

I see that also sporadically happen with the Softing C++ Server:

Expected a dataChange for written a value of '44'. The item was previously modified with a DeadbandPercent of 0, so the
value should have been returned.

Bernd Edlinger

2018-11-15 10:58

reporter   ~0009599

Okay I think I know the reason why this fails sproadically.

Read( NodesToRead #1; TimestampsToReturn: 2; MaxAge: 0 ).Response.ResponseHeader.ServiceResult: Good (0x00000000) as expected.
GetEURange determined:
Lo = 0
Hi = 100
Generating 4 values for deadband testing. Values to pass deadband filtering?true. Range is: 0 to 100, percentage being tested: 10
Values to Pass deadband filtering based on starting number '0' are:
11,22,33,44
Generating 3 values for deadband testing. Values to pass deadband filtering?false. Range is: 0 to 100, percentage being tested: 10
Min bound number = 34; Max bound number = 54
Values to Fail deadband filtering based on starting number '44' are:
44,50,51

First a few Items are written that guarantee to exceed the 10% deadband.
11,22,33,44, and then
3 random values are chosen, that do not exceed the deadband.
for instance 44,50,51
The test case always fails then the first random value is exactly 44.
When it is any other value it passes.

That happens, because
after the 51 is written, and the last keep alive received,
the deadband is changed to 0% and 44 is again written, but that
is the last published value.
Therefore the server does not publish 44 again.

Test can be fixed by the following patch:

--- library/NodeTypeBased/AnalogItemType/EURange.js 2018-11-06 18:09:42.000000000 +0100
+++ library/NodeTypeBased/AnalogItemType/EURange.js 2018-11-15 11:55:27.903400565 +0100
@@ -137,7 +137,7 @@
}
// add whatever has been generated to the array, providing it is not a duplicate
// of the last value written.

  • if( currentValue != results[ results.length - 1] ) {
  • if( currentValue != (results.length > 0 ? results[ results.length - 1] : startingNumber) ) {
    // is the number a decimal and if so restrict to 1 decimal place
    if( currentValue.toString().indexOf( "." ) > 0 ) {
    currentValue = Number( currentValue);

Interesting, why accessing results[-1] did cause a script error.

Bernd Edlinger

2018-11-15 11:01

reporter   ~0009600

I mean, why accessing results[-1] did not cause a script error.

Alexander Allmendinger

2018-12-19 13:21

developer   ~0009739

Thanks Bernd for the detailed investigation. I came to the same conclusion and therefore fixed the script accordingly.

Paul Hunkar

2019-07-25 15:00

administrator   ~0010599

reviewed in CMP call

Issue History

Date Modified Username Field Change
2018-11-07 17:01 Hannes Mezger New Issue
2018-11-07 17:01 Hannes Mezger Status new => assigned
2018-11-07 17:01 Hannes Mezger Assigned To => Alexander Allmendinger
2018-11-07 17:01 Hannes Mezger Issue generated from: 0004438
2018-11-08 14:41 Hannes Mezger Issue cloned: 0004442
2018-11-15 07:03 Bernd Edlinger Note Added: 0009598
2018-11-15 10:58 Bernd Edlinger Note Added: 0009599
2018-11-15 11:01 Bernd Edlinger Note Added: 0009600
2018-12-19 13:21 Alexander Allmendinger Note Added: 0009739
2018-12-19 13:21 Alexander Allmendinger Status assigned => resolved
2018-12-19 13:21 Alexander Allmendinger Fixed in Version => 1.03.341.383
2018-12-19 13:21 Alexander Allmendinger Resolution open => fixed
2019-01-28 14:14 Paul Hunkar Category General Problem => 4 - General Problem
2019-01-28 14:15 Paul Hunkar Category 4 - General Problem => 5 - General Problem
2019-07-25 15:00 Paul Hunkar Target Version => 1.03
2019-07-25 15:00 Paul Hunkar Status resolved => closed
2019-07-25 15:00 Paul Hunkar Note Added: 0010599