ps4000_GetTimebase problem

Post your .Net discussions here
Post Reply
JW@KITTIWAKE
Newbie
Posts: 0
Joined: Wed Jun 16, 2010 2:44 pm

ps4000_GetTimebase problem

Post by JW@KITTIWAKE »

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

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: ps4000_GetTimebase problem

Post by Robin »

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

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

Re: ps4000_GetTimebase problem

Post by JW@KITTIWAKE »

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.

kanth_tvs
Newbie
Posts: 0
Joined: Wed Jun 23, 2010 2:41 pm

Re: ps4000_GetTimebase problem

Post by kanth_tvs »

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)?

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

Re: ps4000_GetTimebase problem

Post by JW@KITTIWAKE »

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

No difference though.

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: ps4000_GetTimebase problem

Post by Robin »

Hi

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

Robin

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

Re: ps4000_GetTimebase problem

Post by JW@KITTIWAKE »

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

Post Reply