Moxa ioPAC 8020-5-M12-C-T [55/66] Mx_ras_addtag

Moxa ioPAC 8020-5-M12-C-T [55/66] Mx_ras_addtag
Developer's Guide for Moxa RTU Controllers Programmer's Guide
2-47
MX_Ras_Reconnect
INT32 MX_Ras_Reconnect(UINT32 sHandle, UINT32 timeoutMs);
This function closes the opened connection and establishes a new connection to the Active OPC Server. Every
registered tag will be reserved. User can use this function while RAS APIs return an error code
RAS_ERR_SOCKET.
Input Parameters
sHandle
The opened connection handle.
timeoutMs
The timeout value in millisecond.
Output Parameters
None
Return Value
RAS_ERR_OK
RAS_ERR_LIB_INIT
RAS_ERR_PARAM
RAS_ERR_NO_MEMORY
RAS_ERR_NO_QUEUE
MX_Ras_AddTag
INT32 MX_Ras_AddTag(UINT32 sHandle, TAG_INFO *tagInfo, UINT32 timeoutMs);
This function registers a new user-defined tag to the Active OPC (RAS) Server.
Input Parameters
sHandle
The opened connection handle.
tagInfo
The C-structure TAG_INFO contains the configuration information of a tag.
TAG_INFO.tagValue: The initial value of the tag; the user should provide enough memory for the
specific type of value.
TAG_INFO.strTagName: A null-terminated C string; it must be unique.
TAG_INFO.strTagDescription: A null-terminated C string.
TAG_INFO.strTagUnit: A null-terminated C string.
TAG_INFO.tagAccessRight: 0: read-only; 2: read/write
TAG_INFO.tagValueType:
TAG_TYPE_BOOL: 1 byte, 0/1
TAG_TYPE_WORD: 2 bytes
TAG_TYPE_INT: 4 byte signed integer
TAG_TYPE_DWORD: 4 byte unsigned integer
TAG_TYPE_FLOAT: 4 bytes, floating point
TAG_INFO.tagQuality: 0x0000-0x7FFF: Good; 0x8000-0xFFFF: Bad
TAG_INFO.tagCallBack: User-defined tag-write callback function. This function will be invoked
when the Active OPC Server issues a write command to the registered tags. The callback function
should return RAS_ERR_OK to acknowledge success.
timeoutMs
The timeout value in milliseconds.
Output Parameters
None
Return Value
RAS_ERR_OK
RAS_ERR_LIB_INIT
RAS_ERR_PARAM
RAS_ERR_EXIST_TAG
RAS_ERR_NO_MEMORY
RAS_ERR_NO_QUEUE
RAS_ERR_SERVER_ERROR

Содержание

Скачать