PS5000SetDataBuffer

 
Post new topic   Reply to topic    Pico Technology Forum Index -> PicoScope R6
Author Message
PCBarnett
Active User
Active User


Joined: 27 Feb 2007
Posts: 9

PostPosted: Thu Dec 20, 2007 2:27 pm    Post subject: PS5000SetDataBuffer Reply with quote

I have hit a VB exception disagreeing with how I have declared ps5000SetDataBuffer. There is some confusion in your different documents.


Manual states

PICO_STATUS ps5000SetDataBuffer
(
short handle,
PS5000_CHANNEL channel,
short * buffer,
long bufferLth
)

Delphi example has

function ps5000SetDataBuffers
( handle : smallInt;
channel : smallInt;
maxBuffer : pSmallInt;
minBuffer : pSmallInt;
bufferLength : Integer
) : smallInt
{$IFDEF WIN32} stdcall; external 'ps5000.dll'{$ENDIF}

c example has

ps5000SetDataBuffers(unit->handle, (PS5000_CHANNEL)i, buffers[i * 2], buffers[i * 2 + 1], sampleCount);

Can I have a library definition in VB express. Below is the definition that fails when called from the code. it looks similar to your examples. Tried one like the manual same effect. I am using 6.12

Declare Function ps5000SetDataBuffers Lib "C:\Program Files\Pico Technology\Pico Full\ps5000.dll" _
(ByVal handle As Short, _
ByVal channel As Short, _
ByRef buffer() As Short, _
ByRef buffermax() As Short, _
ByVal bufferLth As Integer)

Its now a month since i posted this is there no progress?
Back to top
gruntman
Guru
Guru


Joined: 28 Sep 2006
Posts: 87
Location: Garden City, KS USA

PostPosted: Fri Jan 25, 2008 10:05 pm    Post subject: Reply with quote

PCBarnett,

You need to declare the function as follows:

Declare Function ps5000SetDataBuffer Lib "ps5000.dll" (ByVal handle As Integer, ByVal channel As Integer, buffer As Integer, ByVal length As Long) As Integer

You may want to look at the Visual Basic example that you can download from http://www.picotech.com/support/download.php?id=244. Most of your questions should be answered by going off of this example.

Regards,

Richard Boyd
Technical Specialist
http://www.pc-oscilloscopes.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pico Technology Forum Index -> PicoScope R6
All times are GMT
Page 1 of 1

 


Pico Technology topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group