Test and Measurement Forum

ps6000SetSigGenArbitrary

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

ps6000SetSigGenArbitrary

Postby hmaarrfk » Fri Dec 27, 2013 3:23 am

Hello.

I was wondering if somebody could confirm that the documentation about ps6000SetSigGenArbitrary is correct

I am looking at
ps6000pg.en.pdf obtained from PS6000sdk_r10_5_0_28

I believe I have a PS6403D (the USB2 variant): Here is the output from getUnitInfo

Code: Select all
DRIVER_VERSION                : 1.2.1.121
USB_VERSION                   : 2.0
HARDWARE_VERSION              : 1 1
VARIANT_INFO                  : 6403
BATCH_AND_SERIAL              : AP225/021
CAL_DATE                      : 22Mar11
KERNEL_VERSION                : 1.0
DIGITAL_HARDWARE_VERSION      : 1
ANALOGUE_HARDWARE_VERSION     : 1
PICO_FIRMWARE_VERSION_1       : 1.1.5.0
PICO_FIRMWARE_VERSION_2       : 1.1.25.0


In the programming guide. It says that we must supply the arbitrary waveform as a short (int16_t) and that if
Code: Select all
pkToPk = 4E6
offsetVoltage = 0


the guide claims that a sample of
-32768 (0x8000) corresponds to -2V
32767 (0x7FFF) corresponds to +2V


From my experimenting, and from line 1166 of PS6000con.c
Code: Select all
      { // Having opened file, read in data - one number per line (at most 16384 lines), with values in (0..4095)

it seems that
Code: Select all
0x0000 corresponds to -2V
0x0FFF (4095) corresponds to +2V


Can somebody please confirm this?
hmaarrfk
Newbie
 
Posts: 0
Joined: Sun Jun 24, 2012 11:41 pm

Re: ps6000SetSigGenArbitrary

Postby Hitesh » Fri Dec 27, 2013 7:07 pm

Hi hmaarrfk,

The Programmer's Guide should be correct. Line 1166 appears to be incorrect, as the arbitrary waveform buffer size for the PicoScope 6403D is 64 kilosamples.

Please scale your values in the range -32768 and 32767 and verify the output. I suggest a simple ramp signal to test with (you can export the csv file from the Arbitrary Waveform Generator in PicoScope 6 and then scale it in something like MS Excel).

I suggest saving the text file from the above using the ANSI standard.

I hope this helps.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: ps6000SetSigGenArbitrary

Postby hmaarrfk » Fri Dec 27, 2013 7:46 pm

Hi Hitesh,

I am really at a loss as to which version of the PS6403. Looking back, it seems that I have a PS6403B because I am able to achieve up to 500,00,000 samples with the Picoscope 6 software by setting:

divs = 20ms/div
and 2GS for the samples

This gives me a sampling interval of 400ps (I am assuming it uses ETS ???)
but claims to measure 500,000,000 samples.

the getInfo function only returns 6403, which probably means 6403B.

Anyway, I experimented with supplying different types of waveforms. It seems that the Picoscope only uses the lower 12 bits as I explained before.


pkToPk = int(4E6)
offset = 0
0x0000 gives min dac = -2V
while 0x0FFF gives max dac +2V

Once again, can you double check if this is consistent with your LabView code for the PicoScope6 Software?

Thank you Hitesh,

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

Re: ps6000SetSigGenArbitrary

Postby Martyn » Sat Dec 28, 2013 12:18 pm

Can't check any code at the moment as I don't have access to a scope, but I am guessing that there is an issue with parameter types and signing. From memory the values given for the buffer values were correct last time I used them.

For information it's not Ets, the scope can run at 5GS/s or 200ps depending on enabled channels. As you have USB2 and AWG you will have a B model, Picoscope6 Help->About will confirm this for you.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2350
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000SetSigGenArbitrary

Postby hmaarrfk » Sat Dec 28, 2013 4:41 pm

Hi Martyn,

About->Help only shows 6403 and does not specify 6403B. I guess the B is implied.

I'll go over my code again this weekend. Thank you.

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

Re: ps6000SetSigGenArbitrary

Postby hmaarrfk » Sun Dec 29, 2013 2:14 am

Hi Martyn, Hitesh,

I've attached my sample code as well as plots showing the difference between the two methods of scaling.

awg_scaling.png
Plot


In the code I attached, I generate ramp from -2V to 2V measure it for a period 5 times its period.

No trigger is set therefore it takes a bit of time before the picoscope forces a trigger. This gives some time for the picoscope to settle before measuring the waveform (I've observed some strange behaviour with the AWG moments after boot up).

The plots indeed suggest that there is a either a typo in the programming guide, or a bug in the driver.

Thank you for helping me through this. If it is indeed a bug, I hope it will get fixed in future releases.

Have a happy new year.

Mark
Attachments
measured_waveform_suggested_scaling.txt
Suggested scaling in the Programming guide.
(10.81 KiB) Downloaded 95 times
measured_waveform_0x0000_to_0x0FFF.txt
Scaling only from 0x0000 to 0x0FFF
(10.91 KiB) Downloaded 93 times
ps6000AWG.c
source code
(3.5 KiB) Downloaded 102 times
hmaarrfk
Newbie
 
Posts: 0
Joined: Sun Jun 24, 2012 11:41 pm

Re: ps6000SetSigGenArbitrary

Postby Martyn » Thu Jan 02, 2014 11:43 am

I have just tested and the waveform buffer values need to be between 0 and 4095, which correspond with the 12bit DAC accuracy, above this and the values are truncated giving strange waveforms.

With a Peak to Peak of 4000000uV, the waveform buffer value 0 gives -2V, and the value 4095 gives +2V.

Our console application states this in the AWG section so I will get the programmers guide updated.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2350
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps6000SetSigGenArbitrary

Postby hmaarrfk » Fri Jan 03, 2014 8:48 pm

Good to know that this is the expected behavior and that it won't change in future versions of the SDK.

Thank you.
hmaarrfk
Newbie
 
Posts: 0
Joined: Sun Jun 24, 2012 11:41 pm


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests