What is needed for writing a custom type?

Questions regarding the use of the UaExpert.

Moderator: uaexpert

Post Reply
em3702
Jr. Member
Jr. Member
Posts: 4
Joined: 09 Nov 2018, 11:59

What is needed for writing a custom type?

Post by em3702 »

This is a follow up post to my previous question What is needed for displaying a custom type?, setup is still the same.

While I'm now able to successfully read my type, I still cannot write it.

When I double-click the value in the UA Expert, an empty dialog pops up where I can not enter anything:
Image

I assume that something's still missing in my type definition.

The output of the UA Expert looks reasonable to me and shows no errors:

Code: Select all

07:48:51.643 | Server Node        | myserver OPC UA                | Connection status of server 'myserver OPC UA' changed to 'Disconnected'.
07:48:51.651 | Server Node        | myserver OPC UA                | Disconnect succeeded.
07:48:53.021 | Server Node        | myserver OPC UA                | Endpoint: 'opc.tcp://localhost:4840'
07:48:53.021 | Server Node        | myserver OPC UA                | Security policy: 'http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256'
07:48:53.021 | Server Node        | myserver OPC UA                | ApplicationUri: 'urn:localhost:myserver'
07:48:53.021 | Server Node        | myserver OPC UA                | Used UserTokenType: Anonymous
07:48:53.365 | AddressSpaceModel  | myserver OPC UA                | Register for ModelChangeEvents failed: createMonitoredItems returned BadFilterNotAllowed for item 0
07:48:53.367 | Server Node        | myserver OPC UA                | Connection status of server 'myserver OPC UA' changed to 'Connected'.
07:48:53.367 | Server Node        | myserver OPC UA                | Revised values: SessionTimeout=100000, SecureChannelLifetime=3600000
07:48:53.369 | AddressSpaceModel  | myserver OPC UA                | Browse on node 'i=84' succeeded.
07:48:53.371 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|35 succeeded
07:48:53.375 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|33 succeeded
07:48:53.378 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|31 succeeded
07:48:53.382 | AddressSpaceModel  | myserver OPC UA                | Browse on node 'i=85' succeeded.
07:48:53.386 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|58 succeeded
07:48:53.390 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|2004 succeeded
07:48:55.668 | AddressSpaceModel  | myserver OPC UA                | Browse on node 'ns=4;i=1' succeeded.
07:48:55.675 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS4|Numeric|300 succeeded
07:48:55.684 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|63 succeeded
07:48:55.693 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|62 succeeded
07:48:59.754 | Reference Plugin   | myserver OPC UA                | Browse succeeded.
07:48:59.759 | Attribute Plugin   | myserver OPC UA                | Read attributes of node 'NS4|Numeric|4' succeeded [ret = Good].
07:48:59.761 | TypeCache          | myserver OPC UA                | Reading type info of NodeId NS0|Numeric|40 succeeded
Can anybody provide me some hints where I need to touch in order to get writing working?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: What is needed for writing a custom type?

Post by Support Team »

Hello em3702,

please set the following trace settings in UaExpert:

Trace.SDKTraceEnabled: true
Trace.SDKTraceLevel: InterfaceCall

After that, connect to your server and check if there are any errors shown in the trace file set in Trace.Filename. If you cannot see any issues there, please send us a minimal sample server to support@unifiedautomation.com which we can use for reproducing the issue if this is possible.
Best regards
Unified Automation Support Team

em3702
Jr. Member
Jr. Member
Posts: 4
Joined: 09 Nov 2018, 11:59

Re: What is needed for writing a custom type?

Post by em3702 »

Turning the log level to InterfaceCall showed me nothing interesting but raising it to Data brings me some insights!

While I'm providing the DataTypeDefinition attribute (23), I don't deliver 24 through 27 (RolePermissions, UserRolePermissions, AccessRestrictions and AccessLevelEx) . Could this be the issue? If I'm not misunderstanding the spec, these should be optional?

Request:

Code: Select all

13:10:20.534Z|7|4678* Read 19 nodes
13:10:20.535Z|7|4678*   Node[0] NodeId=ns=4;i=4 AtrId=1
13:10:20.535Z|7|4678*   Node[1] NodeId=ns=4;i=4 AtrId=2
13:10:20.535Z|7|4678*   Node[2] NodeId=ns=4;i=4 AtrId=3
13:10:20.535Z|7|4678*   Node[3] NodeId=ns=4;i=4 AtrId=4
13:10:20.535Z|7|4678*   Node[4] NodeId=ns=4;i=4 AtrId=5
13:10:20.535Z|7|4678*   Node[5] NodeId=ns=4;i=4 AtrId=6
13:10:20.535Z|7|4678*   Node[6] NodeId=ns=4;i=4 AtrId=7
13:10:20.535Z|7|4678*   Node[7] NodeId=ns=4;i=4 AtrId=24
13:10:20.535Z|7|4678*   Node[8] NodeId=ns=4;i=4 AtrId=25
13:10:20.535Z|7|4678*   Node[9] NodeId=ns=4;i=4 AtrId=26
13:10:20.535Z|7|4678*   Node[10] NodeId=ns=4;i=4 AtrId=13
13:10:20.535Z|7|4678*   Node[11] NodeId=ns=4;i=4 AtrId=14
13:10:20.535Z|7|4678*   Node[12] NodeId=ns=4;i=4 AtrId=15
13:10:20.535Z|7|4678*   Node[13] NodeId=ns=4;i=4 AtrId=16
13:10:20.535Z|7|4678*   Node[14] NodeId=ns=4;i=4 AtrId=17
13:10:20.535Z|7|4678*   Node[15] NodeId=ns=4;i=4 AtrId=18
13:10:20.535Z|7|4678*   Node[16] NodeId=ns=4;i=4 AtrId=27
13:10:20.535Z|7|4678*   Node[17] NodeId=ns=4;i=4 AtrId=19
13:10:20.535Z|7|4678*   Node[18] NodeId=ns=4;i=4 AtrId=20
Response:

Code: Select all

13:10:20.537Z|7|4678* Read results for 19 nodes
13:10:20.537Z|7|4678*   Node[0] Value=4 Status=0x0
13:10:20.537Z|7|4678*   Node[1] Value=2 Status=0x0
13:10:20.537Z|7|4678*   Node[2] Value=SampleTypeVar Status=0x0
13:10:20.537Z|7|4678*   Node[3] Value=SampleType Variable Status=0x0
13:10:20.537Z|7|4678*   Node[4] Value=A variable using the SampleDataType Status=0x0
13:10:20.537Z|7|4678*   Node[5] Value=0 Status=0x0
13:10:20.537Z|7|4678*   Node[6] Value=0 Status=0x0
13:10:20.537Z|7|4678*   Node[7] Failed StatusCode=0x80350000
13:10:20.537Z|7|4678*   Node[8] Failed StatusCode=0x80350000
13:10:20.537Z|7|4678*   Node[9] Failed StatusCode=0x80350000
13:10:20.537Z|7|4678*   Node[10] Value=Type cannot be displayed Status=0x0
13:10:20.537Z|7|4678*   Node[11] Value=30 Status=0x0
13:10:20.537Z|7|4678*   Node[12] Value=-1 Status=0x0
13:10:20.537Z|7|4678*   Node[13] Failed StatusCode=0x80350000
13:10:20.537Z|7|4678*   Node[14] Value=3 Status=0x0
13:10:20.537Z|7|4678*   Node[15] Value=3 Status=0x0
13:10:20.537Z|7|4678*   Node[16] Failed StatusCode=0x80350000
13:10:20.537Z|7|4678*   Node[17] Value=50 Status=0x0
13:10:20.537Z|7|4678*   Node[18] Value=false Status=0x0

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: What is needed for writing a custom type?

Post by Support Team »

Hello em3702,

for displaying and editing custom structured types it doesn't matter if attributes 25 through 27 are set or not.
Best regards
Unified Automation Support Team

Post Reply