Test and Measurement Forum

Device often not found - Segmentation fault

Discussion forum for the new Picoscope Mac software

Device often not found - Segmentation fault

Postby Anna » Fri Sep 16, 2016 12:12 pm

Hi,

I started to work with a PicoScope 6404B and to write my own DAQ for a photomultiplier.
I use the python API from here https://github.com/colinoflynn/pico-python.

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

Do you have any idea, why this is caused?

Best,

Anna
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am

Re: Device often not found - Segmentation fault

Postby Hitesh » Mon Sep 19, 2016 11:39 am

Hi Anna,

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.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Device often not found - Segmentation fault

Postby Anna » Fri Oct 21, 2016 1:44 pm

Hi,

The Version is "PicoScope® 6 - PC Oscilloscope software version: 6.11.13.2"
USB Version: 20,0
Hardware Version: 1 1
Driver Version: PS6000 MacOSX Driver, 1.4.6.13
Firmware Version: 1.1.5.0 / 1.1.30.0

The Computer is a MacBook Pro 13'' Mid 2012 with USB 3.0.

The trace is attached. I copied after the last segmentation fault. However, the last-changed-time of this file is from an slightly earlier attempt:

<?xml version="1.0" encoding="utf-8" standalone="yes"?><document>
<event time="21.10.16 15:33:30.669" level="Info">Trace opened 21.10.2016.</event>
<event time="21.10.16 15:33:30.670" category="Environment" level="Info">Running on Mono - True</event>
<event time="21.10.16 15:33:30.670" category="Environment" level="Info">Mono Display Name - 4.4.2 (mono-4.4.0-branch-c7sr1/f72fe45 Wed Jul 27 16:20:13 EDT 2016)</event>
<event time="21.10.16 15:33:30.670" category="Environment" level="Info">Host Operating System - MacOSX</event>
<event time="21.10.16 15:33:30.670" category="Environment" level="Info">64Bit Operating System - False</event>
<event time="21.10.16 15:33:30.670" category="Environment" level="Info">64Bit Process - False</event>
<event time="21.10.16 15:33:30.670" category="Environment" level="Info">Logical Processors - 4</event>
<event time="21.10.16 15:33:30.750" category="ApplicationInfo" level="Info">Application 'PicoScope 6 Beta' (version 6.11.13.2) starting.</event>
<event time="21.10.16 15:33:30.758" category="ID" level="Info">93B885ADFE0DA089CDF634904FD59F71</event>
<event time="21.10.16 15:33:30.759" category="Environment" level="Info">User is not Guest</event>
<event time="21.10.16 15:33:30.760" category="Environment" level="Info">No Administrator Privileges</event>
<event time="21.10.16 15:33:30.760" category="Environment" level="Info">Failed to detect access rights</event>
<event time="21.10.16 15:33:30.774" category="Environment" level="Info">OS Version - ProductName: Mac OS X ProductVersion: 10.9.5 BuildVersion: 13F1603 </event>
<event time="21.10.16 15:33:30.774" category="Environment" level="Info">.net Version - 4.0.30319.42000</event>
<event time="21.10.16 15:33:30.775" category="Environment" level="Info">Current Directory - /Applications/PicoScope6.app/Contents/Resources/lib</event>
<event time="21.10.16 15:33:30.775" category="Environment" level="Info">Command Line - /Applications/PicoScope6.app/Contents/Resources/lib/PicoScope.GTK.exe</event>
<event time="21.10.16 15:33:30.775" category="ApplicationInfo" level="Info">Settings file version - 11.2.0</event>
<event time="21.10.16 15:33:30.775" category="ApplicationInfo" level="Info">Preferences file version - 2.0.0</event>
<event time="21.10.16 15:33:30.775" category="ApplicationInfo" level="Info">Probes file version - 1.0.0</event>
<event time="21.10.16 15:33:30.775" category="ApplicationInfo" level="Info">Data file binary header version - 1</event>
<event time="21.10.16 15:33:30.852" level="Info">Using default culture: English (United States).</event>
<event time="21.10.16 15:33:31.391" category="InitalDeviceLoadSequence" level="Info">Begin</event>
<event time="21.10.16 15:33:31.440" category="Scanning for USB devices" level="Info">Begin</event>
<event time="21.10.16 15:33:31.443" category="Scanning for USB devices" level="Info">Complete</event>
<event time="21.10.16 15:33:31.447" category="Device" level="Info">Attempting to load ps6000.dll</event>
<event time="21.10.16 15:33:31.523" category="Device" level="Info">Finished loading ps6000.dll</event>
<event time="21.10.16 15:33:31.524" category="Device" level="Info">Opening device using DLL ps6000.dll</event>
<event time="21.10.16 15:33:33.854" category="Device" level="Info">Opening device successful. Error NoError.</event>
<event time="21.10.16 15:33:33.854" category="Device" level="Info">Device opened AU668/014: PS6000 PS6404B PS6000</event>
<event time="21.10.16 15:33:33.854" category="Device" level="Info">Attempting to load ps6000.dll</event>
<event time="21.10.16 15:33:33.925" category="Device" level="Info">Finished loading ps6000.dll</event>
<event time="21.10.16 15:33:33.925" category="Device" level="Info">Opening device using DLL ps6000.dll</event>
<event time="21.10.16 15:33:33.941" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:33.944" category="Device" level="Info">Attempting to load ps6000.dll</event>
<event time="21.10.16 15:33:34.014" category="Device" level="Info">Finished loading ps6000.dll</event>
<event time="21.10.16 15:33:34.014" category="Device" level="Info">Opening device using DLL ps6000.dll</event>
<event time="21.10.16 15:33:34.029" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:34.031" category="Device" level="Info">Attempting to load ps5000a.dll</event>
<event time="21.10.16 15:33:34.120" category="Device" level="Info">Finished loading ps5000a.dll</event>
<event time="21.10.16 15:33:34.120" category="Device" level="Info">Opening device using DLL ps5000a.dll</event>
<event time="21.10.16 15:33:34.128" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:34.128" category="Device" level="Info">Attempting to load ps5000.dll</event>
<event time="21.10.16 15:33:34.147" category="Device" level="Info">Finished loading ps5000.dll</event>
<event time="21.10.16 15:33:34.147" category="Device" level="Info">Opening device using DLL ps5000.dll</event>
<event time="21.10.16 15:33:34.531" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:34.532" category="Device" level="Info">Attempting to load ps4000a.dll</event>
<event time="21.10.16 15:33:34.614" category="Device" level="Info">Finished loading ps4000a.dll</event>
<event time="21.10.16 15:33:34.614" category="Device" level="Info">Opening device using DLL ps4000a.dll</event>
<event time="21.10.16 15:33:34.635" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:34.635" category="Device" level="Info">Attempting to load ps4000a.dll</event>
<event time="21.10.16 15:33:34.698" category="Device" level="Info">Finished loading ps4000a.dll</event>
<event time="21.10.16 15:33:34.698" category="Device" level="Info">Opening device using DLL ps4000a.dll</event>
<event time="21.10.16 15:33:34.719" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:34.722" category="Device" level="Info">Attempting to load ps4000.dll</event>
<event time="21.10.16 15:33:34.754" category="Device" level="Info">Finished loading ps4000.dll</event>
<event time="21.10.16 15:33:34.755" category="Device" level="Info">Opening device using DLL ps4000.dll</event>
<event time="21.10.16 15:33:34.760" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:34.761" category="Device" level="Info">Attempting to load ps3000a.dll</event>
<event time="21.10.16 15:33:34.879" category="Device" level="Info">Finished loading ps3000a.dll</event>
<event time="21.10.16 15:33:34.879" category="Device" level="Info">Opening device using DLL ps3000a.dll</event>
<event time="21.10.16 15:33:34.924" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:34.924" category="Device" level="Info">Attempting to load ps3000a.dll</event>
<event time="21.10.16 15:33:35.024" category="Device" level="Info">Finished loading ps3000a.dll</event>
<event time="21.10.16 15:33:35.024" category="Device" level="Info">Opening device using DLL ps3000a.dll</event>
<event time="21.10.16 15:33:35.068" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.068" category="Device" level="Info">Attempting to load ps3000a.dll</event>
<event time="21.10.16 15:33:35.165" category="Device" level="Info">Finished loading ps3000a.dll</event>
<event time="21.10.16 15:33:35.165" category="Device" level="Info">Opening device using DLL ps3000a.dll</event>
<event time="21.10.16 15:33:35.205" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.205" category="Device" level="Info">Attempting to load ps3000a.dll</event>
<event time="21.10.16 15:33:35.304" category="Device" level="Info">Finished loading ps3000a.dll</event>
<event time="21.10.16 15:33:35.304" category="Device" level="Info">Opening device using DLL ps3000a.dll</event>
<event time="21.10.16 15:33:35.346" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.347" category="Device" level="Info">Attempting to load ps3000.dll</event>
<event time="21.10.16 15:33:35.366" category="Device" level="Info">Finished loading ps3000.dll</event>
<event time="21.10.16 15:33:35.366" category="Device" level="Info">Opening device using DLL ps3000.dll</event>
<event time="21.10.16 15:33:35.382" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.382" category="Device" level="Info">Attempting to load ps2000a.dll</event>
<event time="21.10.16 15:33:35.534" category="Device" level="Info">Finished loading ps2000a.dll</event>
<event time="21.10.16 15:33:35.534" category="Device" level="Info">Opening device using DLL ps2000a.dll</event>
<event time="21.10.16 15:33:35.535" category="Message" level="Info">Opening PS2000a.dll</event>
<event time="21.10.16 15:33:35.546" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.546" category="Device" level="Info">Attempting to load ps2000.dll</event>
<event time="21.10.16 15:33:35.578" category="Device" level="Info">Finished loading ps2000.dll</event>
<event time="21.10.16 15:33:35.579" category="Device" level="Info">Opening device using DLL ps2000.dll</event>
<event time="21.10.16 15:33:35.594" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.595" category="Device" level="Info">Attempting to load usbdrdaq.dll</event>
<event time="21.10.16 15:33:35.606" category="Device" level="Info">Finished loading usbdrdaq.dll</event>
<event time="21.10.16 15:33:35.606" category="Device" level="Info">Opening device using DLL usbdrdaq.dll</event>
<event time="21.10.16 15:33:35.610" category="Device" level="Info">usbdrdaq.dll OpenUnit returned 3</event>
<event time="21.10.16 15:33:35.611" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.611" category="Device" level="Info">Attempting to load pl1000.dll</event>
<event time="21.10.16 15:33:35.620" category="Device" level="Info">Finished loading pl1000.dll</event>
<event time="21.10.16 15:33:35.620" category="Device" level="Info">Opening device using DLL pl1000.dll</event>
<event time="21.10.16 15:33:35.625" category="Device" level="Info">Opening device unsuccessful. Error UnitNotFound</event>
<event time="21.10.16 15:33:35.625" category="Device" level="Info">No of Devices Found: 1</event>
<event time="21.10.16 15:33:35.626" category="Device" level="Info">Device selected: PS6404B, AU668/014</event>
<event time="21.10.16 15:33:35.626" level="Info">Driver: ps6000.dll Version: PS6000 MacOSX Driver, 1.4.6.13&#x2;</event>
<event time="21.10.16 15:33:35.626" level="Info">Kernel driver: picopp.sys Version: PS6000 MacOSX Driver, 1.4.6.13&#x2;</event>
<event time="21.10.16 15:33:35.626" category="InitalDeviceLoadSequence" level="Info">Complete</event>
<event time="21.10.16 15:33:37.067" level="Info">Trigger set to : NonAdvancedEdge</event>
<event time="21.10.16 15:33:37.097" level="Info">Source/Channel Index Changed to 0</event>
<event time="21.10.16 15:33:37.101" level="Info">Trigger Direction set to Rising</event>
<event time="21.10.16 15:33:37.170" category="PowerManagement" level="Info">Probe light manager changed light state to True</event>
<event time="21.10.16 15:33:37.179" level="Info">Trigger set to : NonAdvancedEdge</event>
<event time="21.10.16 15:34:52.758">Trace Closing</event>
</document>closed.</event>
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am

Re: Device often not found - Segmentation fault

Postby Hitesh » Mon Oct 24, 2016 4:26 pm

Hi Anna,

This might be due to the Mono installation.

Try using Mono version 4.0.4.

Where does the segmentation fault appear - in a terminal window?

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Device often not found - Segmentation fault

Postby Anna » Tue Oct 25, 2016 8:07 am

Hi,

in appears in both, Terminal and when I start your GUI.

Regards,

Anna
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am

Re: Device often not found - Segmentation fault

Postby Hitesh » Tue Oct 25, 2016 8:36 am

Hi Anna,

Could you post a screenshot of the error message in both cases?

Thanks,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Device often not found - Segmentation fault

Postby Anna » Tue Oct 25, 2016 12:23 pm

Hi,

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.

Best regards,

Anna
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am

Re: Device often not found - Segmentation fault

Postby Anna » Wed Nov 02, 2016 3:41 pm

Hi,

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).

Best,

Anna
Attachments
Bildschirmfoto 2016-11-02 um 16.36.44.png
Picoscope
Bildschirmfoto 2016-11-02 um 16.36.28.png
Picoscope 6
Bildschirmfoto 2016-11-02 um 16.36.05.png
Terminal
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am

Re: Device often not found - Segmentation fault

Postby Anna » Wed Nov 09, 2016 7:20 am

Hi,

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.

Best,

Anna
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am

Re: Device often not found - Segmentation fault

Postby Hitesh » Wed Nov 09, 2016 10:55 am

Hi Anna,

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

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Device often not found - Segmentation fault

Postby Anna » Mon Nov 14, 2016 9:03 am

Hi,

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")

super(PS6000, self).__init__(serialNumber, connect)

where super is initialized with

def __init__(self, serialNumber=None, connect=True):
""" Create a picoscope class, and by default also connect to the scope. """
self.CHRange = [5.0] * self.NUM_CHANNELS
self.CHOffset = [0.0] * self.NUM_CHANNELS
self.ProbeAttenuation = [1.0] * self.NUM_CHANNELS
self.handle = None
if connect is True:
self.open(serialNumber) # -> executes _lowLevelOpenUnit

Best,

Anna
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am

Re: Device often not found - Segmentation fault

Postby Anna » Fri Nov 25, 2016 9:20 am

Hi,

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.

Thanks for all the help.

Best,

Anna
Anna
Newbie
 
Posts: 0
Joined: Fri Sep 16, 2016 8:44 am


Return to PicoScope for Mac

Who is online

Users browsing this forum: No registered users and 0 guests