06/29/2023
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
05/30/2017
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.
1 Guest(s)