Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent data type for AccessRestrictions #2870

Open
1 of 5 tasks
lupokk opened this issue Nov 30, 2024 · 2 comments · Fixed by #2883
Open
1 of 5 tasks

Inconsistent data type for AccessRestrictions #2870

lupokk opened this issue Nov 30, 2024 · 2 comments · Fixed by #2883
Assignees
Labels
bug A bug was identified and should be fixed.

Comments

@lupokk
Copy link

lupokk commented Nov 30, 2024

Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

If AccessRestrictions is set to any value, an inconsistent data type error is encountered when reading with an opcua client: "Invalid Datatype: Expected OpcUaType_UInt16, Received OpcUaType_Int32"

image

Expected Behavior

The data type expressing AccessRestrictions should be UInt16

Steps To Reproduce

AccessRestrictions = AccessRestrictionType.None

Environment

- OS:Windows 11
- Environment:Visual Studio 2022
- Runtime: net8
- Nuget Version: 1.5.374.126
- Component:Opc.Ua.Core
- Server:Reference Server
- Client: UA Expert

Anything else?

No response

@romanett
Copy link
Contributor

romanett commented Dec 3, 2024

@lupokk I can reproduce this issue however I am not shure yet why it occurs, AccessRestrictions support was added here: b8d911c

and all Datatypes are UInt16 / Ushort.

I will continue to investigate

Even in the genertated code Opc.Ua.Datatypes (line 2527) this seems to be correct:

        encoder.WriteUInt16("AccessRestrictions", AccessRestrictions);

@romanett romanett self-assigned this Dec 3, 2024
@romanett romanett added the bug A bug was identified and should be fixed. label Dec 4, 2024
@lupokk
Copy link
Author

lupokk commented Dec 5, 2024

@romanett thanks for the quick resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug was identified and should be fixed.
Projects
None yet
3 participants