Rigol Function Generator DG811/DG922 FW v00.02.06.00.01 sweep function woes  - Page 1
Forum section: electronics / testgear

author: THDplusN_bad
author_rank: Regular Contributor
timestamp: December 14, 2021, 07:29:12 pm
content: Good Day to the gang,I have done some Python-coding for remotely controlling my Rigol DG811/922 generator, which is running the most recentv00.02.06.00.01 2021-05-14Firmware.This was evaluated with a reliable system, i.e. operating NI VISA, Python programming using pyvisa and NI VISA Test panel. Connection via the DG's USB interface.References: Latest Rigol DG2000 programming guide, release version RIGOL DG2000 Programming Guide, Publication Number PGB12100-1110, Software Version,00.02.01https://beyondmeasure.rigoltech.com/acton/attachment/1579/f-0da93459-3e01-4fff-bd2e-3f078633faed/1/-/-/-/-/DG2000_ProgrammingGuide_EN.pdfandhttps://beyondmeasure.rigoltech.com/acton/attachment/1579/f-08aa/0/-/-/-/-/DG900_ProgrammingGuide_EN.pdfPublication Number PGB10100-1110 Software Version 00.00.01. The latter is outdated, but the example code is identical with the first reference.There are a few findings I would like to share with other owners of this series. See below. These should also apply to the type DG2000 function generator as far as I understand RIGOL's Firmware policy.Any comments, confirmations or corrections would be appreciated.Cheers,THDplusN_bad1) No trigger *output* in SWEEP modeReference: The example code as provided by RIGOL "To output sweep waveform" per the DG900 programming guide chapter 3 on page 172.The example code does not result in a trigger output signal if exactly followed.From what I can say, the current firmware does not support a trigger *output* signal in sweep mode, i.e. see the log file below.Side node: The "\s" character is correct, i.e. it is used for the space character. We can see that the commmand "SOUR1:SWE:TRIG:TRIGO POS" example code results in a -113 error.Log file taken from VISA Test panel:1: Write Operation (*IDN?\n)Return Count: 6 bytes2: Read OperationReturn Count: 55 bytesRigol\sTechnologies,DG992,DG8A123456789,00.02.06.00.01\s\n3: Write Operation (SYST:ERROR?)Return Count: 11 bytes4: Read OperationReturn Count: 13 bytes0,"No\serror"\n5: Write Operation (SOUR1:SWE:TRIG:TRIGO\sPOS)Return Count: 24 bytes6: Write Operation (SYST:ERROR?)Return Count: 11 bytes7: Read OperationReturn Count: 49 bytes-113,"Undefined\sheader;\skeyword\scannot\sbe\sfound"\n2) When configuring for manual trigger as in the example code, a sweep is not completed.A fatal typo error in the example code causes this:SOUR1:SWE:TRIG:SOUR BUSvs.SOUR1:SWE:TRIG:SOUR MAN.So, the following command sequence results in a static output signal with the sweep start frequency, but no sweep is initiated.Code:generator.write('SOUR1:FUNC SIN')generator.write('OUTP1:LOAD 50')generator.write('SOUR1:VOLT 1')generator.write('SOUR1:VOLT:OFFS 0')generator.write('SOUR1:SWE:STAT ON')generator.write('SOUR1:SWE:SPAC LIN')generator.write('SOUR1:SWE:TIME 10')generator.write('SOUR1:SWE:RTIM 0.1')generator.write('SOUR1:FREQ:START 10')generator.write('SOUR1:FREQ:STOP 1000')generator.write('SOUR1:MARK ON')generator.write('SOUR1:MARK:FREQ 10')generator.write('SOUR1:SWE:HTIM:STAR 0.1')generator.write('SOUR1:SWE:HTIM:STOP 1')generator.write('SOUR1:SWE:TRIG:SOUR MAN')generator.write('OUTP1 ON')generator.write('SOUR1:SWE:TRIG')as in the example code *fails* to create a sweep.Side note: The sequence of commands generator.write('SOUR1:SWE:TRIG:SOUR MAN') and generator.write('OUTP1 ON') is irrelevant, although the same page specifies that the output channel has to be enabled first for the manual trigger.However, if the"generator.write('SOUR1:SWE:TRIG:SOUR MAN')"command is replaced with the internal trigger source configuration"generator.write('SOUR1:SWE:TRIG:SOUR INT')" or with"generator.write('TRIG1:SOUR BUS')" as per page 2-155a sweep is triggered properly. *If the remote program allows it the time to complete (see below for non-functional *WAI command).*See the attached screenshot.3) The "*WAI" command is not implemented properlyBefore you might ask: I have read page 2-27 in the programming guide that says that the wait command is only "applicable to the triggered sweep mode"... My point is that it fails. Or this was meant to say "external triggered sweep mode", which I have not tested yet...Also, the *WAI signal as implemented in most other instruments is auniversalcommand that allows for synchronization.4) The "MARKER" command fails.The output signal on the rear connector is static high at 3.3V no matter what I have tried, i.e. the example code fails to output a marker signal transition when sweeping.*********************************Before you are pulling your hair out... For the benefit of other users, here is some pseudo-code that works with the above Firmware for the DG922. The signal ON time is a few seconds longer than the actual sweep time, so it idles at the start frequency signal for a few seconds after completion. Enjoy.Code:print(generator.query('*IDN?')) # Print instrument id to console window# Clear any errorsgenerator.write('*CLS')# Configure sweep parameters sine wave, 1 Vpp, no offset, 50 Ohm output impedance, linear sweep, 10 sec sweep and 0.1 sec release timegenerator.write('SOUR1:FUNC SIN')generator.write('OUTP1:LOAD 50')generator.write('SOUR1:VOLT 1')generator.write('SOUR1:VOLT:OFFS 0')generator.write('SOUR1:SWE:STAT ON')generator.write('SOUR1:SWE:SPAC LIN')generator.write('SOUR1:SWE:TIME 10')generator.write('SOUR1:SWE:RTIM 0.1')# Start at 10 Hz and stop at 1 kHzgenerator.write('SOUR1:FREQ:START 10')generator.write('SOUR1:FREQ:STOP 1000')generator.write('SOUR1:SWE:HTIM:STAR 0.1')generator.write('SOUR1:SWE:HTIM:STOP 1')generator.write('OUTP1 ON')generator.write('TRIG1:SOUR BUS')# And trigger the sweep:generator.write('*TRG')# Allow some time for the sweep to complete:time.sleep(12)# Output offgenerator.write('OUTP1 OFF')generator.close()

author: sken
author_rank: Newbie
timestamp: November 29, 2023, 07:48:07 am
content: Dear THDplusN_bad,I am reposting here a post which I posted yesterday in another thread, as I think you can maybe help me.I am using Python to generate and download a modulated gaussian signal as a "sequence" waveform into a DG811. I need to trigger the output with an external trigger and therefore I have set up an N-cycle burst, with N=1, and activated the external trigger. According to the manual, indeed,"In N Cycle mode, the generator will output waveforms with a specified number of cycles after receiving the trigger signal. The waveform functions that support the N cycle burst include Sine, Square, Ramp, Pulse, Arbitrary, PRBS, RS232, and Sequence. For N cycle burst, "Internal", "External", or "Manual" trigger source could be selected. Besides, you can also set the parameters of "Burst Period" (internal trigger), "Delay", "Trig In" (external trigger), and "Trig Out" (internal and manual trigger)."Nonetheless, it doesn't work. I tried also to EXT trigger a simpler signal (e.g., Sine) and it does work.Any idea why? And does you know how to externally trigger a "sequence" waveform?Thank you,Luca