Test and Measurement Forum

Cannot compile streammingTests.cpp for Pico 3000 series

Forum for discussing PicoScope (version 5)

Cannot compile streammingTests.cpp for Pico 3000 series

Postby NaingScorpio » Tue Feb 27, 2007 10:06 am

Hi all,
I want to try on examples programs included in the pico development softwares for pico 3000 series but unfortunately i cannot compile the streammingTests.cpp. When I looked through the help file for pico 3000 series, streammingTests.h is listed in the software packages. But I couldn't find it inside the Example folder. Is it necessary for .cpp compilation? I use VisualStudio.NET IDE to compile it (make C++ project and compile it). I can compile p3000con.c C file but cannot compile C++. The errors shows " sprint_s and strcat " are not found. Anybody can solve this problem? Where can I find the "streammingTests.h" file. Thanks for your time.

PS: I download the software from pico software website just now!

Regards,
Naing Scorpio.
NaingScorpio
Active User
Active User
 
Posts: 8
Joined: Tue Feb 27, 2007 9:41 am

Postby Sarah » Tue Feb 27, 2007 11:14 am

Hi

I think the file you require is actually called streamingTestResource.h and I have attached it to this post for you.

Best Regards
Attachments
streamingTestResource.h
(2.31 KiB) Downloaded 267 times
Sarah
 

Reply

Postby NaingScorpio » Thu Mar 01, 2007 2:04 am

Hi Sarah,
:( :( :( I tried with your header file and result was not changed (still have same error). I used this header file and ps3000.h when I firstly tried to compile the streamingtest.cpp. Now I send attach pdf file for your considerations. Thanks for your time and helps!

Best Regards,
Naing Scorpio.
Attachments
PS3000 Error.pdf
(29.55 KiB) Downloaded 264 times
NaingScorpio
Active User
Active User
 
Posts: 8
Joined: Tue Feb 27, 2007 9:41 am

Postby Sarah » Thu Mar 01, 2007 9:44 am

Hi

From what I can see from these errors, the problem is not related to the streaming header file but rather the functions listed - sprintf_s and strcat_s.

According to the MSDN library these functions require the headers:

<stdio.h>
<string.h>

Are these referenced at the top of the streaming.cpp file that you are using?

Best Regards
Sarah
 

Still cannot build!

Postby NaingScorpio » Mon Mar 05, 2007 3:10 am

Dear,
I checked the program and there was no string.h and I added it. Then I tried to build it but it showed the error mesg as like before. Do you have any idea for this case. Thanks for your time and considerations.

Best Regards,
Naing Scorpio.
NaingScorpio
Active User
Active User
 
Posts: 8
Joined: Tue Feb 27, 2007 9:41 am

Postby jleslie48 » Mon Mar 05, 2007 4:19 pm

the examples file is not complete. there really needs to be much more extensive directions on how to build and run the examples.

It took me nearly half a day to realize that the examples require visual C++ 8.0, why this isn't listed as a pre-requisite is beyond my understanding.

I'm fighting with the the C examples myself. the build procedures need to be much more fully explained. here I'll start,

1) make sure you have the C++ Microsoft Visual Studio 8.0 or greater compiler.

2) install the picoscope software including all examples. If you use the default installation on your C: drive you'll end up with the following directory:

Image

3) Click on FastStreaming.vcproj and you'll open up the C++ project. (no project for ps3000con???) If you have a C++ 7.1, you'll get an error to the effect of: "Your project version is '8.00'. Visual Studio .NET can only load version 7.0 and 7.1 project files. " The best work around I found for this is:

Make your own project (an example of that is saved for another set of directions.) VS C++ 7.1 does not have the functions printf_s and strcpy_s, so replace these function calls in your source with printf and strcpy respectively.

4) At this point a lot of directories have to be set, and libraries put into place, this pre-compiler turned on or off, bla, bla, bla, and the project has to be established. No easy way to make a simple checklist of what you have to do like a makefile. You have to guess at all the options, and go through all the click options and guess at what is needed. This in the infinite wisdom of Microssoft is "easier" than a simple ASCII text file of a make file that you can just look at and see all the needed elements of making the exectable. So Picoscope, can you please help us out and continue this document. Please remember we have not spend 1,000 of hours like you working with your software API, so we need our hands held, simple step-by-step directions. Assume nothing.
jleslie48
Active User
Active User
 
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

Postby jleslie48 » Mon Mar 05, 2007 7:17 pm

Sarah,

I think I'm a litter farther along than you, so I packed up my work to date, hope it helps.
heres what I have so far:

http://jleslie48.com/picoscope/picoscope_070305.zip

if you unpack it, it makes a directory "C:\jon\c\source\..."

I was able to get streamingtest to build and run on Visual C++ 7.1, but
the program crashed really bad (looses its callback stack) when you try and start streaming. The starting point is at:
C:\jon\c\source\PS3000_71\streamingtest_71\streamingtest_71\streamingtest_71.vcproj

but the hard crash keeps me from getting any further.

I also compiled and linked under C++7.1 the program PS3000con, which works fine when you make :
#define BUFFER_SIZE 100000
in PS3000.C

I want to collect 5 seconds worth of data a 1,000,000samples per second,
so I must use the fast_streaming as shown in streamingtests.cpp as well.



I've tried to add a routine to PS3000con.c called collect_fast_streaming
based on PS3000.c's routine collect_streaming using the function calls
from streamingtests.cpp. Then I changed the buffers to values[5000000]
so I had enough room for the data. However messing with BUFFER_SIZE
causes side effects as the API is using that #define for other things not
documented. While the program doesn't work quite right, I can see that I
am collecting some data in the buffers unitOpened.values
and it seems that
#define BUFFER_SIZE 100000
has a lot to do with it.

I think this program, ps3000con_71 is worth pursuing.

The directory of interest is:

C:\jon\c\source\ps3000con_71\ps3000con_71

and the project is: ps3000con_71.vcproj

If you unpack the zip file, the same way I made it up, it should compile
and link. When you run it, all the options are the same as the original
ps3000con, but I've added an 'L' option to attempt to collect a data set in
microseconds of longer than a second:

Image

the 'L' option calls collect_fast_streaming

hopefully you, me, or someone else can take this program a bit further
towards completion.

Sincerely,

Jon
jleslie48
Active User
Active User
 
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm

Postby jleslie48 » Mon Mar 05, 2007 8:26 pm

ok I re-analiyzed my run and collect_fast_streaming is NOT collecting any
data. the data I was looking at is left over from the previous 'B'
command.

I am hitting the stub though, on the second pass of the 'L' option, why
isn't the stub occuring on the first pass?
Although the program crashes on the return from the stub. Any
suggestions?

heres the log of the run:


PS3000 driver example program
Version 1.0



Opening the device...
Handler: 1
Device opened successfully

Driver Version: 3, 1, 0, 2
USB Version: 2.0
Hardware Version: 6
Variant Info: 3424
Serial: IJY57/98

B - immediate block V - Set voltages
T - triggered block I - Set timebase
E - ETS block F - toggle signal generator on/off
S - Streaming A - ADC counts/mV
L - Loki 5 second grab X - exit
Operation: B

Collect block immediate...
Press a key to start
timebase: x2 oversample:x1 max_samples:130559
First 10 readings
Value
time unit: 3
(ns)
18 -14 -7 21
8 5 12 32
8 -4 -7 32
8 -4 -7 21
8 -4 12 10
-1 -25 -7 21
-1 -4 -18 10
-22 -4 2 32
18 -14 -7 21
8 -14 -7 21

B - immediate block V - Set voltages
T - triggered block I - Set timebase
E - ETS block F - toggle signal generator on/off
S - Streaming A - ADC counts/mV
L - Loki 5 second grab X - exit
Operation:L

Collect streaming...
OK: 1

B - immediate block V - Set voltages
T - triggered block I - Set timebase
E - ETS block F - toggle signal generator on/off
S - Streaming A - ADC counts/mV
L - Loki 5 second grab X - exit
Operation: L

Collect streaming...
OK: 1
stub. StreamingGetOverviewBuffersMaxMin


I set a breakpoint at the stub:

Image

I don't know if its significant, but note the value of nValues, thats some
sort of overflow.
and when I allow the stub function to return the program crashes:

Image
jleslie48
Active User
Active User
 
Posts: 13
Joined: Tue Feb 13, 2007 3:20 pm


Return to PicoScope 5

Who is online

Users browsing this forum: No registered users and 0 guests