Test and Measurement Forum

ps4000_GetTimebase problem

Post your .Net discussions here

ps4000_GetTimebase problem

Postby JW@KITTIWAKE » Wed Jun 23, 2010 3:52 pm

Hi
I am trying to run a 4424 over vb.net, but when I call ps4000_GetTimebase, the PICO_STATUS returns the error code 38 (or 26hex), apparently meaning "The memory index is out of range"
What does this mean, and what can I do about it?

The values returned by GetTimebase(handle,timebase,samples,time_interval,1,max_samples,1)
are
(1,21,10000,0,1,0,1)

This code works perfectly in the ps4000.xls example, but not when i update it into .net

Any ideas?
Thanks
JW@KITTIWAKE
Newbie
 
Posts: 0
Joined: Wed Jun 16, 2010 2:44 pm

Re: ps4000_GetTimebase problem

Postby Robin » Thu Jun 24, 2010 7:13 am

Hi

That error code doesn't sound right. Are you sure your data types are correct (data types are different in Excel and .net)?

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: ps4000_GetTimebase problem

Postby JW@KITTIWAKE » Thu Jun 24, 2010 12:07 pm

Okay, I've updated all of the data types to those specified in the ps4000pg.pdf and I've also ensured that I have updated the appropriate "byval"s to "byref"s to update to .net, but I still get
pico_status = 38

I may have been mistaken in saying that this corresponded to "The memory index is out of range"- there is no definition of error code 38 so I assumed I would have to convert to hex, which is 26: memory index out of range.
JW@KITTIWAKE
Newbie
 
Posts: 0
Joined: Wed Jun 16, 2010 2:44 pm

Re: ps4000_GetTimebase problem

Postby kanth_tvs » Thu Jun 24, 2010 2:14 pm

The values returned by GetTimebase(handle,timebase,samples,time_interval,1,max_samples,1)
are
(1,21,10000,0,1,0,1)


Did you try changing the last input parameter (from 1 to 0)?
kanth_tvs
Newbie
 
Posts: 0
Joined: Wed Jun 23, 2010 2:41 pm

Re: ps4000_GetTimebase problem

Postby JW@KITTIWAKE » Thu Jun 24, 2010 2:50 pm

Yes, I've tried changing the segment index- although now it needs to be "Convert.ToUIint16(0)" rather than just "0"...

No difference though.
JW@KITTIWAKE
Newbie
 
Posts: 0
Joined: Wed Jun 16, 2010 2:44 pm

Re: ps4000_GetTimebase problem

Postby Robin » Fri Jun 25, 2010 11:28 am

Hi

What is your status variable declared as? It should be signed 32 bit (a long in .net is 64 bit)

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: ps4000_GetTimebase problem

Postby JW@KITTIWAKE » Mon Jun 28, 2010 8:37 am

Ah- while my status variable was set okay (integer), some of my other data types were wrong- I was using longs where i should be using integers. Turns out you were right with your first reply!
Thanks for the help
JW@KITTIWAKE
Newbie
 
Posts: 0
Joined: Wed Jun 16, 2010 2:44 pm


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 1 guest