Skip to content

Commit

Permalink
rigol yea, dj pauly d yea
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Jun 10, 2018
1 parent a577583 commit 55da0b6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
26 changes: 26 additions & 0 deletions tests/gmbitbang/rigol.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
import numpy as np
import visa
import matplotlib.pyplot as plt

resources = visa.ResourceManager()
print resources.list_resources()

scope = resources.open_resource('USB0::0x1AB1::0x04CE::DS1ZA184652242::INSTR', timeout=2000, chunk_size=1024000)
print(scope.query('*IDN?').strip())

#voltscale = scope.ask_for_values(':CHAN1:SCAL?')[0]
#voltoffset = scope.ask_for_values(":CHAN1:OFFS?")[0]

#scope.write(":STOP")
scope.write(":WAV:POIN:MODE RAW")
scope.write(":WAV:DATA? CHAN1")[10:]
rawdata = scope.read_raw()
data = np.frombuffer(rawdata, 'B')
print data.shape
plt.plot(data)
plt.show()
#data = (data - 130.0 - voltoffset/voltscale*25) / 25 * voltscale

print data

19 changes: 7 additions & 12 deletions tests/gmbitbang/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
p2.set_gmlan(bus=2)

# send w bitbang then without
p1.set_gmlan(bus=None)
p1.can_send(20, "\x01", bus=3)
p1.set_gmlan(bus=2)
p1.can_send(20, "\x01", bus=3)
#time.sleep(0.1)
#p1.set_gmlan(bus=None)
#p1.can_send(20, "\x01", bus=3)

# test echo
# (to send on GMLAN, set bus=3)
time.sleep(0.1)
print p2.can_recv()
while 1:
p1.set_gmlan(bus=None)
p1.can_send(20, "\x01", bus=3)
p1.set_gmlan(bus=2)
p1.can_send(20, "\x01", bus=3)
time.sleep(0.01)
print p2.can_recv()

0 comments on commit 55da0b6

Please sign in to comment.