Test and Measurement Forum

ps6000GetValuesBulk makes (throws) an access violation

Post general discussions on using our drivers to write your own software here

ps6000GetValuesBulk makes (throws) an access violation

Postby bane » Tue Jun 05, 2012 12:09 pm

Hi,

Following problem occured when using the PicoScope 6404B, version:

PicoScope® 6 - PC-Oszilloskop-Software version: 6.6.30.5
Copyright © 1995-2012, Pico Technology Ltd

Modell: PicoScope 6404B
Seriennummer: AR571/005
USB-Version: 2,0
Kalibrierungsdatum: Freitag, 13. Januar 2012
Hardwareversion: 1 1
Treiberversion: 1.0.0.276
Firmwareversion: 1.1.1.0 / 1.0.14.0


We are using the rapid mode with one memory segment and 3125000 samples.
Function ps6000GetValuesBulk makes (throws) an access violation.

You can reproduce this using the ps6000 c# example provided with the SDK.
Modify this in ConsoleExmple class:
class ConsoleExample
{
public const int BUFFER_SIZE = 3125000; // -<<<

Is this a known bug?

Thanks in advance

Best regards,
Bane
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby Martyn » Thu Jun 07, 2012 8:41 am

If you go to the menu option V and set one channel active and the others off (99) before running RapidBlock then your modification to the value works :)
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby bane » Wed Jun 13, 2012 7:13 am

Okay. Does it mean Rapid Mode on PS6000 works only for one channel?
With PS 4000 you can use all channels.

Thanks
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby bane » Wed Jun 13, 2012 7:19 am

However, Rapid Mode works for all 4 BNC Channels in case when the number of acquired samplings is set to 10000 (for example)
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby Martyn » Thu Jun 14, 2012 1:17 pm

You do need to ensure that the number of segments, channels and buffer size will not cause you to exceed the internal memory of the scope when running in Block or Rapid Block mode.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby bane » Thu Jun 14, 2012 1:36 pm

I am wondering about this.

Based on PicoScope 6404B specification it should be possible to acquire 256MS per BNC. We are trying to acquire only 3MS, and it doesn't work :/

The same works fine with PS 4227...
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby Martyn » Thu Jun 14, 2012 1:48 pm

Can you try using "immediate block", only capturing one block of data, or "rapid block", which is designed to capture however many you require, specifying number of capture as 1 you should find it works.

How many captures were you specifying ?
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby bane » Thu Jun 14, 2012 1:52 pm

We are trying one segment in rapid mode. When using a block mode it works as expected.
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby Martyn » Thu Jun 14, 2012 2:10 pm

Can you

Unplug then replug the scope
Start the application
Set all channels to desired voltage using v
Run "Immediate Block"
Run "Rapid Block" with number of captures 1

Does this work for you ?
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby bane » Fri Jun 15, 2012 7:04 am

Immediate Block woks OK
Rapid Block with 1 capture => Not Ok (access violation)

Does Rapid Block mode work for you? Do you use the same DLL version as I do?
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby Martyn » Fri Jun 15, 2012 7:20 am

With one block of data there is no advantage to using Rapid Block over Immediate Block, this mode is intended for capturing multiple consecutive blocks to the scopes memory so that the trigger re-arm time can be reduced to the smallest possible value. Only when all blocks have been captured does the data get sent to the PC.

It is working for me provided I use the sequence above, however if I select Rapid Block first I get an error. I am referencing driver 1.0.0.272 but I don't believe that is the problem. I suspect it is the example code not setting buffers up correctly when using multiple channels.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby bane » Fri Jun 15, 2012 8:05 am

Thanks Martyn.

The example Code is OK, because it is working fine for PicoScope 4227. The buffer allocation is correct.

I understand the advantage using Rapid Mode. For now, we will have to use the Block mode.
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby Martyn » Fri Jun 15, 2012 10:53 am

I will take a closer look at the code as the 4000 example doesn't appear to work with a 4 channel 4000 scope, so there still may be an issue.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby hmaarrfk » Mon Jun 25, 2012 6:22 pm

Hi Martyn, Bane,

I wanted to let you know that I am having the same problem with the Picoscope 6403.

Here is my developing environment:

OS: Windows 7 64bit -- Also tested the code on some old Windows XP 32 bit computer a while back
Driver Version: 2.0.3.7
Picoscope Software Version: 6.6.28.1 (latest stable at time of writing)
Matlab: R2012a (7.14.0.739) 32-bit (win32) -- This allows us to use the 32bit dlls provided.
Matlab compiler: The one that comes stock with Matlab 2012a

I know my developing environment is not standard but since somebody else was having the bug I thought I would help corroborate it. I can upload my matlab code somewhere, but basically when using RapidBlock mode, if I use
ps6000SetDataBufferBulk and ps6000GetValuesBulk
it will crash with an access violation for when trying to get data from all 4 channels with the number segments greater than something like 3-4.

If i use
ps6000SetDataBuffer and ps6000GetValues
in a loop, it will not crash.

I know Picotech does not support Matlab, but I'm pretty sure it would be reproducible with standard C code.

Anyway, those are my two cents. I hope we can figure this out.

Mark
hmaarrfk
Newbie
 
Posts: 0
Joined: Sun Jun 24, 2012 11:41 pm

Re: ps6000GetValuesBulk makes (throws) an access violation

Postby newt » Fri Jul 06, 2012 4:52 pm

Mark,
I'm also using Matlab (but with a PicoScope 4227). I've been using RunBlock and GetValues in a loop using normal block mode. Now I'm trying to switch to rapid block mode but am having trouble setting up the buffer and getting the data using SetDataBufferBulk and GetValuesBulk. Would you post a Matlab code snipet? I'd like to see if I'm doing something wacky or it's the same access violation as with the PicoScope 6xxx.

Thanks,
Dave.
newt
Newbie
 
Posts: 0
Joined: Fri Jul 06, 2012 4:42 pm

Next

Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests