DIGITAL_TRACE_DS1047Z
Extracts a traces from one of the digital channels (e.g D0). Requires a CONNECTION_DS1074Z node at the start of the app to connect with
the instrument. The VISA address will then be listed under 'connection'.
This node should also work with compatible DS1000Z oscilloscopes Params: connection : VisaConnection The VISA address (requires the CONNECTION_DS1074Z node). channel : int Set the triggering channel, from 0-15. level : float The triggering level, in V. slope : select Which slope to detect the triggering time on. Returns: out : DataContainer String: summary of channel settings.
Python Code
from flojoy import flojoy, DataContainer, OrderedPair, VisaConnection
from typing import Optional
from numpy import linspace, array, multiply
@flojoy(inject_connection=True)
def DIGITAL_TRACE_DS1047Z(
connection: VisaConnection,
channel: int = 0,
default: Optional[DataContainer] = None,
) -> OrderedPair:
"""Extracts a traces from one of the digital channels (e.g D0).
Requires a CONNECTION_DS1074Z node at the start of the app to connect with
the instrument. The VISA address will then be listed under 'connection'.
This node should also work with compatible DS1000Z oscilloscopes
Parameters
----------
connection: VisaConnection
The VISA address (requires the CONNECTION_DS1074Z node).
channel: int
Set the triggering channel, from 0-15.
level: float
The triggering level, in V.
slope: select
Which slope to detect the triggering time on.
Returns
-------
DataContainer
String: summary of channel settings.
"""
rigol = connection.get_handle()
assert 0 <= channel <= 15, "The channel must be between 0 and 15."
rigol.write_raw(":WAVeform:FORMat WORD")
rigol.write_raw(f":WAVeform:SOURce D{channel}")
xorigin = rigol.query_raw("WAVeform:XORigin?")
xincrem = rigol.query_raw("WAVeform:XINCrement?")
npts = rigol.query_raw("WAV:POIN?")
x = linspace(xorigin, npts * xincrem + xorigin, npts)
raw_trace_val = rigol.root_instrument.visa_handle.query_binary_values(
"WAV:DATA?", datatype="h", is_big_endian=False, expect_termination=False
)
y_ori = rigol.query_raw("WAVeform:YORigin?")
y_increm = rigol.query_raw("WAVeform:YINCrement?")
y_ref = rigol.query_raw(":WAVeform:YREFerence?")
y_raw = array(raw_trace_val)
y_raw_shifted = y_raw - y_ori - y_ref
y = multiply(y_raw_shifted, y_increm)
return OrderedPair(x=x, y=y)
Videos
Digital Signals Oscilloscope
Example
Having problems with this example app? Join our Discord community and we will help you out!
In this example the digital function blocks are used to control the LA
channels of the Rigol DS1047Z oscilloscope.
A CONNECTION_DS1047Z
block must first be used to make the connection between Flojoy and the instrument.
The DIGITAL_ON_OFF_DS1047Z
block turns the LA
digital channel off as well as indiviual sub-channels.
The DIGITAL_TRIGGER_DS1047Z
block chooses the triggering digital channel (e.g. D0 here
) and the triggering level.
The SINGLE_TRIGGER_DS1047Z
block sets the triggering mode to single
which stops the oscilloscope as soon as a triggering signal is detected, leaving a static trace on the screen.
The DIGITAL_TRACE_DS1047Z
block extracts traces from digital channels such as D0
.