-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tested scope acquisition from Red Pitaya
- Loading branch information
Showing
3 changed files
with
1,123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import time | ||
import matplotlib.pyplot as plt | ||
import redpitaya_scpi as scpi | ||
|
||
IP = 'rp-f0c04a.local' | ||
rp_s = scpi.scpi(IP) | ||
print('Connected to ' + IP) | ||
|
||
wave_form = 'sine' | ||
freq = 1000000 | ||
ampl = 1 | ||
|
||
# Reset Generation and Acquisition | ||
rp_s.tx_txt('GEN:RST') | ||
rp_s.tx_txt('ACQ:RST') | ||
|
||
##### Generation ##### | ||
# Function for configuring Source | ||
rp_s.sour_set(1, wave_form, ampl, freq, burst=True, ncyc=3) | ||
|
||
##### Acqusition ##### | ||
# Function for configuring Acquisition | ||
rp_s.acq_set(dec=1, trig_lvl=0, trig_delay=0) | ||
|
||
rp_s.tx_txt('ACQ:START') | ||
time.sleep(1) | ||
rp_s.tx_txt('ACQ:TRig AWG_PE') | ||
rp_s.tx_txt('OUTPUT1:STATE ON') | ||
time.sleep(1) | ||
|
||
rp_s.tx_txt('SOUR1:TRig:INT') | ||
|
||
# Wait for trigger | ||
while 1: | ||
rp_s.tx_txt('ACQ:TRig:STAT?') # Get Trigger Status | ||
if rp_s.rx_txt() == 'TD': # Triggerd? | ||
break | ||
|
||
## ! OS 2.00 or higher only ! ## | ||
while 1: | ||
rp_s.tx_txt('ACQ:TRig:FILL?') | ||
if rp_s.rx_txt() == '1': | ||
break | ||
|
||
# Read data and plot | ||
# function for Data Acquisition | ||
data = rp_s.acq_data(1, convert= True) | ||
|
||
plt.plot(data) | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import time | ||
import redpitaya_scpi as scpi | ||
|
||
IP = 'rp-f0c04a.local' | ||
rp_s = scpi.scpi(IP) | ||
|
||
if (len(sys.argv) > 2): | ||
led = int(sys.argv[2]) | ||
else: | ||
led = 0 | ||
|
||
print ("Blinking LED["+str(led)+"]") | ||
|
||
period = 1 # seconds | ||
|
||
while 1: | ||
time.sleep(period/2.0) | ||
rp_s.tx_txt('DIG:PIN LED' + str(led) + ',' + str(1)) | ||
time.sleep(period/2.0) | ||
rp_s.tx_txt('DIG:PIN LED' + str(led) + ',' + str(0)) | ||
|
||
rp_s.close() |
Oops, something went wrong.