API Reference v9.2.0
DeviceIOclass
Module: ZaberMotionAscii
Class providing access to the I/O channels of the device.
The following example illustrates how you can obtain an instance of this type:
import ZaberMotionAscii
let connection = try await Connection.openSerialPort(portName: "COM3")
let device = try connection.getDevice(deviceAddress: 1)
let deviceIO = device.ioRelated Guides:
Index
mMethods
Methods
m
try await deviceIO.cancelAllAnalogOutputsSchedule(channels = [])Cancel all scheduled analog output actions.
Requires at least Firmware 7.38.
Arguments
| Name | Type | Description |
|---|---|---|
| channels | [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. |
m
try await deviceIO.cancelAllDigitalOutputsSchedule(channels = [])Cancel all scheduled digital output actions.
Requires at least Firmware 7.37.
Arguments
| Name | Type | Description |
|---|---|---|
| channels | [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. |
m
m
m
m
m
m
m
try await deviceIO.getAllLabels()Returns every label assigned to an IO port on this device.
Return Value
[IoPortLabel] The labels set for this device's IO.m
m
m
try await deviceIO.getChannelsInfo()Returns the number of I/O channels the device has.
Return Value
DeviceIOInfo An object containing the number of I/O channels the device has.m
try await deviceIO.getDigitalInput(channelNumber)Returns the current value of the specified digital input channel.
Arguments
| Name | Type | Description |
|---|---|---|
| channelNumber | Int | Channel number starting at 1. |
Return Value
Bool True if voltage is present on the input channel and false otherwise.m
m
try await deviceIO.getLabel(portType, channelNumber)Returns the label of the specified channel.
Arguments
| Name | Type | Description |
|---|---|---|
| portType | IoPortType | The type of channel to get the label of. |
| channelNumber | Int | Channel number starting at 1. |
Return Value
String The label of the specified channel.m
m
try await deviceIO.setAllAnalogOutputsSchedule(values, futureValues, 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 | [Double] | Voltage values to set the output channels to immediately. |
| futureValues | [Double] | Voltage values to set the output channels to in the future. |
| delay | Double | Delay between setting current values and setting future values. |
| unit | Units | Units of time. |
m
try await deviceIO.setAllDigitalOutputs(values)Sets values for all digital output channels.
Arguments
| Name | Type | Description |
|---|---|---|
| values | [DigitalOutputAction] | The type of action to perform on the channel. |
m
try await deviceIO.setAllDigitalOutputsSchedule(values, futureValues, 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 | [DigitalOutputAction] | The type of actions to perform immediately on output channels. |
| futureValues | [DigitalOutputAction] | The type of actions to perform in the future on output channels. |
| delay | Double | Delay between setting current values and setting future values. |
| unit | Units | Units of time. |
m
try await deviceIO.setAnalogInputLowpassFilter(channelNumber, cutoffFrequency, unit = Units.native)Sets the cutoff frequency of the low-pass filter for the specified analog input channel. Set the frequency to 0 to disable the filter.
Arguments
| Name | Type | Description |
|---|---|---|
| channelNumber | Int | Channel number starting at 1. |
| cutoffFrequency | Double | Cutoff frequency of the low-pass filter. |
| unit | Units | Units of frequency. |
m
m
try await deviceIO.setAnalogOutputSchedule(channelNumber, value, futureValue, 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 |
|---|---|---|
| channelNumber | Int | Channel number starting at 1. |
| value | Double | Value to set the output channel voltage to immediately. |
| futureValue | Double | Value to set the output channel voltage to in the future. |
| delay | Double | Delay between setting current value and setting future value. |
| unit | Units | Units of time. |
m
try await deviceIO.setDigitalOutput(channelNumber, value)Sets value for the specified digital output channel.
Arguments
| Name | Type | Description |
|---|---|---|
| channelNumber | Int | Channel number starting at 1. |
| value | DigitalOutputAction | The type of action to perform on the channel. |
m
try await deviceIO.setDigitalOutputSchedule(channelNumber, value, futureValue, 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 |
|---|---|---|
| channelNumber | Int | Channel number starting at 1. |
| value | DigitalOutputAction | The type of action to perform immediately on the channel. |
| futureValue | DigitalOutputAction | The type of action to perform in the future on the channel. |
| delay | Double | Delay between setting current value and setting future value. |
| unit | Units | Units of time. |
m
try await deviceIO.setLabel(portType, channelNumber, label)Sets the label of the specified channel.
Arguments
| Name | Type | Description |
|---|---|---|
| portType | IoPortType | The type of channel to set the label of. |
| channelNumber | Int | Channel number starting at 1. |
| label | String? | The label to set for the specified channel. If no value or an empty string is provided, this label is deleted. |