Tani OpcPipe protocol  1.0.5
Tani OpcPipe protocol
Macros | Functions
API Functions of OpcPipe Toolkit.

Macros

#define WmkProtDisableUpdate()   WmkProtDisableUpdate__("", 0)
 
#define WmkProtRestoreUpdate()   WmkProtRestoreUpdate__("", 0)
 

Functions

EXTERN_C int WENTRY_C OpcPipeExit (void)
 
EXTERN_C int WENTRY_C OpcPipeQueryVersion (W_UINT32 *version)
 retrieves OpcPipe library version. More...
 
EXTERN_C int WENTRY_C OpcPipeQueryLoadPath (char *path, int len)
 retrieves OpcPipe library load path. More...
 
EXTERN_C int WENTRY_C OpcPipeDebugSetShareHandle (void *givenShare)
 Tani internal debug only!
 
EXTERN_C int WENTRY_C WmkProtBasePresetInit (CORE_PRESET_VALUES *preset)
 
EXTERN_C int WENTRY_C WmkProtServerInit (PLC_OPCPIPE_CONFIRMS *confirm)
 
EXTERN_C int WENTRY_C WmkProtServerInitEx (PLC_OPCPIPE_CONFIRMS_EX *confirm)
 
EXTERN_C int WENTRY_C WmkProtClientInit (PLC_OPCPIPE_CONFIRMS *confirm)
 
EXTERN_C int WENTRY_C WmkProtClientInitEx (PLC_OPCPIPE_CONFIRMS_EX *confirm)
 
EXTERN_C int WENTRY_C WmkProtServerTerminate (void)
 
EXTERN_C int WENTRY_C WmkProtClientTerminate (void)
 
EXTERN_C int WENTRY_C WmkProtClientValidateLibVersions (void)
 
EXTERN_C int WENTRY_C WmkProtServerValidateLibVersions (void)
 
EXTERN_C int WENTRY_C WmkProtConnStatus (OPCPIPE_STATUS *status)
 Checks the actual status of the OPCpipe connection. The element Handle need to be initialized with the net handle before call. More...
 
EXTERN_C int WENTRY_C WmkProtChangeConnStatus (OPCPIPE_STATUS *status)
 Changes properties of the OPCpipe connection. The element Handle need to be initialized with the net handle before call. Flags and FlagsMask are set according to the properties to be changed. More...
 
EXTERN_C int WENTRY_C WmkProtServerStopConnection (W_UINT32 handle, int disableConfirms)
 Stops one server connection. There is no housekeeping on this function, only the connection is closed and internal memory is freed. More...
 
EXTERN_C int WENTRY_C WmkProtClientStopConnection (W_UINT32 handle, int disableConfirms)
 Stops one client connection. There is no housekeeping on this function, only the connection is closed and internal memory is freed. More...
 
EXTERN_C int WENTRY_C WmkProtWaitConfirm (W_UINT32 handle, WMK_CONFIRM confirm)
 Registers the wait ready confirm. The confirm will be called each time the OPCpipe connection changes from the wait state to the normal state. This happens if a call returns with TU_STATUS_WAIT and now the next call can be made. More...
 
EXTERN_C int WENTRY_C WmkProtClientSetConnectionName (W_UINT32 handle, const char *connectionName)
 sets the connection name, used to separate structure names for different connections.
 
EXTERN_C int WENTRY_C WmkProtElementCount (W_UINT16 type, W_UINT16 typeFlags, W_UINT32 datalen, const void *data, W_UINT32 *retBytes)
 Brings the length in bytes of the requested element type, flags and len.
 
EXTERN_C int WENTRY_C WmkProtByteLen (W_UINT16 type, W_UINT32 elements, W_UINT32 *retBytes)
 calculates the memory length of an array of simple variables
 
EXTERN_C int WENTRY_C WmkProtStringArraySize (W_UINT16 typeFlags, W_UINT32 datalen, const void *data, W_UINT32 *ret)
 calculates the length of a string array
 
EXTERN_C int WENTRY_C WmkProtMultilangStringArraySize (W_UINT16 typeFlags, W_UINT32 datalen, const void *data, W_UINT32 *ret)
 
EXTERN_C int WENTRY_C WmkProtDataConvert (void *memdest, const void *memsrc, W_UINT16 type_dest, W_UINT16 typ_dest_flags, W_UINT16 type_src, W_UINT16 typ_src_flags, W_UINT32 inbytes, W_UINT32 maxmem, W_UINT32 *retbytes, DATA_CONVERT_INFO *info)
 Convers binary data between different data formats. More...
 
EXTERN_C int WENTRY_C WmkProtTimings (PLC_OPCPIPE_TIMINGS *timings, int func)
 Handling of internal timings like life data ack send rate and check rate, and reset of connections. More...
 
EXTERN_C int WENTRY_C WmkProtCreateItem (W_UINT32 handle, W_UINT32 itemsCount, WMK_PROT_CREATE_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtCreateItemEx (W_UINT32 handle, W_UINT32 itemsCount, WMK_PROT_CREATE_ITEM_DATA_EX *items)
 
EXTERN_C int WENTRY_C WmkProtDeleteItem (W_UINT32 handle, W_UINT32 itemsCount, WMK_PROT_HANDLE_ITEM_DATA *pipeItemHandles)
 
EXTERN_C int WENTRY_C WmkProtActivateItem (W_UINT32 handle, W_UINT32 itemsCount, WMK_PROT_HANDLE_ITEM_DATA *pipeItemHandles)
 
EXTERN_C int WENTRY_C WmkProtDeactivateItem (W_UINT32 handle, W_UINT32 itemsCount, WMK_PROT_HANDLE_ITEM_DATA *pipeItemHandles)
 
EXTERN_C int WENTRY_C WmkProtRefreshItem (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle, W_UINT32 itemsCount, WMK_PROT_RW_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtSyncReadItem (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle, W_UINT32 itemsCount, WMK_PROT_RW_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtHistoryReadItem (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle, WMK_PROT_HISTORY_ITEM_DATA *item)
 
EXTERN_C int WENTRY_C WmkProtHistoryReadEvent (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle, WMK_PROT_HISTORY_EVENT_DATA *event)
 
EXTERN_C int WENTRY_C WmkProtStopSyncReadItem (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle)
 
EXTERN_C int WENTRY_C WmkProtWriteItem (W_UINT32 handle, WMK_OPCPIPE_HANDLE writeHandle, W_UINT32 itemsCount, WMK_PROT_RW_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtStopWriteItem (W_UINT32 handle, WMK_OPCPIPE_HANDLE writeHandle)
 
EXTERN_C int WENTRY_C WmkProtQueryItemInformation (W_UINT32 handle, WMK_OPCPIPE_HANDLE pipeItemHandle, WMK_OPCPIPE_ITEM_INFO *itemInfo)
 
EXTERN_C int WENTRY_C WmkProtBrowse (W_UINT32 handle, WMK_OPCPIPE_HANDLE browseHandle, W_UINT32 browseOpcode, W_UINT32 startOffset, const char *path, OPCPIPE_BROWSE_REQUEST_PARAMS *browseParams, W_UINT16 typ, W_UINT8 browseFlags)
 
EXTERN_C int WENTRY_C WmkProtStopBrowse (W_UINT32 handle, WMK_OPCPIPE_HANDLE browseHandle, W_UINT32 browseOpcode)
 
EXTERN_C int WENTRY_C WmkProtRpcCall (W_UINT32 handle, W_UINT32 callHandle, W_UINT32 rpcId, const char *name, W_UINT32 paramCount, RPC_PARAMETER *params)
 
EXTERN_C int WENTRY_C WmkProtMonitorEvents (W_UINT32 handle, W_UINT32 eventCount, EVENT_REQUEST *events)
 
EXTERN_C int WENTRY_C WmkProtModifyMonitorEvents (W_UINT32 handle, W_UINT32 eventCount, EVENT_REQUEST *events)
 
EXTERN_C int WENTRY_C WmkProtDeleteEvents (W_UINT32 handle, W_UINT32 eventCount, W_UINT32 *eventHandles)
 
EXTERN_C int WENTRY_C WmkProtDiagnostics (W_UINT32 handle, WMK_OPCPIPE_HANDLE diagHandle, WMK_OPCPIPE_HANDLE *pipeTopicHandle, W_UINT32 no)
 
EXTERN_C int WENTRY_C WmkProtDiagTopicName (W_UINT32 handle, WMK_OPCPIPE_HANDLE pipeTopicHandle, char *topicName, W_UINT16 namelen)
 This enables querying the topic name from the return values of the diagnostics calls. More...
 
EXTERN_C int WENTRY_C WmkProtDiagItemName (W_UINT32 handle, WMK_OPCPIPE_HANDLE pipeItemHandle, char *itemName, W_UINT16 namelen)
 This enables querying the item name from the return values of the diagnostics calls. More...
 
EXTERN_C int WENTRY_C WmkProtCreateItemData (W_UINT32 handle, int createErr, W_UINT32 itemsCount, WMK_PROT_CREATE_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtCyclicReadData (W_UINT32 handle, WMK_OPCPIPE_HANDLE ackHandle, W_UINT32 itemsCount, WMK_PROT_RW_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtSyncReadData (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle, WMK_OPCPIPE_HANDLE ackHandle, W_UINT32 itemsCount, WMK_PROT_RW_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtHistoryReadData (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle, WMK_PROT_HISTORY_ITEM_DATA *item)
 
EXTERN_C int WENTRY_C WmkProtEventHistoryReadData (W_UINT32 handle, WMK_OPCPIPE_HANDLE readHandle, WMK_PROT_HISTORY_EVENT_DATA *event)
 
EXTERN_C int WENTRY_C WmkProtWriteComplete (W_UINT32 handle, WMK_OPCPIPE_HANDLE writeHandle, W_UINT32 itemsCount, WMK_PROT_RW_ITEM_DATA *items)
 
EXTERN_C int WENTRY_C WmkProtBrowseItemData (W_UINT32 handle, WMK_OPCPIPE_HANDLE browseHandle, W_UINT32 dataLen, PLC_OPCPIPE_BROWSEITEMDATA *data, WMK_PTR_CONFIRM confirm)
 
EXTERN_C int WENTRY_C WmkProtRpcData (W_UINT32 handle, W_UINT32 callHandle, W_UINT32 errorCode, W_UINT32 resultCount, RPC_PARAMETER *results)
 
EXTERN_C int WENTRY_C WmkProtSetSecurity (W_UINT32 handle, WMK_OPCPIPE_HANDLE pipeTopicHandle, ACCESS_VALUES *access)
 Set access rights per topic. More...
 
EXTERN_C int WENTRY_C WmkProtEventData (W_UINT32 handle, EVENT_RESULT *event)
 
EXTERN_C int WENTRY_C WmkProtSymbolsChanged (W_UINT32 handle, const char *browsePath)
 
EXTERN_C int WENTRY_C WmkProtGetAppData (W_UINT32 handle, WMK_OPCPIPE_HANDLE pipeTopicHandle, void **appTopicData, WMK_OPCPIPE_HANDLE pipeItemHandle, void **appItemData)
 
EXTERN_C int WENTRY_C WmkProtSetAppData (W_UINT32 handle, WMK_OPCPIPE_HANDLE pipeTopicHandle, void *appTopicData, WMK_OPCPIPE_HANDLE pipeItemHandle, void *appItemData)
 Set application specific pointers. More...
 
EXTERN_C int WENTRY_C WmkProtFindTopicByName (W_UINT32 handle, const char *topicName, W_UINT32 *appTopicHandle, W_UINT32 *pipeTopicHandle)
 
EXTERN_C int WENTRY_C WmkProtFindItemByName (W_UINT32 handle, WMK_OPCPIPE_HANDLE pipeTopicHandle, const char *itemName, W_UINT32 *appItemHandle, W_UINT32 *pipeItemHandle)
 
EXTERN_C int WENTRY_C WmkProtTopicList (W_UINT32 handle, W_UINT32 *tablen, OPCPIPE_TOPIC **table)
 
EXTERN_C int WENTRY_C WmkProtItemList (W_UINT32 handle, W_UINT32 *tablen, OPCPIPE_ITEM **table)
 
EXTERN_C int WENTRY_C WmkProtHandleFromPointer (W_UINT32 handle, OPCPIPE_TOPIC *topic, OPCPIPE_ITEM *item, WMK_OPCPIPE_HANDLE *retHandle)
 
EXTERN_C int WENTRY_C WmkProtIndexFromHandle (W_UINT32 handle, WMK_OPCPIPE_HANDLE topicOrItemHandle, W_UINT32 *retIndex)
 
EXTERN_C int WENTRY_C WmkProtTopicHandleFromItemHandle (W_UINT32 handle, WMK_OPCPIPE_HANDLE itemHandle, WMK_OPCPIPE_HANDLE *retHandle)
 
EXTERN_C int WENTRY_C WmkProtDisableUpdate__ (const char *file, int line)
 
EXTERN_C int WENTRY_C WmkProtRestoreUpdate__ (const char *file, int line)
 
EXTERN_C int WENTRY_C WmkProtIsUpdateDisabled (int byThisThread)
 used for debug only
 
EXTERN_C int WENTRY_C WmkProtReadDebugBuffer (char *buffer, W_UINT32 buflen)
 query internal debug buffer More...
 
EXTERN_C int WENTRY_C WmkProtGetCapabilities (W_UINT32 handle, W_UINT64 *capabilities)
 Queries the connection capabilities. This may be used for checking functionality or requested things in the partner or local configuration. More...
 
EXTERN_C int WENTRY_C WmkProtServerDiagnostics (W_UINT32 handle, PLC_OPCPIPE_DIAG_REQUEST *request, PLC_OPCPIPE_DIAG_RESPONSE *response, W_UINT32 responseMemlen)
 query extended server diagnostics More...
 
EXTERN_C int WENTRY_C WmkProtRegisterServer (W_UINT32 handle, W_UINT16 port, int isOnline)
 registers an opc ua server with a discovery server More...
 

Detailed Description

Function Documentation

◆ OpcPipeExit()

EXTERN_C int WENTRY_C OpcPipeExit ( void  )

unloads the library from memory

Note
This function is NOT reentrant or thread-safe.

◆ OpcPipeQueryLoadPath()

EXTERN_C int WENTRY_C OpcPipeQueryLoadPath ( char *  path,
int  len 
)

retrieves OpcPipe library load path.

Returns
error values
Parameters
[out]paththe path is stored here
[in]lenlength of path

◆ OpcPipeQueryVersion()

EXTERN_C int WENTRY_C OpcPipeQueryVersion ( W_UINT32 *  version)

retrieves OpcPipe library version.

Returns
error values
Parameters
[out]versionpointer to the version

◆ WmkProtActivateItem()

EXTERN_C int WENTRY_C WmkProtActivateItem ( W_UINT32  handle,
W_UINT32  itemsCount,
WMK_PROT_HANDLE_ITEM_DATA pipeItemHandles 
)

Activates an item. After activation the server side may respond with data.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvActivateItem.

Returns
error values
Parameters
[in]handleclient connection handle
[in]itemsCountnumber of items to activate
[in]pipeItemHandlesitems to activate

◆ WmkProtBasePresetInit()

EXTERN_C int WENTRY_C WmkProtBasePresetInit ( CORE_PRESET_VALUES preset)

Initializing the server functionality of the transport.

Returns
error values
Note
This function is NOT reentrant or thread-safe.
Parameters
[in]presetStructure with initialized preset values

◆ WmkProtBrowse()

EXTERN_C int WENTRY_C WmkProtBrowse ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  browseHandle,
W_UINT32  browseOpcode,
W_UINT32  startOffset,
const char *  path,
OPCPIPE_BROWSE_REQUEST_PARAMS browseParams,
W_UINT16  typ,
W_UINT8  browseFlags 
)

Starts a browsing operation.

The data is returned with PLC_OPCPIPE_CONFIRMS::confirmCliBrowseData.

Returns
error values
Parameters
[in]handleclient connection handle
[in]browseHandlereference browse handle for this browse operation
[in]browseOpcodeBrowse opcodes
[in]startOffsetstart offset for browsing request if not all data can be returned in one response
[in]pathbrowsing path. Can be 0 for root list
[in]browseParamsadditional browse parameters.
[in]typreturn elements with this type. 0 returns all
[in]browseFlagsreturn only elements with this browse flags set (values for PLC_OPCPIPE_BROWSEITEMDATA::Flags, bitcoded). Can be 0 for all items.

◆ WmkProtBrowseItemData()

EXTERN_C int WENTRY_C WmkProtBrowseItemData ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  browseHandle,
W_UINT32  dataLen,
PLC_OPCPIPE_BROWSEITEMDATA data,
WMK_PTR_CONFIRM  confirm 
)

Asynchronously returns item browse data.

On the client side this will call PLC_OPCPIPE_CONFIRMS::confirmCliBrowseItemData.

Returns
error values
Parameters
[in]handleserver connection handle
[in]browseHandlereference browse handle for this browse operation
[in]dataLenlength of browse data in bytes
[in]databrowse data
[in]confirmfunction to be called if data is no longer needed

◆ WmkProtChangeConnStatus()

EXTERN_C int WENTRY_C WmkProtChangeConnStatus ( OPCPIPE_STATUS status)

Changes properties of the OPCpipe connection. The element Handle need to be initialized with the net handle before call. Flags and FlagsMask are set according to the properties to be changed.

Parameters
[in,out]statusstruct for changing status information

◆ WmkProtClientInit()

EXTERN_C int WENTRY_C WmkProtClientInit ( PLC_OPCPIPE_CONFIRMS confirm)

Inizialising the client of the transport.

Returns
error values
Note
This function is NOT reentrant or thread-safe.
Parameters
[in]confirmStructure with initialized confirm functions

◆ WmkProtClientInitEx()

EXTERN_C int WENTRY_C WmkProtClientInitEx ( PLC_OPCPIPE_CONFIRMS_EX confirm)

Inizialising the client of the transport.

Returns
error values
Note
This function is NOT reentrant or thread-safe.
Parameters
[in]confirmStructure with initialized confirm functions

◆ WmkProtClientStopConnection()

EXTERN_C int WENTRY_C WmkProtClientStopConnection ( W_UINT32  handle,
int  disableConfirms 
)

Stops one client connection. There is no housekeeping on this function, only the connection is closed and internal memory is freed.

Returns
error values
Parameters
[in]handleconnection handle
[in]disableConfirmsif true, no more confirms will arrive after this function returns

◆ WmkProtClientTerminate()

EXTERN_C int WENTRY_C WmkProtClientTerminate ( void  )

Terminates the complete opcpipe client calls. This function does no house keeping, only connections are closed and internal memory is freed. No confirm will come after calling this.

Returns
error values
Note
This function is NOT reentrant or thread-safe.

◆ WmkProtConnStatus()

EXTERN_C int WENTRY_C WmkProtConnStatus ( OPCPIPE_STATUS status)

Checks the actual status of the OPCpipe connection. The element Handle need to be initialized with the net handle before call.

Returns
error values
Parameters
[in,out]statusstruct for requesting status information

◆ WmkProtCreateItem()

EXTERN_C int WENTRY_C WmkProtCreateItem ( W_UINT32  handle,
W_UINT32  itemsCount,
WMK_PROT_CREATE_ITEM_DATA items 
)

Creates an item. The item is created under a given topic. Items are created in inactive state, activate them with WmkProtActivateItem.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvCreateItem. The server result is asynchronously returned via PLC_OPCPIPE_CONFIRMS::confirmCliCreateItem.

Returns
error values
Parameters
[in]handleclient connection handle
[in]itemsCountnumber of items to create
[in,out]itemsitems to create

◆ WmkProtCreateItemData()

EXTERN_C int WENTRY_C WmkProtCreateItemData ( W_UINT32  handle,
int  createErr,
W_UINT32  itemsCount,
WMK_PROT_CREATE_ITEM_DATA items 
)

Returns type information after creating an item.

Returns
error values
Parameters
[in]handleclient connection handle
[in]createErrresult of item create, error values
[in]itemsCountnumber of items created
[in]itemsitems created

◆ WmkProtCreateItemEx()

EXTERN_C int WENTRY_C WmkProtCreateItemEx ( W_UINT32  handle,
W_UINT32  itemsCount,
WMK_PROT_CREATE_ITEM_DATA_EX items 
)

Creates an item. The item is created under a given topic. Items are created in inactive state, activate them with WmkProtActivateItem.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvCreateItem. The server result is asynchronously returned via PLC_OPCPIPE_CONFIRMS::confirmCliCreateItem.

Returns
error values
Parameters
[in]handleclient connection handle
[in]itemsCountnumber of items to create
[in,out]itemsitems to create

◆ WmkProtCyclicReadData()

EXTERN_C int WENTRY_C WmkProtCyclicReadData ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  ackHandle,
W_UINT32  itemsCount,
WMK_PROT_RW_ITEM_DATA items 
)

On the server side this is called if new data are availible from the device with the given topic item combination.

There is an optional cache which compares new to old data. The cache is used if in startup the server capabilities is set to TU_CAP_DISPATCH_SAME_ELEMENTS and the data format is not set to TU_FORMAT_ALWAYSNEW. If this is true the function compares the quality. If it is equal to the last it compares the data. If they are equal too, no data sent is made, the function returns immediately with ok.

On the client side this will call PLC_OPCPIPE_CONFIRMS::confirmCliCyclicReadData.

Returns
error values
Parameters
[in]handleserver connection handle
[in]ackHandleack handle for recognizing the answer
[in]itemsCountnumber of item values
[in]itemsitem values

◆ WmkProtDataConvert()

EXTERN_C int WENTRY_C WmkProtDataConvert ( void *  memdest,
const void *  memsrc,
W_UINT16  type_dest,
W_UINT16  typ_dest_flags,
W_UINT16  type_src,
W_UINT16  typ_src_flags,
W_UINT32  inbytes,
W_UINT32  maxmem,
W_UINT32 *  retbytes,
DATA_CONVERT_INFO info 
)

Convers binary data between different data formats.

Returns
error values
Parameters
[out]memdestdestination memory
[in]memsrcsource memory
[in]type_destdestination data type, TYP_USE_xx
[in]typ_dest_flagsdestination data flags, TYP_FLAGS_xx
[in]type_srcsource data type, TYP_USE_xx
[in]typ_src_flagssource data flags, TYP_FLAGS_xx
[in]inbyteslength of source data
[in]maxmemavailable memory for destination data
[out]retbytesactual destination data length
[in]infoAdditional info for conversions, mostly for string conversions. May be zero.

◆ WmkProtDeactivateItem()

EXTERN_C int WENTRY_C WmkProtDeactivateItem ( W_UINT32  handle,
W_UINT32  itemsCount,
WMK_PROT_HANDLE_ITEM_DATA pipeItemHandles 
)

Deactivates an item. After deactivation the server side will not respond with data.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvDeactivateItem.

Returns
error values
Parameters
[in]handleclient connection handle
[in]itemsCountnumber of items to deactivate
[in]pipeItemHandlesitems to deactivate

◆ WmkProtDeleteEvents()

EXTERN_C int WENTRY_C WmkProtDeleteEvents ( W_UINT32  handle,
W_UINT32  eventCount,
W_UINT32 *  eventHandles 
)

Stops monitoring OPC UA event sources.

On the server side this will be handled internally.

Returns
error values
Parameters
[in]handleclient connection handle
[in]eventCountnumber of events to remove
[in]eventHandleslist of event handles to remove

◆ WmkProtDeleteItem()

EXTERN_C int WENTRY_C WmkProtDeleteItem ( W_UINT32  handle,
W_UINT32  itemsCount,
WMK_PROT_HANDLE_ITEM_DATA pipeItemHandles 
)

Deletes an item created with WmkProtCreateItem.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvDeleteItem.

Returns
error values
Parameters
[in]handleclient connection handle
[in]itemsCountnumber of items to delete
[in]pipeItemHandlesitems to delete

◆ WmkProtDiagItemName()

EXTERN_C int WENTRY_C WmkProtDiagItemName ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  pipeItemHandle,
char *  itemName,
W_UINT16  namelen 
)

This enables querying the item name from the return values of the diagnostics calls.

Returns
error values
Parameters
[in]handleclient connection handle
[in]pipeItemHandlepipe item handle
[out]itemNamePointer to space for the returned topic name, This space needs to be as long as given in namelen plus one byte for the null terminator. An item name can be very long.
[in]namelenLen of the space in bytes for the item name.

◆ WmkProtDiagnostics()

EXTERN_C int WENTRY_C WmkProtDiagnostics ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  diagHandle,
WMK_OPCPIPE_HANDLE *  pipeTopicHandle,
W_UINT32  no 
)

Requests diagnostics information.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvDiagnosticsData. The data is returned with PLC_OPCPIPE_CONFIRMS::confirmCliDiagnosticsData.

Returns
error values
Parameters
[in]handleclient connection handle
[in]diagHandlereference diagnostics handle for this operation
[in]pipeTopicHandlelist of pipe topic handles for which to return diagnostics
[in]nolength if topic handle list

◆ WmkProtDiagTopicName()

EXTERN_C int WENTRY_C WmkProtDiagTopicName ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  pipeTopicHandle,
char *  topicName,
W_UINT16  namelen 
)

This enables querying the topic name from the return values of the diagnostics calls.

Returns
error values
Parameters
[in]handleclient connection handle
[in]pipeTopicHandlepipe topic handle
[out]topicNamePointer to space for the returned topic name, This space needs to be as long as given in namelen plus one byte for the null terminator.
[in]namelenLen of the space in bytes for the topic name.

◆ WmkProtDisableUpdate__()

EXTERN_C int WENTRY_C WmkProtDisableUpdate__ ( const char *  file,
int  line 
)

This suspends all OPCpipe internal modifications of its internal tables. This stops in reality the OPCpipe from working. So handle this with care.

Returns
error values
Parameters
[in]filefile of fucntion call, used for debug only
[in]lineline of fucntion call, used for debug only

◆ WmkProtEventData()

EXTERN_C int WENTRY_C WmkProtEventData ( W_UINT32  handle,
EVENT_RESULT event 
)

Emits an OPC UA event.

The core will add additional values (like EventId and Timestamp).

On the client side this will call PLC_OPCPIPE_CONFIRMS::confirmCliEventData.

Returns
error values
Parameters
[in]handleclient or server connection handle
[in]eventevent to emit

◆ WmkProtEventHistoryReadData()

EXTERN_C int WENTRY_C WmkProtEventHistoryReadData ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle,
WMK_PROT_HISTORY_EVENT_DATA event 
)

On the server side this is called if event history read data are availible from the device.

Returns
error values
Parameters
[in]handleserver connection handle
[in]readHandleread handle for recognizing the answer
[in]eventevent values

◆ WmkProtGetAppData()

EXTERN_C int WENTRY_C WmkProtGetAppData ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  pipeTopicHandle,
void **  appTopicData,
WMK_OPCPIPE_HANDLE  pipeItemHandle,
void **  appItemData 
)

Get application specific pointers. This function is guaranteed not to call any confirms and can be called within any semaphore.

Parameters
[in]handleclient or server connection handle
[in]pipeTopicHandlepipe topic handle
[out]appTopicDataapplication specific topic data pointer is stored here, may be 0
[in]pipeItemHandlepipe item handle or 0 if only topic information should be retrieved
[out]appItemDataapplication specific item data pointer is stored here, may be 0

◆ WmkProtGetCapabilities()

EXTERN_C int WENTRY_C WmkProtGetCapabilities ( W_UINT32  handle,
W_UINT64 *  capabilities 
)

Queries the connection capabilities. This may be used for checking functionality or requested things in the partner or local configuration.

Parameters
[in]handleclient or server connection handle
[out]capabilitiesconnection capabilities, values for PLC_OPCPIPE_CONFIRMS.Capabilities, bit wise

◆ WmkProtHandleFromPointer()

EXTERN_C int WENTRY_C WmkProtHandleFromPointer ( W_UINT32  handle,
OPCPIPE_TOPIC topic,
OPCPIPE_ITEM item,
WMK_OPCPIPE_HANDLE *  retHandle 
)

Calculate pipe topic or item handle from struct pointer

Returns
error values
Note
Must be called with WmkProtDisableUpdate.
Parameters
[in]handleclient or server connection handle
[in]topicpointer to topic, 0 on client
[in]itempointer to item, 0 on server if topic handle should be returned
[out]retHandlereturned handle

◆ WmkProtHistoryReadData()

EXTERN_C int WENTRY_C WmkProtHistoryReadData ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle,
WMK_PROT_HISTORY_ITEM_DATA item 
)

On the server side this is called if history read data are availible from the device.

On the client side this will call PLC_OPCPIPE_CONFIRMS::confirmCliHistoryReadData.

Returns
error values
Parameters
[in]handleserver connection handle
[in]readHandleread handle for recognizing the answer
[in]itemitem values

◆ WmkProtHistoryReadEvent()

EXTERN_C int WENTRY_C WmkProtHistoryReadEvent ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle,
WMK_PROT_HISTORY_EVENT_DATA event 
)

This will read history events from the device.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvHistoryReadEvent. The server calls WmkProtEventHistoryReadData after reading is complete. This will result in PLC_OPCPIPE_CONFIRMS::confirmCliEventHistoryReadData be called on the client.

Returns
error values

◆ WmkProtHistoryReadItem()

EXTERN_C int WENTRY_C WmkProtHistoryReadItem ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle,
WMK_PROT_HISTORY_ITEM_DATA item 
)

This will read history data from the device.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvHistoryReadItem. The server calls WmkProtHistoryReadData after reading is complete. This will result in PLC_OPCPIPE_CONFIRMS::confirmCliHistoryReadData be called on the client.

Returns
error values
Parameters
[in]handleclient connection handle
[in]readHandlereference read handle for this read operation
[in]itemitem to read

◆ WmkProtIndexFromHandle()

EXTERN_C int WENTRY_C WmkProtIndexFromHandle ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  topicOrItemHandle,
W_UINT32 *  retIndex 
)

calculates array offset from pipe topic or item handle

Returns
error values
Note
Must be called with WmkProtDisableUpdate.
Parameters
[in]handleclient or server connection handle
[in]topicOrItemHandlepipe topic or item handle
[out]retIndexreturned index

◆ WmkProtItemList()

EXTERN_C int WENTRY_C WmkProtItemList ( W_UINT32  handle,
W_UINT32 *  tablen,
OPCPIPE_ITEM **  table 
)

Gives the base pointer to the OPCpipe client internal lists of items and all their IDs and states. The tables are organized with one table in each connection.

Returns
error values
Note
Tables can be big, automatic reallocating if size increases the actual space is made. So access to these tables need stopping the OPCpipe before. So You need to call WmkProtDisableUpdate, then get the OPCPIPE_ITEM pointer, then debug display the tables. On end WmkProtRestoreUpdate must be called.
Parameters
[in]handleclient or server connection handle
[out]tablenPointer to a variable which will return the table length in elements.
[out]tablePointer to the internal base table. 0 will be returned if no tables will exist.

◆ WmkProtModifyMonitorEvents()

EXTERN_C int WENTRY_C WmkProtModifyMonitorEvents ( W_UINT32  handle,
W_UINT32  eventCount,
EVENT_REQUEST events 
)

Change a created Event subscription.

Only PipeEventHandle, MonitoringFlags, FieldNames, FieldNamesLen are used.

On the server side this will be handled internally. The data is returned with PLC_OPCPIPE_CONFIRMS::confirmCliEventData.

Returns
error values
Parameters
[in]handleclient connection handle
[in]eventCountnumber of events to change
[in]eventsevents to change

◆ WmkProtMonitorEvents()

EXTERN_C int WENTRY_C WmkProtMonitorEvents ( W_UINT32  handle,
W_UINT32  eventCount,
EVENT_REQUEST events 
)

Monitors OPC UA Event sources

On the server side this will be handled internally. The data is returned with PLC_OPCPIPE_CONFIRMS::confirmCliEventData.

Returns
error values
Parameters
[in]handleclient connection handle
[in]eventCountnumber of events to monitor
[in]eventsevents to monitor

◆ WmkProtQueryItemInformation()

EXTERN_C int WENTRY_C WmkProtQueryItemInformation ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  pipeItemHandle,
WMK_OPCPIPE_ITEM_INFO itemInfo 
)

Requests the data type and additional information of a created item.

Returns
error values ERR_OPCPIPE_MEMERR signals that not enough memory has been given in itemInfo; itemInfo->Cb shows how much is needed
Parameters
[in]handleclient connection handle
pipeItemHandlepipe item handle
[in,out]itemInfoon input, the Cb element shows how much memory was allocated, PipeItemHandle is the item to query; on output the complete structure will be initialized

◆ WmkProtReadDebugBuffer()

EXTERN_C int WENTRY_C WmkProtReadDebugBuffer ( char *  buffer,
W_UINT32  buflen 
)

query internal debug buffer

Parameters
[out]bufferdebug data is stored here
[in]buflenmaximum length of buffer

◆ WmkProtRefreshItem()

EXTERN_C int WENTRY_C WmkProtRefreshItem ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle,
W_UINT32  itemsCount,
WMK_PROT_RW_ITEM_DATA items 
)

Refreshes one or all active items. This will be done from the server's internal data caches or from the external application.

If the external application needs to be called because caching is disabled the PLC_OPCPIPE_CONFIRMS::confirmSrvRefreshItem confirm is called. Active items will be refreshed only if all items are requested. If an item has bad quality the quality value will given. The quality if it was good will be QUALITY_LAST_KNOWN_VALUE. The server calls WmkProtSyncReadData after reading is complete.

In any case this will result in PLC_OPCPIPE_CONFIRMS::confirmCliSyncReadData be called on the client.

Returns
error values
Parameters
[in]handleclient connection handle
[in]readHandlereference read handle for this read operation
[in]itemsCountnumber of items to read
[in]itemsitems to read

◆ WmkProtRegisterServer()

EXTERN_C int WENTRY_C WmkProtRegisterServer ( W_UINT32  handle,
W_UINT16  port,
int  isOnline 
)

registers an opc ua server with a discovery server

Returns
error values
Parameters
[in]handleclient connection handle ; must be OPC UA
port!< [in] port of server to register
isOnline!< [in] true if the server is online, false if not

◆ WmkProtRestoreUpdate__()

EXTERN_C int WENTRY_C WmkProtRestoreUpdate__ ( const char *  file,
int  line 
)

Restarts the OPCpipe for working.

Returns
error values
Parameters
[in]filefile of fucntion call, used for debug only
[in]lineline of fucntion call, used for debug only

◆ WmkProtRpcCall()

EXTERN_C int WENTRY_C WmkProtRpcCall ( W_UINT32  handle,
W_UINT32  callHandle,
W_UINT32  rpcId,
const char *  name,
W_UINT32  paramCount,
RPC_PARAMETER params 
)

Calls an RPC.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvRpcCall. The data is returned with PLC_OPCPIPE_CONFIRMS::confirmCliRpcData.

Returns
error values
Parameters
[in]handleclient connection handle
[in]callHandlecall handle
[in]rpcIdid of RPC to call, well-known functions for OPC UA RPC calls
[in]namename parameter, meaning depends on rpcId
[in]paramCountnumber of RPC parameters
[in]paramsRPC parameters

◆ WmkProtRpcData()

EXTERN_C int WENTRY_C WmkProtRpcData ( W_UINT32  handle,
W_UINT32  callHandle,
W_UINT32  errorCode,
W_UINT32  resultCount,
RPC_PARAMETER results 
)

Asynchronously returns RPC call result.

On the client side this will call PLC_OPCPIPE_CONFIRMS::confirmCliRpcData.

Returns
error values
Parameters
[in]handleclient connection handle
[in]callHandlecall handle
[in]errorCodeerror values error code
[in]resultCountnumber of RPC results
[in]resultsRPC results

◆ WmkProtServerDiagnostics()

EXTERN_C int WENTRY_C WmkProtServerDiagnostics ( W_UINT32  handle,
PLC_OPCPIPE_DIAG_REQUEST request,
PLC_OPCPIPE_DIAG_RESPONSE response,
W_UINT32  responseMemlen 
)

query extended server diagnostics

Parameters
[in]handleclient or server connection handle
[in]requestrequest
[out]responseresponse
[in]responseMemlenmaximum response size

◆ WmkProtServerInit()

EXTERN_C int WENTRY_C WmkProtServerInit ( PLC_OPCPIPE_CONFIRMS confirm)

Terminates the complete opcpipe server calls. This function does no house keeping, only connections are closed and internal memory is freed. No confirm will come after calling this.

Returns
error values
Note
This function is NOT reentrant or thread-safe.
Parameters
[in]confirmserver confirm functions and capabilities

◆ WmkProtServerInitEx()

EXTERN_C int WENTRY_C WmkProtServerInitEx ( PLC_OPCPIPE_CONFIRMS_EX confirm)

Terminates the complete opcpipe server calls. This function does no house keeping, only connections are closed and internal memory is freed. No confirm will come after calling this.

Returns
error values
Note
This function is NOT reentrant or thread-safe.
Parameters
[in]confirmserver confirm functions and capabilities

◆ WmkProtServerStopConnection()

EXTERN_C int WENTRY_C WmkProtServerStopConnection ( W_UINT32  handle,
int  disableConfirms 
)

Stops one server connection. There is no housekeeping on this function, only the connection is closed and internal memory is freed.

Returns
error values
Parameters
[in]handleconnection handle
[in]disableConfirmsif true, no more confirms will arrive after this function returns

◆ WmkProtServerTerminate()

EXTERN_C int WENTRY_C WmkProtServerTerminate ( void  )

Terminates the complete opcpipe server calls. This function does no house keeping, only connections are closed and internal memory is freed. No confirm will come after calling this.

Returns
error values
Note
This function is NOT reentrant or thread-safe.

◆ WmkProtSetAppData()

EXTERN_C int WENTRY_C WmkProtSetAppData ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  pipeTopicHandle,
void *  appTopicData,
WMK_OPCPIPE_HANDLE  pipeItemHandle,
void *  appItemData 
)

Set application specific pointers.

Parameters
[in]handleclient or server connection handle
[in]pipeTopicHandlepipe topic handle
[in]appTopicDataapplication specific topic data pointer, may be 0
[in]pipeItemHandlepipe item handle or 0 if topic information should be changed
[in]appItemDataapplication specific item data pointer, may be 0

◆ WmkProtSetSecurity()

EXTERN_C int WENTRY_C WmkProtSetSecurity ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  pipeTopicHandle,
ACCESS_VALUES access 
)

Set access rights per topic.

Parameters
[in]handleclient or server connection handle
[in]pipeTopicHandlepipe topic handle

◆ WmkProtStopBrowse()

EXTERN_C int WENTRY_C WmkProtStopBrowse ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  browseHandle,
W_UINT32  browseOpcode 
)

Stops browse started with WmkProtBrowse.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvStopBrowse.

Returns
error values
Parameters
[in]handleclient connection handle
[in]browseHandlereference browse handle for this browse operation
[in]browseOpcodeBrowse opcodes

◆ WmkProtStopSyncReadItem()

EXTERN_C int WENTRY_C WmkProtStopSyncReadItem ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle 
)

This will cancel a SyncRead or Refresh operation.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvStopSyncReadItem.

Parameters
[in]handleclient connection handle
[in]readHandlereference read handle for this read operation

◆ WmkProtStopWriteItem()

EXTERN_C int WENTRY_C WmkProtStopWriteItem ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  writeHandle 
)

This will cancel a Write operation.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvStopWriteItem.

Parameters
[in]handleclient connection handle
[in]writeHandlereference write handle for this write operation

◆ WmkProtSymbolsChanged()

EXTERN_C int WENTRY_C WmkProtSymbolsChanged ( W_UINT32  handle,
const char *  browsePath 
)
Parameters
[in]handleclient or server connection handle
[in]browsePaththe path at which the change occured; or 0 if not known or all symbols changed

◆ WmkProtSyncReadData()

EXTERN_C int WENTRY_C WmkProtSyncReadData ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle,
WMK_OPCPIPE_HANDLE  ackHandle,
W_UINT32  itemsCount,
WMK_PROT_RW_ITEM_DATA items 
)

On the server side this is called if sync read data are availible from the device with the given topic item combination.

This opcode bypasses the data cache and always sends the data.

On the client side this will call PLC_OPCPIPE_CONFIRMS::confirmCliSyncReadData.

Returns
error values
Parameters
[in]handleserver connection handle
[in]readHandleread handle for recognizing the answer
[in]ackHandleack handle for recognizing the answer
[in]itemsCountnumber of item values
[in]itemsitem values

◆ WmkProtSyncReadItem()

EXTERN_C int WENTRY_C WmkProtSyncReadItem ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  readHandle,
W_UINT32  itemsCount,
WMK_PROT_RW_ITEM_DATA items 
)

This will read data from the device. Will work even on deactivated items.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvSyncReadItem. The server calls WmkProtSyncReadData after reading is complete. This will result in PLC_OPCPIPE_CONFIRMS::confirmCliSyncReadData be called on the client.

Returns
error values
Parameters
[in]handleclient connection handle
[in]readHandlereference read handle for this read operation
[in]itemsCountnumber of items to read
[in]itemsitems to read

◆ WmkProtTimings()

EXTERN_C int WENTRY_C WmkProtTimings ( PLC_OPCPIPE_TIMINGS timings,
int  func 
)

Handling of internal timings like life data ack send rate and check rate, and reset of connections.

Returns
ERR_OPCPIPE_xx
Parameters
[in,out]timingstiming parameters in here
[in]func1 - read parameters; 0 - write parameters

◆ WmkProtTopicHandleFromItemHandle()

EXTERN_C int WENTRY_C WmkProtTopicHandleFromItemHandle ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  itemHandle,
WMK_OPCPIPE_HANDLE *  retHandle 
)

extracts topic handle from item handle

Returns
error values
Note
Must be called with WmkProtDisableUpdate.
Parameters
[in]handleclient or server connection handle
[in]itemHandlepipe item handle
[out]retHandlereturned handle

◆ WmkProtTopicList()

EXTERN_C int WENTRY_C WmkProtTopicList ( W_UINT32  handle,
W_UINT32 *  tablen,
OPCPIPE_TOPIC **  table 
)

Gives the base pointer to the OPCpipe server internal lists of topics and their corresponding items and all their IDs and states. The tables are organized with a base table in each connection and sub tables. The base table is corresponding with the topics, the sub tables are corresponding with the items for the topic.

Returns
error values
Note
Tables can be big, automatic reallocating if size increases the actual space is made. So access to these tables need stopping the OPCpipe before. So You need to call WmkProtDisableUpdate, then get the OPCPIPE_TOPIC pointer, then debug display the tables. On end WmkProtRestoreUpdate must be called.
Parameters
[in]handleclient or server connection handle
[out]tablenPointer to a variable which will return the table length in elements.
[out]tablePointer to the internal base table. 0 will be returned if no tables will exist.

◆ WmkProtWaitConfirm()

EXTERN_C int WENTRY_C WmkProtWaitConfirm ( W_UINT32  handle,
WMK_CONFIRM  confirm 
)

Registers the wait ready confirm. The confirm will be called each time the OPCpipe connection changes from the wait state to the normal state. This happens if a call returns with TU_STATUS_WAIT and now the next call can be made.

Returns
error values
Parameters
[in]handleconnection handle
[in]confirmconfirm function

◆ WmkProtWriteComplete()

EXTERN_C int WENTRY_C WmkProtWriteComplete ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  writeHandle,
W_UINT32  itemsCount,
WMK_PROT_RW_ITEM_DATA items 
)

This will be called the acknowledge after written data to the device.

On the client side this will call PLC_OPCPIPE_CONFIRMS::confirmCliWriteComplete.

Returns
error values
Parameters
[in]handleserver connection handle
[in]writeHandlewrite handle for recognizing the answer
[in]itemsCountnumber of items written
[in]itemsitems written

◆ WmkProtWriteItem()

EXTERN_C int WENTRY_C WmkProtWriteItem ( W_UINT32  handle,
WMK_OPCPIPE_HANDLE  writeHandle,
W_UINT32  itemsCount,
WMK_PROT_RW_ITEM_DATA items 
)

Sends data to the server side.

On the server side this will call PLC_OPCPIPE_CONFIRMS::confirmSrvWriteItem. The server calls WmkProtWriteComplete after writing is complete. This will result in PLC_OPCPIPE_CONFIRMS::confirmCliWriteComplete be called on the client.

Returns
error values
Parameters
[in]handleclient connection handle
[in]writeHandlereference write handle for this write operation
[in]itemsCountnumber of items to write
[in]itemsitems to write