I am trying to connect the PicoScope 5444B within a function call. When I use the example-Scripts i.e. PS5000A_IC_Generic_Driver_Block.m everything is fine. Also sometimes connecting a device with for example
Code: Select all
function somefunction( void ) %SOMEFUNCTION Summary of this function goes here % Detailed explanation goes here PS5000aConfig; %% Device Connection % Create device - specify serial number if required % Specify serial number as 2nd argument if required. ps5000aDeviceObj = icdevice('picotech_ps5000a_generic.mdd'); % Connect device connect(ps5000aDeviceObj); %do something ... disconnect(ps5000aDeviceObj); end
Code: Select all
Warning: The data type 'FcnPtr' used by function ps5000aRunBlock does not exist. Warning: The data type 'FcnPtr' used by function ps5000aGetStreamingLatestValues does not exist. Close unit status: 12 Error using instrument/delete (line 82) Operation failed: An error occurred while executing the driver disconnect code. Unit not closed. If this error is not an instrument error, use MIDEDIT to inspect the driver. Error in icdevice (line 310) delete(obj); Error in Stream (line 119) ps5000aDeviceObj = icdevice('picotech_ps5000a_generic.mdd');
When i run exactly the same code as script i got no issues.
Connecting the device within a function worked before several times. I changed nothing. Now I am not longer to connect the device within a function. Restarting the System, Reconnecting the device didnt help.
With the Picoscope 4225B there is no problem like this.
I am using
-Windows 7 64 Bit
-Matlab 2015b 64 Bit
-Example-Files and library from PicoSDK
For more Version-Information:
(Creation Date of PS5000A_IC_GENERIC_DRIVER_BLOCK is Creation time: 05-Jul-2013 13:00:29)
The Example-Files from Mathworks File-Exchange are not working