Can ANSI C stack communicate to .NET/Java stack?|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Can ANSI C stack communicate to .NET/Java stack?
Avatar
Jiyang Hu
Member
Members
Forum Posts: 10
Member Since:
06/10/2014
sp_UserOfflineSmall Offline
1
06/19/2017 - 14:48
sp_Permalink sp_Print

UA has 3 stacks, and my question is if they can interchange each other. ANSI C is used in embedded device, .NET/Java stack could be used in edge gateway or cloud. How can they communicate each other since each data type is so different?

Avatar
Guest
Guests
2
06/20/2017 - 22:42
sp_Permalink sp_Print

Short answer - yes they can interoperate.

The OPC UA standard does not specify an API - it specifies the wire protocol.

The language of a stack implementation is therefore irrelevant - every stack has to provide an encoder/decoder for the wire protocol. The Client/Server API is language-specific.

Avatar
Jiyang Hu
Member
Members
Forum Posts: 10
Member Since:
06/10/2014
sp_UserOfflineSmall Offline
3
06/23/2017 - 15:35
sp_Permalink sp_Print

Service implementation is so different in different stacks, and I don't see any code doing type conversion before/after wire transportation. How can the same service (beginBrowse) be interoperable?

ANSI C stack:

OpcUa_StatusCode OpcUa_Server_BeginBrowse(
    OpcUa_Endpoint        a_hEndpoint,
    OpcUa_Handle          a_hContext,
    OpcUa_Void**          a_ppRequest,
    OpcUa_EncodeableType* a_pRequestType);

.NET stack:

 public virtual IAsyncResult BeginBrowse(BrowseMessage message, AsyncCallback callback, object callbackData)

Back to OPC Classic, there is an equivalent RCW for .NET stack so there is no issue a COM and .NET server implementation can be interoperable. Confused with UA stacks.

Avatar
Paul Hunkar
Cleveland, Ohio, USA
Moderator
Members

Moderators-Specifications

Moderators-Companion

Moderators-Implementation

Moderators-Certification

Moderators-COM
Forum Posts: 109
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
4
06/28/2017 - 11:59
sp_Permalink sp_Print

They are 100% compatible for all datatypes supported on a platform.  OPC Foundation provides certification and compliance test that verifies clients and servers.  the lab has Java, C++, .NET based products that are used to check interoperability.

For many items no conversion is needed (integers for example) since all of the platforms have the same representation.  If you look deep enough you can follow how each stack encodes the data on the wire, this encoded form is the same in all cases.  It makes use of standard data types.  The api's are different mostly do to what information in provided on the call verse obtained from built in structures/class/objects.  the other big difference is how the API deals with what is sent back. For some API's the data is returned, in others a function is provided that is call with the return data.  In all cases what is on the wire is identical.  

For the examples you listed:  ANSI C does not have objects or exceptions - so the call returns a status and a pointer to the returned values, while the .net API does not return a status (it will throw an exception is an error occurs), and it returns objects which encapsulate the data.  the Object are much easier to work with, but also make for larger applications.  it is up to the developer to decide which platform is best for them, but the wire protocol is the same in all cases and is tested to ensure that it is.

Paul

 

Paul Hunkar 

Director of Compliance and Certification

OPC Foundation

Paul Hunkar - DSInteroperability

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 15
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1351
Posts: 4579