# API Reference v10.3.1 (Python)

## StreamIo (class)

Module: zaber_motion.ascii

Class providing access to I/O for a stream.

To use this type, add `from zaber_motion.ascii import StreamIo` to the top of your source code.

Related Guides:

- [Streamed movement](https://software.zaber.com/motion-library/docs/guides/device_features/streams.md)

### Methods

#### `cancel_all_analog_outputs_schedule()` (async available)

`stream_io.cancel_all_analog_outputs_schedule(channels = [])`

Cancel all scheduled analog output actions.

Requires at least Firmware 7.38.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channels` | `List[bool]` | Optionally specify which channels to cancel. Array length must be empty or equal to the number of channels on device. Specifying "True" for a channel will cancel the scheduled analog output value for that channel. |

#### `cancel_all_digital_outputs_schedule()` (async available)

`stream_io.cancel_all_digital_outputs_schedule(channels = [])`

Cancel all scheduled digital output actions.

Requires at least Firmware 7.37.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channels` | `List[bool]` | Optionally specify which channels to cancel. Array length must be empty or equal to the number of channels on device. Specifying "True" for a channel will cancel the scheduled digital output action for that channel. |

#### `cancel_analog_output_schedule()` (async available)

`stream_io.cancel_analog_output_schedule(channel_number)`

Cancels a scheduled analog output value.

Requires at least Firmware 7.38.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | Channel number starting at 1. |

#### `cancel_digital_output_schedule()` (async available)

`stream_io.cancel_digital_output_schedule(channel_number)`

Cancels a scheduled digital output action.

Requires at least Firmware 7.37.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | Channel number starting at 1. |

#### `set_all_analog_outputs()` (async available)

`stream_io.set_all_analog_outputs(values)`

Sets values for all analog output channels.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `values` | `List[float]` | Voltage values to set the output channels to. |

#### `set_all_analog_outputs_schedule()` (async available)

`stream_io.set_all_analog_outputs_schedule(values, future_values, delay, unit = Units.NATIVE)`

Sets current and future values for all analog output channels.

Requires at least Firmware 7.38.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `values` | `List[float]` | Voltage values to set the output channels to immediately. |
| `future_values` | `List[float]` | Voltage values to set the output channels to in the future. |
| `delay` | `float` | Delay between setting current values and setting future values. |
| `unit` | [`TimeUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of time. |

#### `set_all_digital_outputs()` (async available)

`stream_io.set_all_digital_outputs(values)`

Sets values for all digital output channels.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `values` | [`List[DigitalOutputAction]`](https://software.zaber.com/motion-library/api/py/ascii/digitaloutputaction.md) | The type of action to perform on the channel. |

#### `set_all_digital_outputs_schedule()` (async available)

`stream_io.set_all_digital_outputs_schedule(values, future_values, delay, unit = Units.NATIVE)`

Sets current and future values for all digital output channels.

Requires at least Firmware 7.37.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `values` | [`List[DigitalOutputAction]`](https://software.zaber.com/motion-library/api/py/ascii/digitaloutputaction.md) | The type of actions to perform immediately on output channels. |
| `future_values` | [`List[DigitalOutputAction]`](https://software.zaber.com/motion-library/api/py/ascii/digitaloutputaction.md) | The type of actions to perform in the future on output channels. |
| `delay` | `float` | Delay between setting current values and setting future values. |
| `unit` | [`TimeUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of time. |

#### `set_analog_output()` (async available)

`stream_io.set_analog_output(channel_number, value)`

Sets value for the specified analog output channel.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | Channel number starting at 1. |
| `value` | `float` | Value to set the output channel voltage to. |

#### `set_analog_output_schedule()` (async available)

`stream_io.set_analog_output_schedule(channel_number, value, future_value, delay, unit = Units.NATIVE)`

Sets current and future value for the specified analog output channel.

Requires at least Firmware 7.38.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | Channel number starting at 1. |
| `value` | `float` | Value to set the output channel voltage to immediately. |
| `future_value` | `float` | Value to set the output channel voltage to in the future. |
| `delay` | `float` | Delay between setting current value and setting future value. |
| `unit` | [`TimeUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of time. |

#### `set_digital_output()` (async available)

`stream_io.set_digital_output(channel_number, value)`

Sets value for the specified digital output channel.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | Channel number starting at 1. |
| `value` | [`DigitalOutputAction`](https://software.zaber.com/motion-library/api/py/ascii/digitaloutputaction.md) | The type of action to perform on the channel. |

#### `set_digital_output_schedule()` (async available)

`stream_io.set_digital_output_schedule(channel_number, value, future_value, delay, unit = Units.NATIVE)`

Sets current and future value for the specified digital output channel.

Requires at least Firmware 7.37.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | Channel number starting at 1. |
| `value` | [`DigitalOutputAction`](https://software.zaber.com/motion-library/api/py/ascii/digitaloutputaction.md) | The type of action to perform immediately on the channel. |
| `future_value` | [`DigitalOutputAction`](https://software.zaber.com/motion-library/api/py/ascii/digitaloutputaction.md) | The type of action to perform in the future on the channel. |
| `delay` | `float` | Delay between setting current value and setting future value. |
| `unit` | [`TimeUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of time. |

#### `wait_analog_input()` (async available)

`stream_io.wait_analog_input(channel_number, condition, value)`

Wait for the value of a analog input channel to reach a condition concerning a given value.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | The number of the analog input channel. Channel numbers are numbered from one. |
| `condition` | `str` | A condition (e.g. <, <=, ==, !=). |
| `value` | `float` | The value that the condition concerns, in Volts. |

#### `wait_digital_input()` (async available)

`stream_io.wait_digital_input(channel_number, value)`

Wait for a digital input channel to reach a given value.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `channel_number` | `int` | The number of the digital input channel. Channel numbers are numbered from one. |
| `value` | `bool` | The value that the stream should wait for. |
