Excel Example problems

Forum for discussing PicoScope version 6 (non-automotive version)
Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Excel Example problems

Post by Holger »

Hello,

i have a problem with the Excel Example for Picoscope 2206a.
I have download the PS2000asdk_r10_5_0_32 from your website and the Picoscop6 software.
the excel say my: i dosn't found the ps2000aWrap.dll.

i need help.

Thanks
Holger

Hitesh

Re: Excel Example problems

Post by Hitesh »

Hi Holger,

Try specifying the path to the ps2000aWrap.dll file in the relevant Declare Function lines or alternatively copy the file to the
C:\Windows\System32 folder.

If you are collecting streaming data please let us know as there are new functions to help with this in the wrapper dll.

Thanks,

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

Hello,

i have the problem found.
the ps2000aWrap was in the C:\Windows\System32 folder, but Excel cann't read this file.
I muss Enable all macros.
Thanks for your help.

By the Streaming Data it maket only one messuring. and than he stop it.

The Excel Example also runs on a Windows 64 bit System. it is only needs to change the following:
Declare Function ps2000aOpenUnit Lib "ps2000a.dll"
to
Declare PtrSafe Function ps2000aOpenUnit Lib "ps2000a.dll"
and this by all funktions and Sub.

The last sentence from you, i do not understand.

Holger

Hitesh

Re: Excel Example problems

Post by Hitesh »

Hello Holger,

The ps2000aWrap.dll has new functions to assist with streaming mode data capture.

The functions are described in the ps2000aWrap.c file in the SDK - if you require further help with this, please post back here.

Regards,

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

Hello Hitesh,

i have show the ps2000aWrap.c file.
But he doesn't found the ps2000aWrap.dll in the debug.
When i put the dll in this file, he delet this by the debuging and comes to error from Visual Studio2012 express
LINK1120 and LINK2019.
Error 6 error LNK1120: 5 unresolved external C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ Wrapper \ Debug \ ps2000aWrap.dll 1 1 ps2000aWrap

Error 5 error LNK2019: unresolved external symbol "_ps2000aGetStreamingLatestValues ​​@ 12" in function "_GetStreamingLatestValues ​​@ 4". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ wrapper \ ps2000aWrap.obj ps2000aWrap
and the other of german it is the same:
Fehler 4 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ps2000aRunBlock@36" in Funktion "_RunBlock@20". C:\Program Files (x86)\Pico Technology\PicoScope6\Wrapper\ps2000aWrap.obj ps2000aWrap
Fehler 3 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ps2000aSetPulseWidthQualifier@28" in Funktion "_SetPulseWidthQualifier@28". C:\Program Files (x86)\Pico Technology\PicoScope6\Wrapper\ps2000aWrap.obj ps2000aWrap
Fehler 2 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ps2000aSetTriggerChannelConditions@12" in Funktion "_SetTriggerConditions@12". C:\Program Files (x86)\Pico Technology\PicoScope6\Wrapper\ps2000aWrap.obj ps2000aWrap
Fehler 1 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ps2000aSetTriggerChannelProperties@20" in Funktion "_SetTriggerProperties@16". C:\Program Files (x86)\Pico Technology\PicoScope6\Wrapper\ps2000aWrap.obj ps2000aWrap

I have a questens can i save the streaming data in a excel file? but we need the throughout.

Regards,
Holger

Hitesh

Re: Excel Example problems

Post by Hitesh »

Hello Holger,

Are you trying to build the ps2000aWrap.dll?

There is a 32-bit dll already provided in the Wrapper/Release directory which you can use, unless you wish to modify the functions provided.

The ps2000a.lib file from the SDK may not have been loaded into the project.

If you are looking to collect streaming data by running a VBA program from MS Excel, then please note that there is a limit of 1048576 rows in the spreadsheet.

How long are you looking to collect data for, what is the sampling interval and are you using both channels?

Regards,

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

Hello Hitesh,

I want to read the data with c by streaming mode.
Is that possible?


Regards,

Holger

Hitesh

Re: Excel Example problems

Post by Hitesh »

Hi Holger,

Yes, the C console example in the Software Development Kit shows you how to do this.

If you load the console example from it's directory in the SDK, it should pickup the following files from the root directory of the SDK:
  • ps2000aApi.h
  • picoStatus.h
  • ps2000a.lib (32-bit)
Regards,

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

Hi Hitesh,

It works also everything, but the program wants to access the ps2000aWrap.dll and that does not work then get the error I posted above before. Therein lies the whole trouble.

I have to use the ps2000aWrap.c. The yes then invites all files.

so now I know where my mistake was.
have the C Console now then get used but allocation error for example that of the int type void is not compatible with what's going on there now.

Regards,
Holger

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

hi

in the PS2000Acon.c in line 1232 is a error.

Code: Select all

rapidBuffers[channel][capture] = calloc(nSamples, sizeof(int16_t));
The microsoft Visual Studio 2013 say: IntelliSense: a value of type "" void * "to" any entity can be assigned the type "" int16_t * "".
And the same say the program in line 1223 :

Code: Select all

rapidBuffers[channel] = calloc(nCaptures, sizeof(int16_t));
IntelliSense: a value of type "" void * "to" any entity can be assigned the type "" int16_t ** "".

Regards,
Holger

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

hi,

an other question.
Where can I find the ps2000a.lib (32-bit) in the SDK folder it is not.
Thanks
Edit: I found it. but Microsoft Visual Studio can not open this file.

Reagards,
Holger

Hitesh

Re: Excel Example problems

Post by Hitesh »

Hi Holger,

Please change the lines to the following:

Code: Select all

rapidBuffers[channel] = (int16_t**) calloc(nCaptures, sizeof(int16_t*));

Code: Select all

rapidBuffers[channel][capture] = (int16_t *) calloc(nSamples, sizeof(int16_t));
A cast needs to be applied to the calloc function.

Regards,

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

Hi Hitesh,

thanks.
And i have the same problem in line 303 with:

Code: Select all

tatus = ps2000aSetChannel(unit->handle, (PS2000A_CHANNEL) PS2000A_CHANNEL_A + i,
			unit->channelSettings[PS2000A_CHANNEL_A + i].enabled,
			(PS2000A_COUPLING) unit->channelSettings[PS2000A_CHANNEL_A + i].DCcoupled,
			(PS2000A_RANGE) unit->channelSettings[PS2000A_CHANNEL_A + i].range, 0);
he say the Programm:
IntelliSense: argument of type "" int "" with parameter of type "" PS2000A_CHANNEL "" incompatible.

And can you say me why the ps2000a.lib can not open. also the Microsoft Visual 2013. it say:

error LNK1104: File "ps2000a.lib" can not be opened.

Reagards,

Holger

Hitesh

Re: Excel Example problems

Post by Hitesh »

Hi Holger,

The error is due to the variable 'i' being a signed 32-bit integer while the enumeration 'PS2000A_CHANNEL_A' is an unsigned 32-bit integer. You simply need to put brackets around the sum as shown below:

Code: Select all

status = ps2000aSetChannel(unit->handle, (PS2000A_CHANNEL) (PS2000A_CHANNEL_A + i),
			unit->channelSettings[PS2000A_CHANNEL_A + i].enabled,
			(PS2000A_COUPLING) unit->channelSettings[PS2000A_CHANNEL_A + i].DCcoupled,
			(PS2000A_RANGE) unit->channelSettings[PS2000A_CHANNEL_A + i].range, 0);
Try adding the ps2000a.lib file to your Visual Studio Express project - it probably cannot find the file as the path may not be specified.

Regards,

Holger
Newbie
Posts: 0
Joined: Thu Jul 03, 2014 10:32 am
Location: Germany

Re: Excel Example problems

Post by Holger »

Hi Hitesh,

thanks.
I have made ​​smart how that integrates ps2000a.lib properly.
This has also so far works, but now comes the following error:

Code: Select all

Error 1 error LNK2019: unresolved external symbol "__imp__ps2000aOpenUnit @ 8" in function "_OpenDevice". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 2 error LNK2019: unresolved external symbol "__imp__ps2000aGetUnitInfo @ 20" in function "_get_info". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 3 error LNK2019: unresolved external symbol "__imp__ps2000aCloseUnit @ 4" in function "_CloseDevice". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 4 error LNK2019: unresolved external symbol "__imp__ps2000aMemorySegments @ 12" in function "_CollectRapidBlock". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 5 error LNK2019: unresolved external symbol "__imp__ps2000aSetChannel @ 24" in function "_DisableAnalogue". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 6 error LNK2019: unresolved external symbol "__imp__ps2000aSetDigitalPort @ 16" in function "_SetDigitals". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 7 error LNK2019: unresolved external symbol "__imp__ps2000aSetNoOfCaptures @ 8" in function "_CollectRapidBlock". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 8 error LNK2019: unresolved external symbol "__imp__ps2000aGetTimebase @ 28" in function "_BlockDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 9 error LNK2019: unresolved external symbol "__imp__ps2000aSetSigGenArbitrary @ 68" in function "_SetSignalGenerator". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 10 error LNK2019: unresolved external symbol "__imp__ps2000aSetSigGenBuiltIn @ 60" in function "_SetSignalGenerator". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 11 error LNK2019: unresolved external symbol "__imp__ps2000aSetEts @ 20" in function "_CollectBlockEts". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 12 error LNK2019: unresolved external symbol "__imp__ps2000aSetTriggerDigitalPortProperties @ 12" in function "_SetTrigger". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 13 error LNK2019: unresolved external symbol "__imp__ps2000aSetTriggerChannelProperties @ 20" in function "_SetTrigger". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 14 error LNK2019: unresolved external symbol "__imp__ps2000aSetTriggerChannelConditions @ 12" in function "_SetTrigger". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 15 error LNK2019: unresolved external symbol "__imp__ps2000aSetTriggerChannelDirections @ 28" in function "_SetTrigger". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 16 error LNK2019: unresolved external symbol "__imp__ps2000aSetTriggerDelay @ 8" in function "_SetTrigger". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 17 error LNK2019: unresolved external symbol "__imp__ps2000aSetPulseWidthQualifier @ 28" in function "_SetTrigger". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 18 error LNK2019: unresolved external symbol "__imp__ps2000aGetNoOfCaptures @ 8" in function "_CollectRapidBlock". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 19 error LNK2019: unresolved external symbol "__imp__ps2000aSetDataBuffer @ 24" in function "_BlockDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 20 error LNK2019: unresolved external symbol "__imp__ps2000aSetDataBuffers @ 28" in function "_BlockDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 21 error LNK2019: unresolved external symbol "__imp__ps2000aRunBlock @ 36" in function "_BlockDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 22 error LNK2019: unresolved external symbol "__imp__ps2000aRunStreaming @ 36" in function "_StreamDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 23 error LNK2019: unresolved external symbol "__imp__ps2000aGetStreamingLatestValues ​​@ 12" in function "_StreamDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 24 error LNK2019: unresolved external symbol "__imp__ps2000aGetValues ​​@ 28" in function "_BlockDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 25 error LNK2019: unresolved external symbol "__imp__ps2000aGetValuesBulk @ 28" in function "_CollectRapidBlock". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 26 error LNK2019: unresolved external symbol "__imp__ps2000aStop @ 4" in function "_BlockDataHandler". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 27 error LNK2019: unresolved external symbol "__imp__ps2000aMaximumValue @ 8" in function "_OpenDevice". C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ PS2000Acon.obj ps2000Acon
Error 28 error LNK1120: 27 unresolved external C: \ Program Files (x86) \ Pico Technology \ PicoScope6 \ cconsole \ Debug \ ps2000Acon.exe ps2000Acon
Regards,
Holger

Post Reply