DH_ParsePointMsg

DH_ParsePointMsg — parses a point message from the Cascade DataHub.

Syntax

#include <cogent.h>
ST_STATUS DH_ParsePointMsg(PT_pCPOINT  ppoint,
 char*  name,
 IP_hMSG  hmsg,
 ER_hLIST  elist);

Arguments

ppoint

A pointer to a point structure which will be filled in by this function. The name element of the structure is not filled in, but is placed in the name argument instead.

All other fields are valid, and will be treated by the write, but in the first call on a point the address field must be zero. It will be filled in automatically. This address will be valid so long as the point exists in the DataHub, and if, in subsequent DH_* functions, the address is provided for this point, the function will run slightly faster.

name

A pointer to a buffer which will be filled in with the point's name by this function.

hmsg

A handle to a previously allocated message structure (using IP_MsgCreate) providing enough buffer space to handle the inter-process communication associated with the DataHub transaction.

elist

A return value containing error information. This is unimplemented in this version, and should be NULL.

Returns

ST_OK on success, ST_ERROR on failure, or some other value of ST_STATUS. ST_ERROR means the buffer did not contain a valid point specification.

Description

This function parses the return value from DH_ReadPoint, DH_RegisterPoint, or a message received through an asynchronous message (exception) from the DataHub, and places the result in the provided point structure.

The name of the point is not modified in the point structure, as there is no clear manner in which the name should be handled. This leaves it up to the programmer to perform the memory allocation and deallocation of the point name storage as required. This function will only treat a single point specification in the message, ignoring all points after the first.

See Also

Communicating with the Cascade DataHub, DH_ParsePointString