ANSI C Based OPC UA Client/Server/PubSub SDK  1.9.1.442
UaBaseModule

Functions

OpcUa_Void OpcUa_ProxyStubConfiguration_InitializeDefault (OpcUa_ProxyStubConfiguration *a_pProxyStubConfiguration)
 Initialize UA stack configuration structure with default values. More...
 
OpcUa_StatusCode UaBase_Module_InitializeUaStack (OpcUa_Handle *a_phProxyStubPlatformLayer, OpcUa_ProxyStubConfiguration *a_pProxyStubConfiguration)
 Initialize UA stack. More...
 
OpcUa_StatusCode UaBase_Module_ClearUaStack (OpcUa_Handle *a_phProxyStubPlatformLayer)
 Clear UA stack. More...
 
OpcUa_StatusCode UaBase_DoCom ()
 The internal main 'event loop' which processes messages, triggers timers and handles sessions and subscriptions. More...
 
OpcUa_StatusCode UaBase_TimedDoCom (OpcUa_UInt32 a_uTimeout)
 The internal main 'event loop' which processes messages, triggers timers and handles sessions and subscriptions. More...
 
OpcUa_StatusCode UaBase_RegisterComFunction (UaBase_ComFunction a_pFunction)
 Used internally by the SDK to register functions that have to be called cyclically. More...
 
OpcUa_StatusCode UaBase_UnregisterComFunction (UaBase_ComFunction a_pFunction)
 Used internally by the SDK to unregister functions that have to be called cyclically. More...
 
OpcUa_StatusCode UaBase_InterruptCom ()
 Force the SDK thread to stop waiting for its select() call to return. More...
 

Detailed Description

Function Documentation

OpcUa_Void OpcUa_ProxyStubConfiguration_InitializeDefault ( OpcUa_ProxyStubConfiguration *  a_pProxyStubConfiguration)

Initialize UA stack configuration structure with default values.

The configuration structure is used to initialize the UA Stack. The default values are set by the stack configuration e.g. in the stack file opcua_config.h

The structure contains the following settings:

Trace settings
bProxyStub_Trace_Enabled - Flag that indicates if the stack trace is activated. This requires that the traces are not disabled with the stack compiler switch. The trace is also used by the Server SDK
uProxyStub_Trace_Level - Tracelevel used if trace is activated. Possible settings are

  • OPCUA_TRACE_OUTPUT_LEVEL_ERROR
  • OPCUA_TRACE_OUTPUT_LEVEL_WARNING
  • OPCUA_TRACE_OUTPUT_LEVEL_SYSTEM
  • OPCUA_TRACE_OUTPUT_LEVEL_INFO
  • OPCUA_TRACE_OUTPUT_LEVEL_DEBUG
  • OPCUA_TRACE_OUTPUT_LEVEL_CONTENT
  • OPCUA_TRACE_OUTPUT_LEVEL_ALL

Serializer settings
This part of the configuration defines the OPC UA Stack serializer settings. These are the security constraints for the serializer. The settings are also relevant for the resource consuption of the UA stack. Set this values carefully.

  • iSerializer_MaxAlloc - The largest size for a memory block the serializer can do when deserializing a message
  • iSerializer_MaxStringLength - The largest string accepted by the serializer
  • iSerializer_MaxByteStringLength - The largest byte string accepted by the serializer
  • iSerializer_MaxArrayLength - Maximum number of elements in an array accepted by the serializer
  • iSerializer_MaxMessageSize - The maximum number of bytes per message in total

The other settings should not be changed since they are set by the SDK and changing them will cause undefined behaviour.

Parameters
a_pProxyStubConfigurationConfiguration structure for the UA Stack.
OpcUa_StatusCode UaBase_DoCom ( )

The internal main 'event loop' which processes messages, triggers timers and handles sessions and subscriptions.

Returns
OpcUa_Good if no error occured. OpcUa_BadShutdown if the application shall shut down. OpcUa_BadContinue if the application shall restart.
OpcUa_StatusCode UaBase_InterruptCom ( )

Force the SDK thread to stop waiting for its select() call to return.

If asynchronous SDK calls like BeginRead are handled in a separate thread by the provider, this thread might want to force the SDK to handle the response when finished. This function can be called to let the select() call of the SDK thread return immediately in order to process the service call result prepared by the worker thread. Otherwise there might be a delay of at max the timeout passed to UaBase_TimedDoCom (or 10ms if UaBase_DoCom is used).

OpcUa_StatusCode UaBase_Module_ClearUaStack ( OpcUa_Handle *  a_phProxyStubPlatformLayer)

Clear UA stack.

If this function was called, no UA stack functionality can be used any more.

Parameters
a_phProxyStubPlatformLayerUA Stack platform layer handle.
Returns
OPC UA Status code.
OpcUa_StatusCode UaBase_Module_InitializeUaStack ( OpcUa_Handle *  a_phProxyStubPlatformLayer,
OpcUa_ProxyStubConfiguration *  a_pProxyStubConfiguration 
)

Initialize UA stack.

This function must be called before any UA stack functionality is used.

Parameters
a_phProxyStubPlatformLayerUA Stack platfrom layer handle.
a_pProxyStubConfigurationConfiguration structure for the UA Stack.
Returns
OPC UA Status code.
OpcUa_StatusCode UaBase_RegisterComFunction ( UaBase_ComFunction  a_pFunction)

Used internally by the SDK to register functions that have to be called cyclically.

Do not use!

OpcUa_StatusCode UaBase_TimedDoCom ( OpcUa_UInt32  a_uTimeout)

The internal main 'event loop' which processes messages, triggers timers and handles sessions and subscriptions.

Parameters
a_uTimeoutThe timeout to use for the internal select() call.
Returns
OpcUa_Good if no error occured. OpcUa_BadShutdown if the application shall shut down. OpcUa_BadContinue if the application shall restart.
OpcUa_StatusCode UaBase_UnregisterComFunction ( UaBase_ComFunction  a_pFunction)

Used internally by the SDK to unregister functions that have to be called cyclically.

Do not use!