recruting data from PicoLog 1216

Post your MATLAB discussions here
Post Reply
botond
Newbie
Posts: 0
Joined: Thu Sep 13, 2012 7:10 pm

recruting data from PicoLog 1216

Post by botond »

Hi,I'm trying to establish contact between Matlab and the DataLoggerPico Log 1216.
This is my Code:

clear all;close all;clc
loadlibrary 'C:\Users\Szabolcs\Documents\Pico\PL1000.dll' 'C:\Users\Szabolcs\Documents\Pico\pl1000Api.h' addheader 'C:\Users\Szabolcs\Documents\Pico\picoStatus.h';
hand = libpointer('int16Ptr',0);
[status_open, hand] = calllib('PL1000', 'pl1000OpenUnit', hand);
setdatatype(status_open,'voidPtr',1,1);
get(status_open)
hand

I get the following Messages:
Warning: The data type 'error' used by function pl1000OpenUnit does not exist.
> In loadlibrary at 458
.
.
.

My problem is,that I didn't know if I establish the contact with the data logger, respectively if I recive the righ handle,which identifies my Data Logger.
Thanks
Botond

Hitesh

Re: recruting data from PicoLog 1216

Post by Hitesh »

Hi Botond,

I provided a response about the 'error' datatype in the following forum topic where you had last posted:

http://www.picotech.com/support/topic10797.html

You need to make sure that picoStatus.h is referred to in the pl1000Api.h file.

Try checking the value of hand

Code: Select all

handle = get(hand, 'Value');
With MATLAB it's not necessary in certain cases to define values that are passed as pointers as a libpointer as it takes care of data type conversion. E.g.

Code: Select all


handle = 0
[status_open, handle] = calllib('PL1000', 'pl1000OpenUnit', handle)

Also, you can remove the ';' at the end of the line for debug purposes to view the values being returned.

Hope this helps.

Post Reply