Skip to content

Matlab API Subscribe And Poll


ziDAQ('subscribe', path);

path (string) = Node path
Subscribe to the specified path to receive streaming data
or setting data if changed. Use either 'poll' command to
obtain the subscribed data.


ziDAQ('unsubscribe', path);

path (string) = Node path
Unsubscribe from the node paths specified via 'subscribe'.
Use a wildcard ('*') to unsubscribe from all data.


ziDAQ('getAsEvent', path);

path (string) = Node path. Note: Wildcards and paths referring
                to streaming nodes are not permitted.
Triggers a single event on the path to return the current
value. The result can be fetched with the 'poll' or 'pollEvent'


ziDAQ('poll', duration, timeout, [flags]);

duration (double) = Time in [s] to continuously check for value
                    changes in subscribed nodes before
timeout (int64)   = Poll timeout in [ms]; recommended: 10 ms
[flags] (uint32)  = Flags specifying data polling properties
          Bit[0] FILL : Fill data loss holes
          Bit[2] THROW : Throw if data loss is detected (only
                 possible in combination with DETECT).
          Bit[3] DETECT: Just detect data loss holes.
Continuously check for value changes (by calling pollEvent) in
all subscribed nodes for the specified duration and return the
data. If no value change occurs in subscribed nodes before
duration + timeout, poll returns no data. This function call is
blocking (it is synchronous). However, since all value changes
are returned since either subscribing to the node or the last
poll (assuming no buffer overflow has occurred on the Data
Server), this function may be used in a quasi-asynchronous
manner to return data spanning a much longer time than the
specified duration. The timeout parameter is only relevant when
communicating in a slow network. In this case it may be set to
a value larger than the expected round-trip time in the


result = ziDAQ('pollEvent', timeout);

timeout (int64) = Poll timeout in [ms]
Return the value changes that occurred in one single subscribed
node. This is a low-level function. The poll function is better
suited in nearly all cases.