|
|
| Author |
Message |
bob.freeth Active User

Joined: 03 May 2008
Posts: 5
Location: New Milton
|
Posted: Thu May 08, 2008 8:59 am Post subject: PicoScope 2203 VB sample program crashes VB6 |
|
|
When running the VB sample program with a PicoScope 2203 using VB6 running under Vista Business 32 bit:
1. after clicking Open I receive the message PS2000 opened
2. after clicking theFast button the VB6 environment greys out and I receive a Windows dialog showing:
Visual Basic has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
The statement that causes the crash is in the procedure Fast_Click:
ok = ps2000_get_values(ps2000_handle, Values_a(0), 0, 0, 0, overflow, 100)
Suggestions anyone?
Is it known that the sample program works with Vista?
Thanks. |
|
| Back to top |
|
 |
bob.freeth Active User

Joined: 03 May 2008
Posts: 5
Location: New Milton
|
Posted: Thu May 08, 2008 9:27 am Post subject: |
|
|
I have also tried the sample program on XP Pro SP3 and the VB6 environment also crashes when the Fast button is clicked.
When a compiled version is run it just closes after the Fast button is clicked.
Has anyone got this sample to run with a 2203?
Thanks |
|
| Back to top |
|
 |
markspencer Site Admin

Joined: 07 May 2003
Posts: 607
|
Posted: Tue May 13, 2008 1:19 pm Post subject: |
|
|
Hi,
I am sorry that you have experienced problems with the ps2000 vb example. I have looked in to this and found that the funcion call has to have a buffer for each paramater:
| Code: |
'The following should be placed under the
ReDim Values_a(200000) As Integer
'which is part of the Fast_Click procedure
ReDim Values_b(200000) As Integer
ReDim Values_c(200000) As Integer
ReDim Values_d(200000) As Integer
ok = ps2000_get_values(ps2000_handle, Values_a(0), Values_b(0), Values_c(0), Values_d(0), overflow, 100) |
|
|
| Back to top |
|
 |
bob.freeth Active User

Joined: 03 May 2008
Posts: 5
Location: New Milton
|
Posted: Tue May 13, 2008 2:12 pm Post subject: Problem resolved - thank you |
|
|
Thank you for the resolution to the problem.
There is a similar coding error in the procedure Timer1_Timer() and by applying the same technique it can also be made to work.
The original statement of
no_of_values = ps2000_get_values(ps2000_handle, Values_a(0), 0, 0, 0, overflow, no_of_values)
when changed to
no_of_values = ps2000_get_values(ps2000_handle, Values_a(0), Values_b(0), Values_c(0), Values_d(0), overflow, 100)
and the following additional re-dims
ReDim Values_b(1024) As Integer
ReDim Values_c(1024) As Integer
ReDim Values_d(1024) As Integer
placed after
ReDim Values_a(1024) As Integer
enables the program to run fine.
Many thanks for your help |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|