Skip to content

Python Core API Get Operations

get(paths, *, flat=False, flags=0, settingsonly=False, subscribedonly=False, basechannelonly=False, excludevectors=False)

Return a dict with all nodes from the specified sub-tree.

Flags are ignored for a path that specifies one or more leaf nodes.

Specifying flags, either as positional or keyword argument is mandatory if an empty set would be returned given the default flags (settingsonly). High-speed streaming nodes (e.g. /devN/demods/0/sample) are are never returned.

Parameters:

Name Type Description Default
paths str

Path string of the node. Multiple paths can be specified as a comma-separated list. Wild cards are supported to select multiple matching nodes.

required
flat bool

Specify which type of data structure to return. Return data either as a flat dict (True) or as a nested dict tree (False, default).

False
flags Union[ziListEnum, int]

Flags specifying how the selected nodes are listed (see zhinst.core.ziListEnum). Flags can also specified by the keyword arguments below.

0
settingsonly bool

Returns only nodes which are marked as setting (default: False).

False
subscribedonly bool

Returns only subscribed nodes (default: False).

False
basechannelonly bool

Return only one instance of a node in case of multiple channels (default: False).

False
excludevectors bool

Exclude vector nodes (default: False).

False

Returns:

Type Description
LabOneResultNested

A dict with all nodes from the specified sub-tree.

getAsEvent(path)

Trigger an event on the specified node.

The node data is returned by a subsequent poll command.

Parameters:

Name Type Description Default
path str

Path string of the node. Note: Wildcards and paths referring to streaming nodes are not permitted.

required

getAuxInSample(path)

Returns a single auxin sample.

The auxin data is averaged in contrast to the auxin data embedded in the demodulator sample.

Parameters:

Name Type Description Default
path str

Path string of the node

required

getByte(path)

Get a byte array (string) value from the specified node.

Parameters:

Name Type Description Default
path str

Path string of the node.

required

Returns:

Type Description
str

Byte array (string) value.

getComplex(path)

Get a complex double value from the specified node.

Parameters:

Name Type Description Default
path str

Path string of the node.

required

Returns:

Type Description
complex

Complex double value.

getDIO(path)

Returns a single DIO sample.

Parameters:

Name Type Description Default
path str

Path string of the node

required

Returns:

Type Description
Dict[str, np.ndarray]

Single DIO sample.

getDouble(path)

Get a double value from the specified node.

Parameters:

Name Type Description Default
path str

Path string of the node.

required

Returns:

Type Description
float

Floating point double value.

getInt(path)

Get a integer value from the specified node.

Parameters:

Name Type Description Default
path str

Path string of the node.

required

Returns:

Type Description
int

Integer value.

getList(path, flags=8)

DEPRECATED: superseded by get(...).

Return a list with all nodes from the specified sub-tree.

Parameters:

Name Type Description Default
path str

Path string of the node. Use wild card to select all.

required
flags int

Specify which type of nodes to include in the result. Allowed: ZI_LIST_NODES_SETTINGSONLY = 0x08 (default) ZI_LIST_NODES_ALL = 0x00 (all nodes)

8

getSample(path)

Returns a single demodulator sample (including DIO and AuxIn).

For more efficient data recording use subscribe and poll methods!

Parameters:

Name Type Description Default
path str

Path string of the node

required

Returns:

Type Description
Dict[str, np.ndarray]

Single demodulator sample (including DIO and AuxIn).

getString(path)

Get a string value from the specified node.

Parameters:

Name Type Description Default
path str

Path string of the node.

required

Returns:

Type Description
str

String value.

getStringUnicode(path)

Get a unicode encoded string value from the specified node.

Deprecated, please use getString instead.

Parameters:

Name Type Description Default
path str

Path string of the node.

required

Returns:

Type Description
str

Unicode encoded string value.