API Reference v9.2.0

Oscilloscopeclass

Module: ZaberMotionAscii

Provides a convenient way to control the oscilloscope data recording feature of some devices. The oscilloscope can record the values of some settings over time at high resolution. Requires at least Firmware 7.00.

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 oscilloscope = device.oscilloscope
Related Guides:

Properties

p

device

readonly
oscilloscope.device
Device Device that this Oscilloscope measures.

Methods

m

addChannel()

asyncthrows
try await oscilloscope.addChannel(axis, setting)
Select a setting to be recorded.
Arguments
NameTypeDescription
axisIntThe 1-based index of the axis to record the value from.
settingStringThe name of a setting to record.
m

addIoChannel()

asyncthrows
try await oscilloscope.addIoChannel(ioType, ioChannel)
Select an I/O pin to be recorded. Requires at least Firmware 7.33.
Arguments
NameTypeDescription
ioTypeIoPortTypeThe I/O port type to read data from.
ioChannelIntThe 1-based index of the I/O pin to read from.
m

clear()

asyncthrows
try await oscilloscope.clear()
Clear the list of channels to record.
m

getBufferSize()

asyncthrows
try await oscilloscope.getBufferSize()
Get the number of samples that can be recorded per channel given the current number of channels added.
Return Value
Int Number of samples that will be recorded per channel with the current channels. Zero if none have been added.
m

getDelay()

asyncthrows
try await oscilloscope.getDelay(unit = Units.native)
Get the delay before oscilloscope recording starts.
Arguments
NameTypeDescription
unitUnitsUnit of measure to represent the delay in.
Return Value
Double The current start delay in the selected time units.
m

getFrequency()

asyncthrows
try await oscilloscope.getFrequency(unit = Units.native)
Get the current sampling frequency. The values is calculated as the inverse of the current sampling interval.
Arguments
NameTypeDescription
unitUnitsUnit of measure to represent the frequency in.
Return Value
Double The inverse of current sampling interval in the selected units.
m

getMaxBufferSize()

asyncthrows
try await oscilloscope.getMaxBufferSize()
Get the maximum number of samples that can be recorded per Oscilloscope channel.
Return Value
Int The maximum number of samples that can be recorded per Oscilloscope channel.
m

getMaxChannels()

asyncthrows
try await oscilloscope.getMaxChannels()
Get the maximum number of channels that can be recorded.
Return Value
Int The maximum number of channels that can be added to an Oscilloscope recording.
m

getTimebase()

asyncthrows
try await oscilloscope.getTimebase(unit = Units.native)
Get the current sampling interval.
Arguments
NameTypeDescription
unitUnitsUnit of measure to represent the timebase in.
Return Value
Double The current sampling interval in the selected time units.
m

read()

asyncthrows
try await oscilloscope.read()
Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.
Return Value
[OscilloscopeData] Array of recorded channel data arrays, in the order added.
m

setDelay()

asyncthrows
try await oscilloscope.setDelay(interval, unit = Units.native)
Set the sampling start delay.
Arguments
NameTypeDescription
intervalDoubleDelay time between triggering a recording and the first data point being recorded.
unitUnitsUnit of measure the delay is represented in.
m

setFrequency()

asyncthrows
try await oscilloscope.setFrequency(frequency, unit = Units.native)
Set the sampling frequency (inverse of the sampling interval). The value is quantized to the next closest value supported by the firmware.
Arguments
NameTypeDescription
frequencyDoubleSample frequency for the next oscilloscope recording.
unitUnitsUnit of measure the frequency is represented in.
m

setTimebase()

asyncthrows
try await oscilloscope.setTimebase(interval, unit = Units.native)
Set the sampling interval.
Arguments
NameTypeDescription
intervalDoubleSample interval for the next oscilloscope recording. Minimum value is 100µs.
unitUnitsUnit of measure the timebase is represented in.
m

start()

asyncthrows
try await oscilloscope.start(captureLength = 0)
Trigger data recording.
Arguments
NameTypeDescription
captureLengthIntOptional number of samples to record per channel. If left empty, the device records samples until the buffer fills.
m

stop()

asyncthrows
try await oscilloscope.stop()
End data recording if currently in progress.