Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
How to request for DiagnosticInfo in method call
February 17, 2020
13:22, EET
Avatar
Thomas Reuther
Member
Members
Forum Posts: 33
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, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1045
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, EET
Avatar
Thomas Reuther
Member
Members
Forum Posts: 33
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, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 353
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: 1919
Currently Online:
Guest(s) 19
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 733
Moderators: 8
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1545
Posts: 6516
Newest Members:
basilpullman, Richardmip, mood edibles, LouieWreve, daniellabdx, janessan21, sammiebeak359, gena7127517, thorstenbouldin, Brett.Rollason
Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 1, Bjarne Boström: 1045, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0
Administrators: admin: 1