Test and Measurement Forum

Example Excel Spreadsheet for 3206B

Post your .Net discussions here

Example Excel Spreadsheet for 3206B

Postby Gucci » Tue Nov 22, 2011 9:22 am

I would really like to use a spreadsheet to capture values from my 3206B scope but unfortunately I don't believe the example (ps3000a.xls) in the SDK works, as the values returned are nearly always 0 or -256.

Thanks.
Gucci
Newbie
 
Posts: 0
Joined: Fri Nov 18, 2011 2:14 pm

Re: Example Excel Spreadsheet for 3206B

Postby Martyn » Tue Nov 22, 2011 10:02 am

The lines in the macro
Code: Select all
    Call ps3000aSetChannel(handle, 0, 1, 1, 10, 0)
    Call ps3000aSetChannel(handle, 1, 1, 1, 10, 0)

will set the voltage range at +/-20V so this may cause you an issue. Change the 10 to the appropriate enum from
Code: Select all
typedef enum enPS3000ARange
{
PS3000A_10MV,
PS3000A_20MV,
PS3000A_50MV,
PS3000A_100MV,
PS3000A_200MV,
PS3000A_500MV,
PS3000A_1V,
PS3000A_2V,
PS3000A_5V,
PS3000A_10V,
PS3000A_20V,
PS3000A_50V,
PS3000A_MAX_RANGES
} PS3000A_RANGE;

and adjust the 20000 in the following
Code: Select all
    For i = 0 To (no_of_samples - 1)
      Cells(i + 4, "A").Value = time_interval * i
      Cells(i + 4, "B").Value = values_a(i)
      Cells(i + 4, "C").Value = (values_a(i) / 32767) * 20000
      Cells(i + 4, "D").Value = values_b(i)
      Cells(i + 4, "E").Value = (values_b(i) / 32767) * 20000
    Next i

and you may get more sensible values
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2352
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Example Excel Spreadsheet for 3206B

Postby Gucci » Fri Dec 16, 2011 2:47 pm

Thanks. That fixed my problem.
Gucci
Newbie
 
Posts: 0
Joined: Fri Nov 18, 2011 2:14 pm


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

Who is online

Users browsing this forum: No registered users and 0 guests