Greetings! Earlier I submitted in Pico Technology Forum Index -> General Software Discussions , thread USB Parallel Port and ADC11, and Michael kindly posted a reply there. But it seems the topic fits better under category:
VB incl Excel: Following on from Michael's abovementioned reply (qv):
Thanks, Michael, for the response above. I imagine that the "new dll" which you suggest, with fixed adc11_ready routine, is adc1132.dll included in the package PicoFull_r5_14_6.exe. I have indeed downloaded and installed that package, and have adc1132.dll, 100kB, modified Monday, 24 July 2006 11:13:02, in the subdirectory C:\Program Files\Pico Technology\Pico Full\.
I regret that my previous posting was unnecessarily voluminous and try here to be more concise.
I am now trying to use the Excel example adc1132.xls from r5.14.6 with USB ADC11/10, GFY6448 06Jan06, w driver PICOPP.SYS V1.12, in win98SE, Excel SR-2. Machine is a Celeron 2.4GHz, w 256MB RAM.
I have adapted the code in that adc1132.xls to allow for using the USB ADC11, also eg in accord w indications in Excel's VBA help. The code can be seen in file ADC1132_5146h.XLS which I will add hereto as attachment.
There are now two versions of adc1132.dll at issue:
A) adc1132.dll from r5.14.4 with size 80kB and date 15/6/2006, 09h59.
B) the "new" adc1132.dll from r5.14.6 with size 100kB and date 24/7/2006, 11h13.
With the stmt Call adc11_get_times_and_values ... commented out, I find that the code runs OK, including stmnts:
If opened Then
Cells(17, "h").value = adc11_ready()
. . .
Call adc11_run(100, 0) ' per PicoForum->General Software Disc'ns/USB Parallel Port and ADC11
While adc11_ready() = 0
Wend
Cells(17, "h").value = adc11_ready()
indeed this is the case regardless which of the two versions of adc1132.dll is in \Pico Full\. Ie, when I step thro, the value in cell 17H changes from 0 to 1 on executing stmt Cells(17, etc following stmt Wend. Locals window in the VBA IDE indicates the same. Also when I press F5 (Run), I see the value in cell 17H change from 0 to 1.
So it appears questionable whether there was anything wrong w the ready call.
However, I regret to say that the macro and Excel still crash on executing the stmt
Call adc11_get_times_and_values(times(), values(), 100)
w msg "This program has performed an illegal oper'n"
Using adc1132.dll from r5.14.4, detail is:
EXCEL caused an invalid page fault in
module <unknown> at 0000:00480000.
Registers:
EAX=ffffffff CS=018f EIP=00480000 EFLGS=00010246
EBX=00480000 SS=0197 ESP=00480000 EBP=00480000
ECX=0062f5c8 DS=0197 ESI=00480000 FS=50af
EDX=00480000 ES=0197 EDI=00480000 GS=0000
Bytes at CS:EIP:
Stack dump:
Using adc1132.dll from r5.14.6:
EXCEL caused an invalid page fault in
module <unknown> at 0000:012c04a4.
Registers:
EAX=0062f5c8 CS=018f EIP=012c04a4 EFLGS=00010246
EBX=0062f5c8 SS=0197 ESP=005300fc EBP=0053011c
ECX=005301a0 DS=0197 ESI=81914e2c FS=0de7
EDX=bff76855 ES=0197 EDI=005301c8 GS=0000
Bytes at CS:EIP:
Stack dump:
bff76849 005301c8 0062f5c8 005301e4 005301a0 005302d4 bff76855 0062f5c8 005301b0 bff87fe9 005301c8 0062f5c8 005301e4 005301a0 012c04a4 0053038c
So I will be grateful of indication how to avoid such crash; is it possible that there is a problem with the routine adc11_get_times_and_values in adc1132.dll? Am I right in understanding that it is appropriate to call this routine after adc11_ready returns True?
Of course, the package includes also (since PicoFull_r5_14_4.exe) a new usbadc11.dll, 108kB, modified Tuesday, 1 August 2006 10:51:30, which the installer has placed in C:\Program Files\Pico Technology\Pico Full\ and in \Examples\ADC11\, but which isn't mentioned in the manual. There are no suggestions in the documentation or Excel- or VB examples that usbadc11.dll needs to be on hand, and no indications that usbadc11.dll functions must be declared or called. There is only the indication in adc11.hlp "The same ADC1132.dll file can be used in all 32-bit versions of Windows, with both parallel port and USB port products".
I am open to the idea of using DDE instead of the DLL, as the files PLW044.pdf and PLW044.hlp suggest. So I would be grateful of indication where I can find the fuller information re using DDE, from eg VBA or VB. I would want to get readings from perhaps 8 or more channels, mostly w fairly accurate and precise indication of the time of the reading(s), since I want to calculate rates of change, over periods of 5s to 10s.
***MORE OBSERVATIONS
- in win98se, if you try to step thro get_adc11 in adc1132.xls it hangs on executing stmt: opened = adc11_open_unit. LED doesn't light up. You have to use CtrlAltDel to close Excel.
But if you first run Picolog, then close it, then step thro adc1132.xls, then at stmt opened = adc11_open_unit, LED lights after a short delay, and highlight moves to next stmt: If opened Then
and you can step further thro the Sub, apart from get times and values (or just press F5 / Run)
Is it possible to arrange that the stmt opened = adc11_open_unit will work without first running PicoLog?
I regret to be critical, but think it justified to comment on the current system for obtaining updates of software, where a user has to download the entire update package covering the full range of Pico products, moreover multilingual, hence ~24MB in size. In my locality it is not common to have a high speed connection; we rely on 56k dial-up because of the rather greater cost of broadband. Consequently it is problematic to have to obtain a 24MB download. Is it possible to arrange that one can download a package(s) applicable only to the unit(s) which one has, and perhaps (tho less importantly perhaps) to the language required?
Cart


