.NET API OPC DA Client sometimes fails to Read() and GetProperties()|Classic OPC: DA, A&E, HDA, XML-DA, etc.|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
.NET API OPC DA Client sometimes fails to Read() and GetProperties()
Avatar
Siyuan Xu
Member
Members
Forum Posts: 8
Member Since:
06/29/2023
sp_UserOfflineSmall Offline
1
06/27/2024 - 04:04
sp_Permalink sp_Print

Hello, I recently started to implement an OPC Classic DA client using NET API. However, some items/nodes cannot be successfully Read() or GetProperties(). However other client can read the same items/nodes successfully, such as Softing ToolBox OPC Classic client. I printed out some debug logs:

Failed Read() and GetProperties(), I understand, when the flag BrowseElement.IsItem is False, Read() won't work. But even some of the properties were failed to read: Property.Value, Quality and Timestamp.

--Item Name: \\SESSION\APL_NR
--Item Path:
--Is Item: False
--Has Children: False
--Properties: Opc.Da.ItemProperty[]
|ID |Value |DataType |Description |Result
dataType (1): System.Int32: System.Int16: Item Canonical DataType: S_OK
value (2): : System.Int32: Item Value: E_UNKNOWN_ITEM_NAME
quality (3): : System.Int16: Item Quality: E_UNKNOWN_ITEM_NAME
timestamp (4): : System.DateTime: Item Timestamp: E_UNKNOWN_ITEM_NAME
accessRights (5): readable: System.Int32: Item Access Rights: S_OK
scanRate (6): 0: System.Single: Server Scan Rate: S_OK

This Node can be browsed and read correctly.
--Item Name: \\APL\1\P\AUTOMATIONADAPTER\1
--Item Path:
--Is Item: True
--Has Children: False
--Properties: Opc.Da.ItemProperty[]
|ID |Value |DataType |Description |Result
dataType (1): System.Int32: System.Int16: Item Canonical DataType: S_OK
value (2): 1: System.Int32: Item Value: S_OK
quality (3): good: System.Int16: Item Quality: S_OK
timestamp (4): 27/06/2024 12.54.10: System.DateTime: Item Timestamp: S_OK
accessRights (5): readWritable: System.Int32: Item Access Rights: S_OK
scanRate (6): 0: System.Single: Server Scan Rate: S_OK
5001: 0: System.Int32: AA Action Activation: S_OK
5002: 0: System.Int32: AB Alarm Blocking: S_OK
5003: 0: System.Int32: AC Alarm Class: S_OK
5004: 0: System.Int32: AD Alarm Delay: S_OK
5005: 0: System.Int32: AE Action Enabled: S_OK
5006: 0: System.Int32: AF Action at First Update: S_OK
5007: 1: System.Int32: AG Alarm Generation: S_OK
ItemName: \\APL\1\P\AUTOMATIONADAPTER\1 Value: 1  Timestamp:27/06/2024 12.54.10 DataType: System.Int32

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
06/27/2024 - 19:27
sp_Permalink sp_Print sp_EditHistory

According to the debugging info \\SESSION\APL_NR is a branch and not an item so it can't be read because Is Item: False

You need to look at the code that is setting that value and figure out what is is going on.

It is possible the .NET API is being strict about the spec where other clients always treats branches as if they are items.

It is also possible the .NET API is using DA3 but the the other clients are using DA2.05 and the server has differences in behavoir.

Avatar
Siyuan Xu
Member
Members
Forum Posts: 8
Member Since:
06/29/2023
sp_UserOfflineSmall Offline
3
07/01/2024 - 03:56
sp_Permalink sp_Print

Thanks Randy for quick reply and your expert insights. The server is implemented as DA2.05, and was correctly reported by NET API, Sample client and Softing Client. I will investigating how the server construct objects under \\SESSION. 

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 31
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855