1. Safety
- Use Disable every connected channel before changing cabling.
- Software disconnect does not guarantee a physical output is off.
- This application is not a safety-rated interlock.
- Global enable requires confirmation; disable and disconnect controls are red.
2. Install and launch
py -m pip install cds_rigol_dg1022z
cds_rigol_dg1022z_state_manager
This second application is included beside the full control GUI, cds_rigol_dg1022z_gui. Its title shows the installed package version. The same dedicated three-AWG artwork is used for the GUI window, taskbar, and executable icon. Transparent PB LAB and Chip Design Systems marks are integrated into the bottom of the main GUI, with PB LAB aligned left and CDS aligned right.
3. AWG Control tab
First launch creates three AWG cards. Add more with Add AWG. Each card owns its name, transport, endpoint, device connection, RSF picker, outputs, and session log.
- Name the AWG.
- Select Ethernet or USB.
- Select a discovered endpoint or enter an Ethernet IP.
- Connect. Endpoint controls lock until red Disconnect is used.
- Refresh/recall an RSF or operate the outputs.
Cards can be removed only while disconnected. Duplicate live USB serials and Ethernet addresses are rejected.
4. Discovery and connections
USB and Ethernet scans run automatically after startup. Scan USB and Ethernet repeats both scans at any time.
Ethernet discovery probes local and saved-address IPv4 /24 networks on SCPI port 5555 and verifies *IDN?. Routed networks may require a manual IP. USB discovery combines VISA/UltraSigma and direct USB-TMC, preferring VISA when it owns the Windows interface.
from cds_rigol_dg1022z import DG1022Z, discover_ethernet, discover_usb_connections
print(discover_ethernet())
print(discover_usb_connections())
awg = DG1022Z.ethernet("192.168.1.100")
awg.open()
5. Internal RSF states
After connection, Refresh RSF files lists populated USER1-USER10 slots. Select one and choose Recall selected RSF. The warning defaults to cancel.
states = awg.internal_state_files()
for state in states:
print(state.slot, state.filename)
awg.recall_internal_state(states[0].slot)
The generator front panel is authoritative because an RSF may contain settings outside this focused GUI.
6. Output controls
| Control | Scope and behavior |
|---|---|
| CH1 / CH2 | One channel on one AWG; reported state is verified. |
| Enable both | One AWG; confirmation required. |
| Disable both | One AWG; red immediate control. |
| Enable every connected channel | All AWGs; one confirmation. |
| Disable every connected channel | All AWGs; red immediate control. |
for awg in connected_awgs:
awg.channel(1).output_enabled = True
awg.channel(2).output_enabled = True
for awg in connected_awgs:
awg.outputs_off()
7. Flash RSF Import tab
- Insert a flash drive into the selected Rigol USB host port.
- Select a connected AWG.
- Enter
D:\orD:\STATES. - List files, select an RSF and USER destination.
- Select Load RSF and save internally and confirm.
files = awg.external_state_files("D:\\STATES")
selected = files[0]
awg.import_external_state(selected.filename, slot=4, directory=selected.directory)
*SAV USERn.8. Saved application settings
Card names, order, transport, and USB identifier or Ethernet address are saved in per-user Qt settings whenever they change and during clean shutdown. They return on restart. If a saved device is powered off, its identifier remains assigned to the same card and is shown as unavailable. After it is powered on, the next scan automatically reselects it on that same card.
Connections and outputs deliberately do not reactivate automatically. Removing a card removes it from the next launch. With no saved configuration, three cards are created.
9. Activity and Diagnostics tab
Select a connected AWG to view its live device-specific log. Logs include connections, SCPI traffic, RSF actions, outputs, failures, and cleanup. Query device errors drains that generator's SCPI error queue.
%USERPROFILE%\PB_LAB\DG1022Z_Control\logs
Open documentation displays this exact HTML page in the GUI.
10. Complete three-AWG Python workflow
from contextlib import ExitStack
from cds_rigol_dg1022z import DG1022Z
addresses = ["192.168.1.101", "192.168.1.102", "192.168.1.103"]
with ExitStack() as stack:
awgs = [stack.enter_context(DG1022Z.ethernet(ip)) for ip in addresses]
for awg in awgs:
print(awg.identify())
states = awg.internal_state_files()
if states:
awg.recall_internal_state(states[0].slot)
try:
for awg in awgs:
awg.channel(1).output_enabled = True
finally:
for awg in awgs:
awg.outputs_off()
11. Standalone executable
py -m pip install -e ".[build]"
pyinstaller --noconfirm AWG_State_Manager.spec
The build produces dist\PB-LAB-AWG-State-Manager.exe with Python, Qt, icon, HTML/PDF documentation, and USB dependencies. Ethernet needs no driver. USB still requires a compatible Windows interface or VISA runtime.
12. Troubleshooting
AWG not discovered
Rescan, verify the rear USB Device connection or Ethernet port 5555, and enter a known IP manually.
Flash drive not found
Use the Rigol USB host port, confirm the drive appears on its front panel, and start with D:\.
Import fails
Query errors; verify the RSF, directory, attached drive, and that the internal destination is unlocked.
Unexpected output
Use physical output keys and the red global disable control, then inspect the selected AWG log and error queue.