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, 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: 982
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: 319
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: 518

Currently Online:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

ibrahim: 75

rocket science: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 708

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1465

Posts: 6252

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 982, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 319, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1