I noticed for both, the standard Mac GUI and the API, that the picoscope is found at start only every ~10th trial.
In addition, if I do not unplug the USB within trials, I get an segmentation fault.
I work on a Mac 10.9.5 and
DriverVersion : PS6000 MacOSX Driver, 1.4.6.13
USBVersion : 2.0
HardwareVersion : 1 1
VariantInfo : 6404B
BatchAndSerial : AU668/014
CalDate : 20Nov12
KernelVersion : 0.0
DigitalHardwareVersion : 1
AnalogueHardwareVersion : 1
PicoFirmwareVersion1 : 1.1.5.0
PicoFirmwareVersion2 : 1.1.30.0
Which version of the PicoScope 6 for Mac software are you using (click Help -> About PicoScope 6 Beta...)?
On the next occasion where the device is not recognised, please close down the software, then locate the trace.xml file and post it here or e-mail it to support@picotech.com
Does your Mac have USB 2.0 ports or USB 3.0 ports.
I changed to Mono 4.0.4. I still have to open the GUI or my own application several times until they find the device. In addition I still get segmentation faults. However, both is reduced in number.
I will post the screenshot as soon as I do the next measurement.
here are the Screenshots from the Segm. Fault I get from my terminal application and from your Application.
BTW: I tested the software and my terminal application on Linux Debian and Windows 7.
I get the same problems there (a few starts without recognizing the Picoscope).
it gets better (still not perfect) on Mac when I turn off power for the picoscope, deconnect the USB and execute
$ pkill -9 python
Then I connect everything again and wait for 5 seconds.
Does the issue occur on the Windows 7 PC with the PicoScope 6 software is run and before any Python code is executed, or does it only occur with the PicoScope 6 software after a Python session has been run?
If it only occurs when a Python session has been run, the application could have a lock on the driver. It might be useful to see your code - please post it here or e-mail support@picotech.com
I answered this to support, but it might be interesting for others too:
The issue doesn’t occur on Windows and I rarely tested on Linux.
Thus, it seems to be a Mac (or python implementation on Mac) problem, since I’m using the exact same program on all computers.
The problem is reduced when I unplug and plug the power of the scope and then do pkill -9 python.
However I still need about 5 attempts to start the scope.
The code to start the scope is the following:
def _lowLevelOpenUnit(self, sn):
c_handle = c_int16()
if sn is not None:
serialNullTermStr = create_string_buffer(sn)
else:
serialNullTermStr = None
# Passing None is the same as passing NULL
trials=5; i=0; m=1
while int(m)!=0: # this loop is necessary since the device is often not found on mac.
m = self.lib.ps6000OpenUnit(byref(c_handle), serialNullTermStr) # at this point the program crashes regularly with segmentation fault
i+=1
if i>=trials: break
if m!=0:
print(i,"No picoscope found. Unplug and plug the power of scope and the usb connector at the computer. Then do pkill -9 python.")
self.checkResult(m)
self.handle = c_handle.value
Before that I initialize dependent on the platform:
def __init__(self, serialNumber=None, connect=True):
""" Load DLLs. """
if platform.system() == 'Linux':
from ctypes import cdll
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".so.2")
elif platform.system()=="Darwin": # obi
from ctypes import cdll
import os
print("If the following fails do:\n$ export DYLD_FALLBACK_LIBRARY_PATH=/Applications/PicoScope6.app/Contents/Resources/lib/\n")
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".dylib")
else:
from ctypes import windll
self.lib = windll.LoadLibrary(self.LIBNAME + ".dll")
I finally upgraded my OS to 10.12 (Sierra) and switched to work with Python3.
This solved the issue of not finding the device and getting a segmentation fault instead.