Files
MiPi_TEST/__pycache__/rigol_scope.cpython-312.pyc

62 lines
8.4 KiB
Plaintext
Raw Normal View History

2026-04-09 08:45:57 +01:00
<EFBFBD>
2026-04-09 09:17:42 +01:00
<00>]<5D>iE<00><00><><00>UdZddlZddlZddlZddlmZdZdZdZdZ dZ
2026-04-09 08:45:57 +01:00
d Z da ejdzed
<d efd <0C>Zd <0A>Zd efd<0E>Zd<0F>Zd<10>Ze fded efd<12>Zded efd<14>Zy)u<>
rigol_scope.py
Controls the Rigol DS1202Z-E at 192.168.45.5 for 1.8 V supply rail monitoring.
Called from dual_capture() in mipi_test.py during the LP pass.
The scope is armed (single trigger) just before the Agilent LP capture.
The LP→HS current step droops the 1.8 V rail, triggering the Rigol.
The waveform is then read over SCPI and written directly to the local data/ folder.
<EFBFBD>N)<01>Pathz 192.168.45.5皙<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>ư>g)\<5C><><EFBFBD>(<28>?g.@<40>rigol<6F>returnc<00><><00> tjt<00>adt_tj d<02>j <00>}td|<00><00><02>y#t$r}td|<01><00><02>daYd}~yd}~wwxYw)N<>
z*IDN?z[RIGOL] Connected: Tu9[RIGOL] Connection failed — 1.8 V monitoring disabled: F) <09>vxi11<31>
Instrument<EFBFBD>
RIGOL_HOSTr<00>timeout<75>ask<73>strip<69>print<6E> Exception)<02>idn<64>es <20>0/home/david-rice/Python/MiPi_Test/rigol_scope.py<70>connectrsp<00><00> <15><15> <20> <20><1A>,<2C><05><1A><05> <0A><13>i<EFBFBD>i<EFBFBD><07> <20>&<26>&<26>(<28><03> <0A>#<23>C<EFBFBD>5<EFBFBD>)<29>*<2A><13><> <14><15> <0A>I<>!<21><13>M<>N<><14><05><14><><15>s<00>AA<00> A;<03>!A6<03>6A;c<00>^<00>tr tj<00>dayy#t$rY<00>wxYw<01>N)r<00>closer<00><00>r<00>
2026-04-09 09:17:42 +01:00
disconnectr-s3<00><00> <0C> <11> <11>K<EFBFBD>K<EFBFBD>M<EFBFBD><15><05>  <0A><><19> <11> <10> <11>s <00> <00> ,<03>,c<00><00>tduSr)rrrr<00> is_connectedr7s <00><00> <10><04> <1C>rc<00>Z<00>tjd<01>tjd<02>tjd<03>tjd<04>tjd<05>tjd<06>tjdtd<08><04><02>tjd t
2026-04-09 08:45:57 +01:00
d<08><04><02>tjd
2026-04-09 09:17:42 +01:00
t d <0B><04><02>tjd <0C>tjd <0A>tjd<0E>tjdtd<08><04><02>tjd<10>tjd<11>tjd<12>tjd<02>tdtt dz<00><00>dt<00>d<16><05>y)z<>
2026-04-09 08:45:57 +01:00
Configure Rigol for 1.8 V supply monitoring.
AUTO trigger sweep: if no droop occurs, scope still captures on timeout
so we always get a supply snapshot even when the rail is healthy.
2026-04-09 09:17:42 +01:00
<20>:STOPg<50><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?z:CHANnel1:DISPlay 1z:CHANnel2:DISPlay 0z:CHANnel1:COUPling DCz:CHANnel1:PROBe 1z:CHANnel1:SCALe z.3fz:CHANnel1:OFFSet z:TIMebase:MAIN:SCALe z.2Ez:TRIGger:MODE EDGEz:TRIGger:EDGe:SOURce CHANnel1z:TRIGger:EDGe:SLOPe NEGativez:TRIGger:EDGe:LEVel z:TRIGger:SWEep AUTO<54>333333<33>?<3F>:RUNz [RIGOL] Configured: 1.8 V rail, g<00><>.Au µs/div, trigger <z V falling (AUTO sweep, running)N)
2026-04-09 08:45:57 +01:00
r<00>write<74>time<6D>sleep<65> V18_SCALE<4C>
2026-04-09 09:17:42 +01:00
V18_OFFSET<EFBFBD> V18_TIMEBASE<53>V18_TRIG_LEVELr<00>intrrr<00> configurer)?s0<00><00> 
<EFBFBD>K<EFBFBD>K<EFBFBD><07><18><08>J<EFBFBD>J<EFBFBD>s<EFBFBD>O<EFBFBD> <09>K<EFBFBD>K<EFBFBD>%<25>&<26> <09>K<EFBFBD>K<EFBFBD>%<25>&<26> <09>K<EFBFBD>K<EFBFBD>'<27>(<28> <09>K<EFBFBD>K<EFBFBD>#<23>$<24> <09>K<EFBFBD>K<EFBFBD>"<22>9<EFBFBD>S<EFBFBD>/<2F>2<>3<> <09>K<EFBFBD>K<EFBFBD>#<23>J<EFBFBD>s<EFBFBD>#3<>4<>5<> <09>K<EFBFBD>K<EFBFBD>'<27> <0C>S<EFBFBD>'9<>:<3A>;<3B> <09>K<EFBFBD>K<EFBFBD>$<24>%<25> <09>K<EFBFBD>K<EFBFBD>/<2F>0<> <09>K<EFBFBD>K<EFBFBD>.<2E>/<2F> <09>K<EFBFBD>K<EFBFBD>&<26>~<7E>c<EFBFBD>&:<3A>;<3B><<3C> <09>K<EFBFBD>K<EFBFBD>%<25>&<26><08>J<EFBFBD>J<EFBFBD>s<EFBFBD>O<EFBFBD> <09>K<EFBFBD>K<EFBFBD><06><17><08>J<EFBFBD>J<EFBFBD>s<EFBFBD>O<EFBFBD> <09> ,<2C>S<EFBFBD><1C>c<EFBFBD>1A<31>-B<>,C<>D<16>$<24>%<25>%E<> G<01>Hrc<00>.<00>tjd<01>y)z<>Ensure scope is running so it is actively acquiring when the LP event occurs.
The waveform is frozen with :STOP inside read_waveform_csv() at collection time.r N)rr!rrr<00>armr+`s<00><00>
<EFBFBD>K<EFBFBD>K<EFBFBD><06>r<00> timeout_sc<00>H<00>tj<00>|z}tj<00>|kre tjd<01>j<00>j <00>}|dvry tj d<04>tj<00>|kr<01>ey#t
2026-04-09 08:45:57 +01:00
$rY<00>9wxYw)z<>
Poll until the scope has completed its single acquisition.
DS1000Z reports STOP when done (triggered or auto-timed-out).
Returns True when ready, False if timeout exceeded.
2026-04-09 09:17:42 +01:00
z:TRIGger:STATus?)<02>STOP<4F>TDTrF)r"rr r<00>upperrr#)r,<00>deadline<6E>statuss r<00> wait_capturedr3fs<><00><00> <14>y<EFBFBD>y<EFBFBD>{<7B>Y<EFBFBD>&<26>H<EFBFBD>
2026-04-09 08:45:57 +01:00
<0E>)<29>)<29>+<2B><08>
<20> <11><1A>Y<EFBFBD>Y<EFBFBD>1<>2<>8<>8<>:<3A>@<40>@<40>B<>F<EFBFBD><15><1E>'<27><1B>(<28> <0A>
<EFBFBD>
<EFBFBD>3<EFBFBD><0F> <0F>)<29>)<29>+<2B><08>
2026-04-09 09:17:42 +01:00
<20> <11><><19> <11> <10> <11>s<00>5B<00> B!<03> B!<03>pathc<00><><00> tjd<01>tjd<02>tjd<03>tjd<04>tjd<05> tj d <09>j<00>}t d
|<02><00><02>|jd <0B>}t|d <00>}t|d <00>}t|d<00>} tj d<10>j<00>}t dt|<07><00>d|dd<00><02><04>|jd<14>rt|d<00>}|d|zd}|jd <0B>D<00> cgc]} | j<00>s<01>t| <09><00><02> }
} t dt|
<EFBFBD><00>d<18><03>|
s t d<1A>y |jjd<1B><1C>t|dd<1E><1F>5} t!j"| <0B>} | j%d d!g<02>t'|
<EFBFBD>D]'\} } || |z
|zz}| j%|d"<22>| d#<23>g<02><00>) ddd<07>t|
<EFBFBD>S#t$r}t d|<01><00><02>Yd}~yd}~wwxYw#t$r}t d|<01><00><02>Yd}~yd}~wwxYwcc} w#t$r}t d|<01><00><02>Yd}~yd}~wwxYw#1swY<00><>xYw#t$r}t d$|<01><00><02>Yd}~yd}~wwxYw)%u
2026-04-09 08:45:57 +01:00
Read Ch1 waveform from Rigol over SCPI and write to CSV.
2026-04-09 09:17:42 +01:00
Sends :STOP first to ensure acquisition is complete before reading —
this is reliable regardless of trigger/status state.
2026-04-09 08:45:57 +01:00
Returns the number of samples written, or 0 on error.
2026-04-09 09:17:42 +01:00
rrz:WAVeform:SOURce CHANnel1z:WAVeform:FORMat ASCrz[RIGOL] Waveform setup error: Nrz:WAVeform:PREamble?z[RIGOL] Preamble: <20>,<2C><00><00>z[RIGOL] Preamble error: z:WAVeform:DATA?z[RIGOL] Data response length: z chars, first 60: <20><<00>#<23><00>z[RIGOL] Parsed z samplesz[RIGOL] Data read error: uE[RIGOL] No samples parsed — check scope channel and format settingsT)<01>exist_ok<6F>w<>)<01>newlinezTime (s)z Voltage (V)z.9fz.6fz[RIGOL] CSV write error: )rr!r"r#rrr r<00>split<69>float<61>len<65>
startswithr(<00>parent<6E>mkdir<69>open<65>csv<73>writer<65>writerow<6F> enumerate)r4r<00> preamble_raw<61>preamble<6C>x_incr<63>x_orig<69>x_ref<65>raw<61>n_digits<74>v<>vals<6C>frJ<00>i<>ts r<00>read_waveform_csvrYxs<><00><00>
<11> <0A> <0B> <0B>G<EFBFBD><1C> <0C>
<EFBFBD>
<EFBFBD>3<EFBFBD><0F> <0A> <0B> <0B>/<2F>0<> <0A> <0B> <0B>*<2A>+<2B> <0C>
<EFBFBD>
<EFBFBD>3<EFBFBD><0F> <11><1C>y<EFBFBD>y<EFBFBD>!6<>7<>=<3D>=<3D>?<3F> <0C> <0A>"<22><<3C>.<2E>1<>2<><1F>%<25>%<25>c<EFBFBD>*<2A><08><17>x<EFBFBD><01>{<7B>#<23><06><16>x<EFBFBD><01>{<7B>#<23><06><16>x<EFBFBD><01>{<7B>#<23><05>
<11><13>i<EFBFBD>i<EFBFBD>)<29>*<2A>0<>0<>2<><03> <0A>.<2E>s<EFBFBD>3<EFBFBD>x<EFBFBD>j<EFBFBD>8J<38>3<EFBFBD>s<EFBFBD>PR<50>8<EFBFBD>,<2C>W<>X<> <0F>><3E>><3E>#<23> <1E><1A>3<EFBFBD>q<EFBFBD>6<EFBFBD>{<7B>H<EFBFBD><15>a<EFBFBD>(<28>l<EFBFBD>m<EFBFBD>$<24>C<EFBFBD>"%<25>)<29>)<29>C<EFBFBD>.<2E>><3E>Q<EFBFBD>A<EFBFBD>G<EFBFBD>G<EFBFBD>I<EFBFBD><05>a<EFBFBD><08>><3E><04>><3E> <0A><0F><03>D<EFBFBD> <09>{<7B>(<28>3<>4<>
<10> <0A>U<>V<><10> <11> <0C> <0B> <0B><19><19>4<EFBFBD><19>(<28> <11>$<24><03>R<EFBFBD> (<28> :<3A>A<EFBFBD><18>Z<EFBFBD>Z<EFBFBD><01>]<5D>F<EFBFBD> <12>O<EFBFBD>O<EFBFBD>Z<EFBFBD><1D>7<> 8<>!<21>$<24><0F> :<3A><04><01>1<EFBFBD><1A>a<EFBFBD>%<25>i<EFBFBD>6<EFBFBD>1<>1<><01><16><0F><0F>A<EFBFBD>c<EFBFBD>7<EFBFBD><01>#<23>w<EFBFBD> 8<>9<> :<3A> :<3A> <13>4<EFBFBD>y<EFBFBD><18><>Y <15><11> <0A>.<2E>q<EFBFBD>c<EFBFBD>2<>3<><10><><11><> <15><11> <0A>(<28><11><03>,<2C>-<2D><10><><11><>?<3F><> <14><11> <0A>)<29>!<21><13>-<2D>.<2E><10><><11><> :<3A> :<3A><> <15><11> <0A>)<29>!<21><13>-<2D>.<2E><10><><11>s<EFBFBD><00>A)H;<00>,A,I<00>A:J<00>J<04>) J<04>6J<00>*J8<00> AJ,<03>(J8<00>; I<03>I<03>I<03> J<03>(I;<03>;J<03>J<00> J)<03>J$<03>$J)<03>,J5<07>1J8<00>8 K<03>K<03>K)<19>__doc__rIr"r <00>pathlibrr r$r%r&r'<00>TRIG_TIMEOUT_Srr
<00>__annotations__<5F>boolrrrr)r+rCr3r(rYrrr<00><module>r_s<><00><01> <04> <0B> <0B> <0C><18><1F>
2026-04-09 08:45:57 +01:00
<EFBFBD><14> <09><15>
2026-04-09 09:17:42 +01:00
<EFBFBD><15> <0C><15><0E><15><0E>!%<25><05>u<EFBFBD><17><17>$<24><1E>%<25> <15><14> <15><15><1D>d<EFBFBD><1D>H<01>B<18> &4<><11>U<EFBFBD><11><04><11>$?<11>D<EFBFBD>?<11>S<EFBFBD>?r