Function ziAPIPollDataEx#

ZIResult_enum ziAPIPollDataEx(ZIConnection conn, ZIEvent *ev, uint32_t timeOutMilliseconds)#

checks if an event is available to read

This function returns immediately if an event is pending. Otherwise it waits for an event for up to timeOutMilliseconds. All value changes that occur in nodes that have been subscribed to or in children of nodes that have been subscribed to are sent from the Data Server to the ziAPI session. For a description of how the data are available in the struct, refer to the documentation of struct ziEvent. When no event was available within timeOutMilliseconds, the ziEvent::Type field will be ZI_DATA_NONE and the ziEvent::Count field will be zero. Otherwise these fields hold the values corresponding to the event that occurred.

See Data Handling for an example

Parameters:
  • conn[in] Pointer to the ZIConnection for which events should be received

  • ev[out] Pointer to a ZIEvent struct in which the received event will be written

  • timeOutMilliseconds[in] Time to wait for an event in milliseconds. If -1 it will wait forever, if 0 the function returns immediately.

Returns:

  • ZI_INFO_SUCCESS on success

  • ZI_ERROR_CONNECTION when the connection is invalid (not connected) or when a communication error occurred

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