Test and Measurement Forum

C++ Programming for PICO3205A

Post your C and C++ discussions here

C++ Programming for PICO3205A

Postby airul2180 » Wed Dec 05, 2012 6:02 am

Hello, i need your help to do c++ programming for PICO3205A. I have run the SDK file that i got in CD but a lot of error came out.Thanks
airul2180
Newbie
 
Posts: 0
Joined: Wed Dec 05, 2012 2:55 am

Re: C++ Programming for PICO3205A

Postby Martyn » Wed Dec 05, 2012 7:27 am

If you are using Visual Studio then create a new Win32 Console Application as an "Empty Project", then add picoStatus.h, ps3000aApi.h, ps3000a.lib, and PS3000Acon.c to it.

In PS3000Acon.c you may need to change
Code: Select all
#include "..\ps3000aApi.h"

to
Code: Select all
#include "ps3000aApi.h"


depending on file location, and also ensure that PS3000a.dll is in the same folder as the exe, or on the path. Installing PicoScope6 will look after the last part.

The project should now build and run.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: C++ Programming for PICO3205A

Postby airul2180 » Wed Dec 05, 2012 8:42 am

Hy thanks for the info before.but after i am followed your instruction the simple programming i wrote as follow :
Code: Select all
// cuba.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "picoStatus.h"
#include "ps3000aApi.h"
#include "PS3000Acon.c"

int _tmain(int argc, _TCHAR* argv[])
{
   return 0;
}
//-------------------------

then the errors came out

Code: Select all
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(167): error C2664: 'ps3000aSetChannel' : cannot convert parameter 2 from 'int' to 'PS3000A_CHANNEL'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(219): error C2664: 'ps3000aSetDataBuffers' : cannot convert parameter 2 from 'short' to 'PS3000A_CHANNEL'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(355): error C2664: 'ps3000aSetDataBuffers' : cannot convert parameter 2 from 'long' to 'PS3000A_CHANNEL'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(552): error C2440: 'initializing' : cannot convert from 'enPS3000A_ThresholdMode' to 'PS3000A_CHANNEL'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(698): error C2664: 'ps3000aMemorySegments' : cannot convert parameter 3 from 'unsigned long *' to 'long *'
          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(731): error C2440: '=' : cannot convert from 'void *' to 'short ***'
          Conversion from 'void*' to pointer to non-'void' requires an explicit cast
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(732): error C2440: '=' : cannot convert from 'void *' to 'short *'
          Conversion from 'void*' to pointer to non-'void' requires an explicit cast
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(736): error C2440: '=' : cannot convert from 'void *' to 'short **'
          Conversion from 'void*' to pointer to non-'void' requires an explicit cast
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(745): error C2440: '=' : cannot convert from 'void *' to 'short *'
          Conversion from 'void*' to pointer to non-'void' requires an explicit cast
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(756): error C2664: 'ps3000aSetDataBuffer' : cannot convert parameter 2 from 'short' to 'PS3000A_CHANNEL'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(975): error C2664: 'ps3000aSetSigGenArbitrary' : cannot convert parameter 10 from 'int' to 'PS3000A_SWEEP_TYPE'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(981): error C2664: 'ps3000aSetSigGenBuiltIn' : cannot convert parameter 9 from 'int' to 'PS3000A_SWEEP_TYPE'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
c:\users\hanafi\desktop\khairul\dropbox\phd\phd notes\project c++\cuba\ps3000acon.c(1025): error C2440: 'initializing' : cannot convert from 'enPS3000A_ThresholdMode' to 'PS3000A_CHANNEL'
          Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)

Build FAILED.
airul2180
Newbie
 
Posts: 0
Joined: Wed Dec 05, 2012 2:55 am

Re: C++ Programming for PICO3205A

Postby Martyn » Wed Dec 05, 2012 9:19 am

Can you try the following Visual Studio solution

Go to http://picostore.picotech.com/download/1379--test.zip

When prompted enter the password 'WHITEray1814' (without the quotes).
This file is available until 10 December, 2012.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: C++ Programming for PICO3205A

Postby airul2180 » Mon Dec 10, 2012 6:44 am

Thanks, it`s work. I just want to know which code or variable that refer to output of real time data that we can modify. Thanks
airul2180
Newbie
 
Posts: 0
Joined: Wed Dec 05, 2012 2:55 am

Re: C++ Programming for PICO3205A

Postby Martyn » Wed Dec 12, 2012 10:01 am

The functions that get data from the driver and write it to screen/file are

BlockDataHandler for block mode
RapidBlockDataHandler for rapid block mode
StreamDataHandler for streaming mode

you should be able to work it out from there.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests