Lab::Moose::Instrument::Rigol_DG5000 - Rigol DG5000 series Function/Arbitrary Waveform Generator
version 3.841
use Lab::Moose; my $rigol = instrument( type => 'Rigol_DG5000', connection_type => 'USB', # For NT-VISA use 'VISA::USB' instrument_nselect => 2, );
All source_*, set_* and get_* commands accept a channel argument, which can be 1 or 2. On initalization an argument instrument_nselect can be passed to specify a default channel, though if instrument_nselect is not passed the default channel is 1:
source_*
set_*
get_*
channel
instrument_nselect
$rigol->source_function_shape(value => 'SIN'); # Channel 1 $rigol->source_function_shape(value => 'SQU', channel => 2); # Channel 2
Used roles:
$rigol->gen_arb_step(channel => 1, sequence => [ 0.2, 0.00002, 0.5, 0.0001, 0.35, 0.0001 ], bdelay => 0, bcycles => 1 );
Generate an arbitrary voltage step function. With sequence an array referrence is passed to the function, containing data pairs of an amplitude and time value. The example above repeatedly outputs a constant 200mV for 20µs, 500mV for 100µs and 350mV for 100µs.
sequence
WORK IN PROGRESS: With bdelay and bcycles a delay between a specified amount of cycles is enabled using the Rigols burst mode.
bdelay
bcycles
bdelay = 0 by default disabling burst mode.
$rigol->arb_mode(value => 'INTernal');
Allowed values: INT, INTernal, PLAY. In normal or internal mode he output frequency ranges from 1 μHz to 50 MHz, and the sample rate is fixed at 1G Sa/s, while the number of points is 16Mpts. Play mode is used once the number of points of the arbitrary waveform to be output is greater than 16 Mpts, ranging up to 128Mpts. See the Rigols user manual page 3-4 and following for more information.
INT, INTernal, PLAY
$rigol->play_coefficient(value => 10);
When using the arbitrary waveform in play mode, a frequency division coefficient N can be used to reduce the sample rate fs via the relations
N
fs = 1G/2^N, When N≤2
fs = 1G/((N-2)*8), when N>2
The range of N is from 0 to 268435456 (2^28). See the Rigol user manual page 3-4 and following for more information.
$rigol->phase_align();
Phase-align the two output channels, only available if the output function is either Sine, Square, Ramp or Arbitrary.
$rigol->output_on(channel => 1); $rigol->output_off(channel => 2);
Turn output channels on or off.
$rigol->set_pulsewidth(channel => 1, value => 0.0000001, constant_delay => 1); $rigol->get_pulsewidth();
When the output functon is PULSE these subroutines set/get the pulses width in s. This reduces the pulse delay however, since the pulse period stays the same. An optional parameter constant_delay can be passed to adapt the waveform period and keep the delay constant.
PULSE
constant_delay
$rigol->set_pulsedelay(channel => 1, value => 0.0000003, constant_width => 1); $rigol->get_pulsedelay();
When the output functon is PULSE these subroutines set/get the pulses width in s. This reduces the pulse delay however, since the pulse period stays the same. As with the delay an optional parameter constant_width can be passed to adapt the waveform period and keep the width constant.
constant_width
$rigol->set_period(channel => 1, value => 0.00000045); $rigol->get_period();
Set/query the current waveforms period in s.
$rigol->set_frq(channel => 1, value => 10000000); $rigol->get_frq();
Set/query the current waveforms frequency in Hz. This subroutine is used for frequency sweeps.
$rigol->set_voltage(channel => 1, value => 1); $rigol->get_voltage();
Set/query the current waveforms peak-to-peak amplitude in volts.
$rigol->set_level(channel => 1, value => 1); $rigol->get_level();
Set/query the current waveforms maximum amplitude amplitude in volts. This subroutine is used for voltage sweeps.
$rigol->set_level_low(channel => 1, value => 1); $rigol->get_level_low();
Set/query the current waveforms minimum amplitude amplitude in volts.
$rigol->set_offset(channel => 1, value => 0.5); $rigol->get_offset();
Set/query the current waveforms dc offset in volts.
$rigol->source_apply_ramp( freq => ..., amp => ..., offset => ..., delay => ... );
Apply a pulse function with the given parameters,
freq = frequency in Hz
freq
amp = amplitude in Volts
amp
offset = DC offset in Volts
offset
delay = pulse delay in seconds
delay
$rigol->source_apply_ramp( freq => ..., amp => ..., offset => ..., phase => ... );
Apply a ramp, sine, square function or arbitrary waveform with the given parameters,
phase = phase in degrees (0 to 360)
phase
$rigol->source_burst_mode(value => 'TRIG'); say $rigol->source_burst_mode_query();
Allowed values: TRIG, GAT, INF. For more information see the Rigols user manual page 7-3.
TRIG, GAT, INF
$rigol->source_burst_ncycles(value => 1); say $rigol->source_burst_ncycles_query();
Output a specified amount of full wave cycles, with a delay between them. See source_burst_tdelay/source_burst_tdelay_query for more information.
$rigol->source_burst_state(value => 'ON'); say $rigol_source_burst_state_query();
Allowed values: ON, OFF Turns the burst mode on or off.
ON, OFF
$rigol->source_burst_tdelay(value => 1e-3); say $rigol->source_burst_tdelay_query();
Specify/query the delay between bursts in seconds.
$rigol->source_burst_trigger();
Trigger a burst via program.
$rigol->source_burst_trigger_slope(value => 'POS'); say $rigol->source_burst_trigger_slope_query();
Allowed values: POS, NEG. In Gated mode, the generator will output burst at specified polarity of the gated signal received from the [ExtTrig] connector at the rear panel.
POS, NEG
$rigol->source_burst_trigger_trigout(value => 'POS'); $rigol->source_burst_trigger_trigout_query();
Allowed values: POS, NEG, OFF. In Burst mode, when “Internal” or “Manual” trigger source is selected, the generator will output a TTL compatible signal with specified polarity from the [ExtTrig] connector at the rear panel. For more information see the Rigols user manual page 7-7.
POS, NEG, OFF
$rigol->source_burst_trigger_source(value => 'INT'); $rigol->source_burst_trigger_source_query();
Allowed values: INT, EXT. Specify whether the trigger signal for a burst is controlled internally or externally via the [ExtTrig] connector. For more information see the Rigols user manual page 7-6.
INT, EXT
$rigol->source_burst_period(value => 0.00001);
Defined as the time from the beginning of the N cycle burst to the beginning of the next burst. Only for N cycle burst in internal trigger mode.
$rigol->source_function_shape(value => 'SIN'); say $rigol->source_function_shape_query();
Allowed values: SIN, SQU, RAMP, PULSE, NOISE, USER, DC, SINC, EXPR, EXPF, CARD, GAUS, HAV, LOR, ARBPULSE, DUA.
SIN, SQU, RAMP, PULSE, NOISE, USER, DC, SINC, EXPR, EXPF, CARD, GAUS, HAV, LOR, ARBPULSE, DUA
$rigol->source_function_ramp_symmetry(value => 100); say $rigol->source_function_ramp_symmetry_query();
$rigol->source_period_fixed(value => 1e-3); say $rigol->source_period_fixed_query();
my $values = [-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0,0.1,0.2,0.3,0.4,0.5,0.6]; $rigol->trace_data_data(data => $values);
$rigol->trace_data_value(point => 2, data => 8192);
Modify the second point to the decimal number 8192.
$rigol->trace_data_value_query(point => 2);
$rigol->trace_data_points(value => 3); say $rigol->trace_data_points_query();
$rigol->trace_data_points_interpolate(value => 'LIN'); say $rigol->trace_data_points_interpolate_query();
Allowed values: LIN, SINC, OFF.
LIN, SINC, OFF
$rigol->trace_data_dac(value => '16383,8192,0,0,8192,8192,6345,0');
Input a string of comma-seperated integers ranging from 0 to 16383 (14Bit). If there are less than 16384 data points given, the Rigol will automatically interpolate.
This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
Copyright 2020 Simon Reinhardt 2021 Andreas K. Huettel, Fabian Weinelt, Simon Reinhardt 2022 Simon Reinhardt
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Lab::Measurement, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lab::Measurement
CPAN shell
perl -MCPAN -e shell install Lab::Measurement
For more information on module installation, please visit the detailed CPAN module installation guide.