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: 1027
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: 346
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:
50 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 739

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6453

Newest Members:

shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1027, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1