Test and Measurement Forum

PicoScope 2205 Get_Unit_Info problem

Post any questions you may have about our current range of oscilloscopes

PicoScope 2205 Get_Unit_Info problem

Postby marles » Tue Oct 26, 2010 10:25 am

Hi! I am programming in ATEasy and I am trying to communicate with a PicoScope 2205. The open function works, so does the close one, and the led blinking one... But when I try to query the device for its version etc., it does not respond to me! I can't receive any string from the device. Can anyone tell me why? I've implemented it like it says (it's simple thought!):

nHandle = PS2000.ps2000_open_unit()

lReturn = PS2000.ps2000_get_unit_info(nHandle, sString, 20, InfoParam)
delay(500)

PS2000.ps2000_close_unit(nHandle)


InfoParam is a short value: 1, 2, 3, 4....

The lReturn variable is 0 all the time, that means that a null string has been received from the Pico device. Any help? Please!
marles
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 11:46 am

Re: PicoScope 2205 Get_Unit_Info problem

Postby Chris » Fri Nov 05, 2010 1:27 pm

Don't know anything about ATEasy I'm afraid.

The ps2000_get_unit_info API function works in other applications, so the problem must be in the parameters passed.

short ps2000_get_unit_info (
short handle,
char *string,
short string_length,
short line

How is the sString parameter passed?
Chris
Site Admin
Site Admin
 
Posts: 169
Joined: Tue Aug 17, 2010 9:00 am
Location: St. Neots

Re: PicoScope 2205 Get_Unit_Info problem

Postby marles » Fri Nov 05, 2010 1:48 pm

ATEasy (from Geotest Inc.) is similar to Visual Basic. Anyway, I've tried to pass the sString by value and by reference... The result: nothing at all! The device wouldn't respond anything! I've seen that there's another post about this but the proposed solution doesn't work in ATEasy... Maybe in VBasic would :(.
marles
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 11:46 am

Re: PicoScope 2205 Get_Unit_Info problem

Postby Chris » Fri Nov 05, 2010 3:45 pm

For VB.Net, I passed ByVal, and had to initialise the string

Declare Function ps2000_get_unit_info Lib "ps2000.dll" (ByVal handle As Short, ByVal str_rtn As String, ByVal lth As Short, ByVal line_no As Short) As Short


Dim Str As String = "............"

Status = ps2000_get_unit_info(ps2000_handle, Str, 255, i)
Chris
Site Admin
Site Admin
 
Posts: 169
Joined: Tue Aug 17, 2010 9:00 am
Location: St. Neots

Re: PicoScope 2205 Get_Unit_Info problem

Postby marles » Fri Nov 05, 2010 4:11 pm

Thanks for you advice, Chris! But I'm home right now and the Pico device is at work. I'll try your idea on monday. I hope it will work! I'll let you know anyway. Have a nice weekend, my friend!
marles
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 11:46 am

Re: PicoScope 2205 Get_Unit_Info problem

Postby marles » Mon Nov 08, 2010 6:58 am

God bless you, Chris! It worked! Only that in ATEasy it has to be ByVar (the string passed by reference) and a predefined string length has to be made (or initialization of the string). A fixed length of 10 chars is sufficient, I guess. Thank you for the idea of initializing the string! I would never have guessed that this is the key of the problem. Have a nice day! Keep in touch.
marles
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 11:46 am


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 0 guests