Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
How to request for DiagnosticInfo in method call
February 17, 2020
13:22, EEST
Avatar
Thomas Reuther
Member
Members
Forum Posts: 26
Member Since:
September 18, 2017
sp_UserOfflineSmall Offline

Hello Support,

I use Tookit for Java ver. 3.2.0.

I am writing a client. I know that a particular server will return DiagnosticInfo when I request for it.

The methods UaClient.call(ObjectId, MethodId, Variant[]) and call(CallMethodRequest[]) do not provide a RequestHeader where I can specify a DiagnosticMask. Only the method serviceRequest(ServiceRequest) allows to specify a RequestHeader. The request header is the place to specify ReturnDiagnostics.

I can imagine that it is not the intention of the toolkit to fall back to the generic serviceRequest() method in case I ask for DiagnosticInfo. Is there a convenient method to get diagnostic info, or am I on the right track to use serviceRequest() in this case? I didn’t find a method or property at UaClient to specify RequestHeader or ReturnDiagnostics.

Thanks.

Thomas Reuther

February 17, 2020
15:01, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 523
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

That RequestHeader.returnDiagnostics is a bitmask, thus a pain to use/know what is correct UnsignedInteger. For that reason the UaClient has methods setOperationDiagnosticMask(EnumSet) and setServiceDiagnosticMask(EnumSet) and then we calc the mask value internally, that is why it cannot be directly set.

(That being said, I do not think this feature is used often, thus let us know if there are any problems)

Also the methods setTimeout and setAuditEntryId work on the same principle.

February 17, 2020
16:04, EEST
Avatar
Thomas Reuther
Member
Members
Forum Posts: 26
Member Since:
September 18, 2017
sp_UserOfflineSmall Offline

Oh thanks. It does exactly what I want. Now I set OperationDiagnosticMask just before calling call(). And I can use the convenience method call(ObjectId, MethodId, Variant[]) instead of serviceRequest() which makes the code complex and difficult to read.

Only the specification differs between “Operation Level” and “Service Level”. The operation levels (>=32) are not supported by your enum. But in my case it works.

Thank you very much! 🙂

February 18, 2020
12:12, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 31
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello

Actually, the tool supports operation levels in the DiagnosticMask enumeration, but this may not be immediately apparent. The OPC UA Specification 1.04 Part 4 Table 170 defines that returnDiagnostics is a bit mask where each value consists of a level and a type. There are two levels (ServiceLevel and OperationLevel) and five types (SymbolicId, LocalizedText, AdditionalInfo, InnerStatusCode and InnerDiagnostics). The name could possible be clearer, but DiagnosticMask enumeration does in fact represent these five types regardless of the level, not just for ServiceLevel. Although their numeric values have been chosen based on the values defined when used together with ServiceLevel, the values for OperationLevel are a result of shifting the bits to left five times, i.e. 1 becomes 32 when bit shifted to left five times, 2 becomes 64 and so on. So when you use UaClient.setOperationDiagnosticMask(EnumSet operationDiagnosticMask), the numeric values of the input EnumSet are bit shifted to the left five times to set the desired returnDiagnostics bit mask, which isn’t accessible to users via the UaClient class.

Or perhaps I have misunderstood what you meant with operation levels not being supported by our enumeration?

BR,

Matti

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
13 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 100

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 37

Rainer Versteeg: 32

Thomas Reuther: 26

Member Stats:

Guest Posters: 0

Members: 1058

Moderators: 14

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 981

Posts: 4145

Newest Members:

mats989, Sebastien Petitrenaud, sting2005, Ron Hoppe, Seb, p.devito, g.ilengo, MohamedLazrek, brittr83165991, martintinsley9

Moderators: Jouni Aro: 846, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 523, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 20, Markus Johansson: 18, Matti Siponen: 31, Lusetti: 0

Administrators: admin: 0