API Reference v9.2.0

OscilloscopeDataclass

Module: ZaberMotionAscii

Contains a block of contiguous recorded data for one channel of the device's oscilloscope.

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
let oscilloscopeData = try await oscilloscope.read()
Related Guides:

Properties

p

axisNumber

readonlythrows
try oscilloscopeData.axisNumber
Int The number of the axis the data was recorded from, or 0 for the controller.
p

dataId

readonly
oscilloscopeData.dataId
Int Unique ID for this block of recorded data.
p

dataSource

readonlythrows
try oscilloscopeData.dataSource
OscilloscopeDataSource Indicates whether the data came from a setting or an I/O pin.
p

ioChannel

readonlythrows
try oscilloscopeData.ioChannel
Int Which I/O pin within the port was recorded.
p

ioType

readonlythrows
try oscilloscopeData.ioType
IoPortType Which kind of I/O port data was recorded from.
p

setting

readonlythrows
try oscilloscopeData.setting
String The name of the recorded setting.

Methods

m

getData()

throws
try oscilloscopeData.getData(unit = Units.native)
Get the recorded data as an array of doubles, with optional unit conversion. Note that not all quantities can be unit converted. For example, digital I/O channels and pure numbers such as device mode settings have no units.
Arguments
NameTypeDescription
unitUnitsUnit of measure to convert the data to.
Return Value
[Double] The recorded data for one oscilloscope channel, converted to the units specified.
m

getDelay()

throws
try oscilloscopeData.getDelay(unit = Units.native)
Get the user-specified time period between receipt of the start command and the first data point. Under some circumstances, the actual delay may be different - call GetSampleTime(0) to get the effective delay.
Arguments
NameTypeDescription
unitUnitsUnit of measure to represent the delay in.
Return Value
Double The delay setting at the time the data was recorded.
m

getFrequency()

throws
try oscilloscopeData.getFrequency(unit = Units.native)
Get the sampling frequency that this data was recorded with.
Arguments
NameTypeDescription
unitUnitsUnit of measure to represent the frequency in.
Return Value
Double The frequency (inverse of the timebase setting) at the time the data was recorded.
m

getSampleTime()

throws
try oscilloscopeData.getSampleTime(index, unit = Units.native)
Calculate the time a sample was recorded, relative to when the recording was triggered.
Arguments
NameTypeDescription
indexInt0-based index of the sample to calculate the time of.
unitUnitsUnit of measure to represent the calculated time in.
Return Value
Double The calculated time offset of the data sample at the given index.
m

getSampleTimes()

throws
try oscilloscopeData.getSampleTimes(unit = Units.native)
Calculate the time for all samples, relative to when the recording was triggered.
Arguments
NameTypeDescription
unitUnitsUnit of measure to represent the calculated time in.
Return Value
[Double] The calculated time offsets of all data samples.
m

getTimebase()

throws
try oscilloscopeData.getTimebase(unit = Units.native)
Get the sample interval that this data was recorded with.
Arguments
NameTypeDescription
unitUnitsUnit of measure to represent the timebase in.
Return Value
Double The timebase setting at the time the data was recorded.