DH_RegisterPoint, DH_RegisterExistingPoint

Cogent API and Utilities: Version 4.1
Prev |  | Next

# `DH_RegisterPoint`, `DH_RegisterExistingPoint`

`DH_RegisterPoint`, `DH_RegisterExistingPoint` -- register with the Cascade DataHub for a point.

## Syntax

    #include <cogdb.h>

``ST_STATUS DH_RegisterPoint`(IP_hTASK myself, PT_pCPOINT ppoint, IP_hMSG hmsg, ER_hLIST elist);`

``ST_STATUS DH_RegisterExistingPoint`(IP_hTASK myself, PT_pCPOINT ppoint, IP_hMSG hmsg, ER_hLIST elist);`

## Arguments

`myself`

  The task handle associated with this task. This should always be the return value from `IP_NserveInit`.

`ppoint`

  A pointer to a Cascade DataHub point structure, which must contain at least `name`. All other fields in the point structure should be `0` if this is the first call on this point, because they will be filled in by this call. Subsequent calls on the same point do not require zeroing any fields. If one point structure is used with several point names, the address field must be zeroed each time a different name is used in a call to 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`.

## Description

This function informs the datahub that this task should receive exceptions (value change notifications) for the named point. The datahub will not generate an initial exception on the point, but instead returns the current value of the point in the `ppoint` structure. Subsequent exceptions will be transmitted to the task as type=`IP_ASYNC` messages with command=`ST_EXCEPTION` or command=`ST_ECHO`. `DH_RegisterPoint` will create the point on the datahub if it does not exist. `DH_RegisterExistingPoint` will return an error if the point does not exist.

## See Also

Communicating with the Cascade DataHub, DH_UnregisterPoint DH_CreatePoint, DH_ReadPoint, DH_WritePoint, and DH_ParsePointMsg

Prev | Home | Next
`DH_RegisterAllPoints` | Up | `DH_SendPointMessage`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.