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:
Index
Properties
p
p
try oscilloscopeData.dataSourceOscilloscopeDataSource Indicates whether the data came from a setting or an I/O pin.p
p
try oscilloscopeData.ioTypeIoPortType Which kind of I/O port data was recorded from.Methods
m
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
| Name | Type | Description |
|---|---|---|
| unit | Units | Unit of measure to convert the data to. |
Return Value
[Double] The recorded data for one oscilloscope channel, converted to the units specified.m
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
| Name | Type | Description |
|---|---|---|
| unit | Units | Unit of measure to represent the delay in. |
Return Value
Double The delay setting at the time the data was recorded.m
try oscilloscopeData.getFrequency(unit = Units.native)Get the sampling frequency that this data was recorded with.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | Units | Unit 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
try oscilloscopeData.getSampleTime(index, unit = Units.native)Calculate the time a sample was recorded, relative to when the recording was triggered.
Arguments
| Name | Type | Description |
|---|---|---|
| index | Int | 0-based index of the sample to calculate the time of. |
| unit | Units | Unit of measure to represent the calculated time in. |
Return Value
Double The calculated time offset of the data sample at the given index.m
try oscilloscopeData.getSampleTimes(unit = Units.native)Calculate the time for all samples, relative to when the recording was triggered.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | Units | Unit of measure to represent the calculated time in. |
Return Value
[Double] The calculated time offsets of all data samples.m
try oscilloscopeData.getTimebase(unit = Units.native)Get the sample interval that this data was recorded with.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | Units | Unit of measure to represent the timebase in. |
Return Value
Double The timebase setting at the time the data was recorded.