Skip to content

Commit 7fdfbe3

Browse files
author
neil.hamilton
committed
2 parents 276cfb9 + 9580f60 commit 7fdfbe3

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ libraries.
2424
## Installing the python driver bindings
2525

2626
A `distutils` installer is provided. After you have installed the PicoSDK
27-
driver package (see above), the Python installer can be used as follows:
27+
driver package (see above), the Python package can be installed using the
28+
following command in the top-level directory:
2829

29-
python setup.py install
30+
pip install .
3031

32+
If you are not using a virtualenv or are not elevated, use:
33+
=======
3134
For using the AS108 you will need to use the following as well:
3235

3336
python setupPicosynth.py install
@@ -37,13 +40,13 @@ On macOS and Linux you will either need to use `sudo` with this command, to
3740
install into the system folders, or to install for the current user only you
3841
can use:
3942

40-
python setup.py install --user
43+
pip install . --user
4144

4245
Within python, the library for `import` is called `picosdk`.
4346

4447
## Compatibility
4548

46-
This code is written to be compatible with both python 2.7 and python 3 (any version).
49+
This code is written to be compatible with both Python 2.7 and Python 3 (any version).
4750

4851
If you find a compatibility problem please raise an [Issue](https://www.picotech.com/tech-support), listing all the versions you can find (python, numpy,
4952
picosdk commit hash, etc.) and your error message(s).
@@ -72,7 +75,7 @@ The following drivers and devices are not yet supported:
7275

7376
### Dependencies
7477

75-
As well as depending on the C libraries, the Pythonic wrappers use some python libraries like `numpy`. Many of the
78+
As well as depending on the C libraries, the Python wrappers use some Python libraries like `numpy`. Many of the
7679
examples scripts also use the `matplotlib` plotting library. You can install these dependencies with pip as follows:
7780

7881
pip install -r requirements.txt

ps3000aExamples/ps3000aBlockMSOExample.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
0)
9999
assert_pico_ok(status["SetDataBuffers"])
100100

101-
print "Starting data collection..."
101+
print ("Starting data collection...")
102102

103103
# Starts the block capture
104104
# handle = chandle
@@ -143,7 +143,7 @@
143143
status["GetValues"] = ps.ps3000aGetValues(chandle, 0, ctypes.byref(cTotalSamples), 1, 0, 0, ctypes.byref(overflow))
144144
assert_pico_ok(status["GetValues"])
145145

146-
print "Data collection complete."
146+
print ("Data collection complete.")
147147

148148
# Obtain binary for Digital Port 0
149149
# The tuple returned contains the channels in order (D7, D6, D5, ... D0).
@@ -154,7 +154,7 @@
154154

155155
# Plot the data from digital channels onto a graph
156156

157-
print "Plotting data..."
157+
print ("Plotting data...")
158158

159159
plt.figure(num='PicoScope 3000 Series (A API) MSO Block Capture Example')
160160
plt.title('Plot of Digital Port 0 digital channels vs. time')
@@ -171,7 +171,7 @@
171171
plt.legend(loc="upper right")
172172
plt.show()
173173

174-
print "Close figure to stop the device and close the connection."
174+
print ("Close figure to stop the device and close the connection.")
175175

176176
# Stops the scope
177177
# handle = chandle

ps5000aExamples/ps5000aRapidBlockExample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
# MaxSamples = ctypes.byref(returnedMaxSamples)
8181
# Segement index = 0
8282
timeIntervalns = ctypes.c_float()
83-
returnedMaxSamples = ctypes.c_int16()
83+
returnedMaxSamples = ctypes.c_int32()
8484
status["GetTimebase"] = ps.ps5000aGetTimebase2(chandle, timebase, maxsamples, ctypes.byref(timeIntervalns), ctypes.byref(returnedMaxSamples), 0)
8585
assert_pico_ok(status["GetTimebase"])
8686

@@ -288,7 +288,7 @@
288288
# Timeunits = TimeUnits = ctypes.c_char() = ctypes.byref(TimeUnits)
289289
# Fromsegmentindex = 0
290290
# Tosegementindex = 9
291-
Times = (ctypes.c_int16*10)()
291+
Times = (ctypes.c_int64*10)()
292292
TimeUnits = ctypes.c_char()
293293
status["GetValuesTriggerTimeOffsetBulk"] = ps.ps5000aGetValuesTriggerTimeOffsetBulk64(chandle, ctypes.byref(Times), ctypes.byref(TimeUnits), 0, 9)
294294
assert_pico_ok(status["GetValuesTriggerTimeOffsetBulk"])

ps6000Examples/ps6000SigGen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
triggerSource = ctypes.c_int32(0)
7272

7373
status["SetSigGenBuiltIn"] = ps.ps6000SetSigGenBuiltIn(chandle, 0, 2000000, wavetype, 10000, 10000, 0, 1, sweepType, 0, 0, 0, triggertype, triggerSource, 1)
74-
assert_pico_ok(status["SetSignGenBuiltIn"])
74+
assert_pico_ok(status["SetSigGenBuiltIn"])
7575

7676
# Pauses the script to show signal
7777
time.sleep(10)

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@
3232
author='Pico Technology Ltd',
3333
author_email='[email protected]',
3434
url='https://www.picotech.com',
35-
packages=['picosdk'])
35+
packages=['picosdk'],
36+
install_requires=['numpy>=1.12.1'])

0 commit comments

Comments
 (0)