View Issue Details

IDProjectCategoryView StatusLast Update
0007929CTT UA Scripts1 - Script Issuepublic2022-09-29 15:58
ReporterFlorin Neamtu Assigned ToYannik Klaass  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version10
Fixed in Version1.03.501 
Summary0007929: CTT issue - attribute write index 006.js reports Write.Response[1].StatusCode = BadTypeMismatch
Description

Run a server that has imported ReferenceServer.NodeSet2.xml from OPCFoundation\UA-.NETStandard.
The CTT imported nodes should include a node with an id ...;s=CTT_Scalar_Static_Arrays_Byte that should be part of compliance tool setting on Settings\Server Test\NodeIds\Static\AllProfiles\Arrays Byte entry beside the other similar array nodes references.

Run the compliance tool selecting script option Attribute Services\Attribute Write Index\006.js

All ctt nodes provided in ctt settings array nodes are passing except CTT_Scalar_Static_Arrays_Byte which rise script exception Write().Response.Results[1].StatusCode = 'BadTypeMismatch (0x80740000)'; but StatusCode 'BadIndexRangeNoData (0x80370000)' was expected (Node Setting: '/Server Test/NodeIds/Static/All Profiles/Arrays/Byte') StatusCode expectations for this call were...

The OPCFoundation\UA-.NETStandard server actually converts the byte[] to ByteString based on documentation aka. https://reference.opcfoundation.org/v104/Core/docs/Part6/5.1.4/

Actually the issue happens on initialize.js line 25 if( ReadHelper.Execute( { NodesToRead: items } ) ) {
During the read the byte[] and ByteString is interpreted with the same type ByteString = 15 instead of Byte = 3 and the the js code does not try to split the received value into byte[] then the exception. Unfortunately the server respect the documentation considering byte[] as ByteString that is correct based on dcoumentation.

Steps To Reproduce
  1. Run a server that has imported ReferenceServer.NodeSet2.xml from OPCFoundation\UA-.NETStandard.
    The CTT imported nodes should include a node with an id ...;s=CTT_Scalar_Static_Arrays_Byte that should be part of compliance tool setting on Settings\Server Test\NodeIds\Static\AllProfiles\Arrays Byte entry beside the other similar array nodes references.

  2. Run the compliance tool selecting script option Attribute Services\Attribute Write Index\006.js

  3. exception result Write().Response.Results[1].StatusCode = 'BadTypeMismatch (0x80740000)'; but StatusCode 'BadIndexRangeNoData (0x80370000)'

Additional Information

none

TagsNo tags attached.
Files Affected

maintree/Attribute Services/Attribute Write Index/Test Cases/006.js

Activities

Paul Hunkar

2022-04-11 15:14

administrator   ~0016568

verify that reading the byte array is handled correctly if a bytestring is sent as the response.
If this is correctly handled then no change is required

Yannik Klaass

2022-04-20 08:17

developer   ~0016596

The code was passing the DataType of the received value to generateArrayWriteValue(), which caused ByteArrays converted to a ByteString to be handled as a ByteString by this function.
Code has been updated to pass the DataType of the node instead of the DataType of the value.

Paul Hunkar

2022-09-29 15:58

administrator   ~0017899

reviewed issue, agreed to changes and closed issue

Issue History

Date Modified Username Field Change
2022-04-11 10:37 Florin Neamtu New Issue
2022-04-11 15:14 Paul Hunkar Note Added: 0016568
2022-04-11 15:15 Paul Hunkar Assigned To => Alexander Allmendinger
2022-04-11 15:15 Paul Hunkar Status new => assigned
2022-04-11 15:15 Alexander Allmendinger Assigned To Alexander Allmendinger => Yannik Klaass
2022-04-20 08:17 Yannik Klaass Status assigned => resolved
2022-04-20 08:17 Yannik Klaass Resolution open => fixed
2022-04-20 08:17 Yannik Klaass Note Added: 0016596
2022-08-02 20:23 Paul Hunkar Project Compliance Test Tool (CTT) Unified Architecture => CTT UA Scripts
2022-08-02 20:23 Paul Hunkar Project CTT UA Scripts => .NET API
2022-08-02 20:23 Paul Hunkar Category 1 - Script Issue => Api Change
2022-08-04 14:24 Paul Hunkar Project .NET API => Compliance Test Tool (CTT) Unified Architecture
2022-09-29 15:56 Paul Hunkar Project Compliance Test Tool (CTT) Unified Architecture => CTT UA Package
2022-09-29 15:56 Paul Hunkar Project CTT UA Package => CTT UA Scripts
2022-09-29 15:57 Paul Hunkar Category Api Change => 1 - Script Issue
2022-09-29 15:57 Paul Hunkar Files Affected => maintree/Attribute Services/Attribute Write Index/Test Cases/006.js
2022-09-29 15:58 Paul Hunkar Status resolved => closed
2022-09-29 15:58 Paul Hunkar Fixed in Version => 1.03.501
2022-09-29 15:58 Paul Hunkar Note Added: 0017899