Test and Measurement Forum

Not using all memory for one channel on 4262

Post your VB and VBA discussions here

Not using all memory for one channel on 4262

Postby Graham » Sun Mar 10, 2013 5:40 pm

I am writing a program in which I am trying to acquire for up to 13 seconds at 1Ms/S. I expect the PC's it will eventually run on to be a little limited so I figured the safest option was to use block mode. I only need the one channel so I thought it would be ok as it has 16Ms of memory.

Everything works nicely at up to around 8M samples but it doesn’t seem to work above that. It will work in streaming mode but not block mode.
I have tried setting the memory segments to 1 it returns that there are 16777010 samples available in the segment.
Then when I call RunBlock in the wrapper DLL and set pre triggered to 0 and post triggered to 8388506 (half the available points +1) it returns error code 14 PICO_INVALID_TIMEBASE. It works with a value of 8388505(half the available points).

I have also tried setting channel B to disable that didn't change it. I have not set up any triggering if that would make a difference.

I was using is PS4000sdk_r10_4_3_1, I have just tried PS4000sdk_r10_5_0_11 the same happens
I couldn't see a change log for the new SDK though, apologies if I just missed it.

Is this a limit/ bug or have I just missed something?

A related question
When using streaming mode dose the scope buffer it though the internal memory at all?
If so as I am within the memory limits of the scope? I could use that and not worry about PC performance.

If it helps I have included the section of code in question.

Any help would be greatly appreciated.

Graham

Code: Select all
Call ps4000SetChannel(Unit.handle, 0, 1, 1, 4)
Unit.STATUS = ps4000MemorySegments(Unit.handle, 1, retval)
Call ps4000SetDataBuffer(Unit.handle, 0, Values_a(0), no_of_samples)
Unit.STATUS = RunBlock(Unit.handle, 0, no_of_samples, 9, 0, 0)

If Not Unit.STATUS = PICO_OK Then
MsgBox "error: " & GetErrMsg(Unit)
           Exit Sub
End If     
While IsReady4000(Unit.handle) = 0
Sleep (100)
Wend
Call ps4000Stop(Unit.handle)
Graham
Newbie
 
Posts: 0
Joined: Sat Mar 09, 2013 9:16 pm

Re: Not using all memory for one channel on 4262

Postby Martyn » Tue Mar 12, 2013 11:34 am

Make sure that you disable the second channel.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2350
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Not using all memory for one channel on 4262

Postby Graham » Tue May 07, 2013 12:49 pm

Thanks Martyn,
That did it when I looked at that before I missed the channel nos start a 0 so B is 1. (Not sure what I was thinking at the time :oops: )
That is working now and seems to work well.

I tried to add the next part and set it up to wait for a trigger event.
Just a simple edge trigger and it seams that as soon as I enable the trigger it slows down the sample time or something that has that effect. I am Using ps4000SetSimpleTrigger

I have 1 Hz square wave going in if I enable the trigger it takes a lot longer to acquire trace and it looks like a 2 or 3 Hz. if I only change the second parameter in that call to disable it appears to be the right 1Hz trace.
I am getting the right number of points and the reported sample interval is the same.

can you offer any suggestions?
Graham
Newbie
 
Posts: 0
Joined: Sat Mar 09, 2013 9:16 pm

Re: Not using all memory for one channel on 4262

Postby Martyn » Tue May 07, 2013 12:58 pm

Can you post the modified code with the trigger functions
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2350
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to VB and VBA (Excel, Access)

Who is online

Users browsing this forum: No registered users and 0 guests