#include opcapi.h
int opcif_open(
int interface_type, /* in */
const char *instance, /* in */
int mode, /* in */
int max_entries, /* in */
int *interface_id /* out */
);
Parameters
interface_type
Agent Message Stream Interface
Used by external message processors (for example, event correlation engines):
OPCAGTIF_EXTMSGPROC_READ
OPCAGTIF_EXTMSGPROC_READWRITE
OPCAGTIF_EXTMSGPROC_WRITE
instance
mode
OPCIF_ALWAYS
(default)OPCIF_AGT_RUNNING
The following options specify whether the
opcif_read()
API will wait for available data or not;
in the WAIT case, the calling process will be blocked until data is
available or the process receives an interrupt:
OPCIF_READ_WAIT
(default)OPCIF_READ_NOWAIT
To specify the handling of unread messages if the connected process closes the interface or aborts, use one of the following options:
OPCIF_CLOSE_FORWARD
(default)OPCIF_CLOSE_DISCARD
In the first case, messages in the read-queue are appended to the write-queue; in the second, these messages are discarded when the external program closes the interface.
It is possible to combine these options using the '|' operator.
max_entries
opcif_read()
. The application must
then disconnect and reopen the interface. To disable this check,
specify 0 for max_entries.
interface_id
Description
Use the function opcif_open()
to connect to an
instance of one of the following interfaces:
Return Values
OPC_ERR_OK:
OPC_ERR_INVALID_OUTPARAM:
interface_id
is invalid
OPC_ERR_ACCESS_DENIED:
OPC_ERR_INVALID_INTERFACE_INSTANCE:
OPC_ERR_INVALID_INTERFACE_TYPE:
OPC_ERR_CANT_INIT:
OPC_ERR_CANT_OPEN_READQUEUE:
OPC_ERR_CANT_OPEN_WRITEQUEUE:
OPC_ERR_CANT_INFORM_MSGA:
OPC_ERR_NO_MEMORY:
Versions
HPOM for Windows A.07.50 and later
See Also