Oscilloscopeclass Module: zaber_motion.ascii
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:
from zaber_motion.ascii import Connection
connection = Connection.open_serial_port('COM3' )
device = connection.get_device(1 )
oscilloscope = device.oscilloscopeCopy Properties p oscilloscope.device
Device Device that this Oscilloscope measures.
Methods m add_channel() async available oscilloscope.add_channel(axis, setting)
Select a setting to be recorded.
Arguments Name Type Description axis intThe 1-based index of the axis to record the value from. setting strThe name of a setting to record.
m add_io_channel() async available oscilloscope.add_io_channel(io_type, io_channel)
Select an I/O pin to be recorded.
Requires at least Firmware 7.33.
Arguments Name Type Description io_type IoPortTypeThe I/O port type to read data from. io_channel intThe 1-based index of the I/O pin to read from.
m oscilloscope.clear()
Clear the list of channels to record.
m get_buffer_size() async available oscilloscope.get_buffer_size()
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 get_delay() async available oscilloscope.get_delay(unit = Units.NATIVE)
Get the delay before oscilloscope recording starts.
Arguments Name Type Description unit TimeUnitsUnit of measure to represent the delay in.
Return Value float The current start delay in the selected time units.
m get_frequency() async available oscilloscope.get_frequency(unit = Units.NATIVE)
Get the current sampling frequency. The values is calculated as the inverse of the current sampling interval.
Arguments Name Type Description unit FrequencyUnitsUnit of measure to represent the frequency in.
Return Value float The inverse of current sampling interval in the selected units.
m get_max_buffer_size() async available oscilloscope.get_max_buffer_size()
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 get_max_channels() async available oscilloscope.get_max_channels()
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 get_timebase() async available oscilloscope.get_timebase(unit = Units.NATIVE)
Get the current sampling interval.
Arguments Name Type Description unit TimeUnitsUnit of measure to represent the timebase in.
Return Value float The current sampling interval in the selected time units.
m oscilloscope.read()
Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.
Return Value m set_delay() async available oscilloscope.set_delay(interval, unit = Units.NATIVE)
Set the sampling start delay.
Arguments Name Type Description interval floatDelay time between triggering a recording and the first data point being recorded. unit TimeUnitsUnit of measure the delay is represented in.
m set_frequency() async available oscilloscope.set_frequency(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 Name Type Description frequency floatSample frequency for the next oscilloscope recording. unit FrequencyUnitsUnit of measure the frequency is represented in.
m set_timebase() async available oscilloscope.set_timebase(interval, unit = Units.NATIVE)
Set the sampling interval.
Arguments Name Type Description interval floatSample interval for the next oscilloscope recording. Minimum value is 100µs. unit TimeUnitsUnit of measure the timebase is represented in.
m oscilloscope.start(capture_length = 0)
Arguments Name Type Description capture_length intOptional number of samples to record per channel. If left empty, the device records samples until the buffer fills.
m oscilloscope.stop()
End data recording if currently in progress.