Function ziAPIModSubscribe#

ZIResult_enum ziAPIModSubscribe(ZIConnection conn, ZIModuleHandle handle, const char *path)#

Subscribes to the nodes specified by path, these nodes will be recorded during module execution.

This function subscribes to nodes so that whenever the value of the node changes while the module is executing the new value will be accumulated and then read using ziAPIModRead. By using wildcards or by using a path that is not a leaf node but contains sub nodes, more than one leaf can be subscribed to with one function call.

Parameters:
  • conn[in] The ZIConnection from which the module was created.

  • handle[in] The ZIModuleHandle specifying the module in which the nodes should be subscribed to.

  • path[in] Path specifying the nodes to subscribe to, may contain wildcards.

Returns:

  • ZI_INFO_SUCCESS On success.

  • ZI_ERROR_CONNECTION When the connection is invalid (not connected) or a general error occurred, enable ziAPI’s log for detailed information, see ziAPISetDebugLevel.

  • ZI_ERROR_LENGTH If the Path’s Length exceeds MAX_PATH_LEN.

  • ZI_ERROR_COMMAND On an incorrect answer of the server.

  • ZI_ERROR_SERVER_INTERNAL If an internal error occurred in the Data Server.

  • ZI_WARNING_NOTFOUND If the given path could not be resolved or no node given by path is able to hold values.

  • ZI_ERROR_TIMEOUT When communication timed out.

  • ZI_ERROR_GENERAL If a general error occurred, use ziAPIGetLastError for a detailed error message.

  • Other return codes may also be returned, for a detailed error message use ziAPIGetLastError.