ADC100 In fast mode with USB parallel port adapter fitted

Post general discussions on using our drivers to write your own software here
Post Reply
ceejaytee
Active User
Active User
Posts: 11
Joined: Sat Feb 03, 2007 10:43 am
Location: Colchester

ADC100 In fast mode with USB parallel port adapter fitted

Post by ceejaytee »

For the past 2 years I have been using a Delphi program, written by myself, to gather information from a test rig via an ADC100 device and the parallel port. All has been fine until I connected your USB/Parallel Port Adapter.
The program has been altered to read from USB-PP1 instead of LPT1 (port 101 instead of port 1).
My software is requiring readings to be taken over a 16sec time scale and sample 3000 times in that time, normally no problem.

This is set by the following method:

adc100_set_range(10000,1000); {Set ADC100 voltage range dependant on test in this case ±10V and ±1V}
adc100_set_interval (16000000, 3000, 0);{16 secs @ 3000Chn A}


Unfortunately since installing the USB adapter this just does not happen! ,it appears that no sampling takes place unless I slow it right down.
I have run your Delphi sample program in both Delphi 3 and Delphi BDS 2006 and found that 'Slow' sampling is fine but 'Fast' block just does not appear to work.

Just as an aside I have an older ADC10 device which when connected with the USB/Parallel adapter samples in fast and slow mode absolutely fine.

Can you help solve this problem?.

Thanks in advance
chris....

p.s. Picoscope seems o.k running fast <1mS with the USB/Parallel adapter.

ceejaytee
Active User
Active User
Posts: 11
Joined: Sat Feb 03, 2007 10:43 am
Location: Colchester

Additional info regarding ADC100 USB/Parallel Adapter

Post by ceejaytee »

Further to my previous post I have discovered that in the Delphi example for the ADC100 during fast mode the code

ok := adc100_get_times_and_values (times, valuesa, valuesb, 100) > 0;

does not return a boolean true result.

Thus the results are not displayed. If you override and code ok:=true; the results are displayed but are erratic to say the least.

I am not sure if this helps but could there be a conflict involving the USB adapter?..
Thanks chris.....

ceejaytee
Active User
Active User
Posts: 11
Joined: Sat Feb 03, 2007 10:43 am
Location: Colchester

Post by ceejaytee »

Long time no replies.

With reference to the original question above........

Having had similar problems with a PS3224 which turned out to be syntax and variable type issues regarding use within Delphi environment.

Has anybody out there successfully adapted a Delphi coded progam using a parallel port (ADC100) to a parallel port (ADC100) that uses the USBPP adapter???.
Although I have adapted my program to use the newer PS3224 device its bugging me that I haven't been able to make the ADC100 function correctly using the USBPP adapter.
And yes I am using the latest drivers and Picoscope appears to function correctly.

Thanks in advance.

User avatar
markspencer
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Post by markspencer »

Hi Chris,

When using the USN to Parallel port adapter you need to add additional lines of code to your program.

In the *.inc file add this:

procedure adc100_run
(no_of_values : longint;
method : shortint);
{$IFDEF WIN32} stdcall; external 'ADC10032.dll'; {$ELSE} far; external 'ADC10016'; {$ENDIF}


function adc100_ready
: shortint;
{$IFDEF WIN32} stdcall; external 'ADC10032.dll'; {$ELSE} far; external 'ADC10016'; {$ENDIF}


To your program add this between calling adc100_set_interval and adc100_get_times_and_values.

{already exist in your code sample}
us := adc100_set_interval (16000000, 3000, 0);


adc100_run (3000, 0);

while (adc100_ready < 1) do begin end;


{already exist in your code sample}
ok := adc100_get_times_and_values (times, valuesa, valuesb, 3000) > 0;


Best regards,
Mark S

ceejaytee
Active User
Active User
Posts: 11
Joined: Sat Feb 03, 2007 10:43 am
Location: Colchester

Post by ceejaytee »

Hi Mark

Many thanks for your reply.
I have changed the code as you suggested and found that the USBPP adapter is now starting to operate. But, I seem to be limited to a maximum interval length of 2 seconds.
If I set the interval length to anything above this then the program seems to freeze. I have tried different sample values (100 thru to 3000) and have found that the number of samples appears to have no effect.
Is there a limit to the interval period whilst using the USBPP adapter?.

Once again many thanks. Chris.

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

Hi,

We have not managed to recreate your problem. Have you tried to recreate this problem on PicoScope?

Let me know how you get on.

Kind regards
Ziko

Technical Specialist

ceejaytee
Active User
Active User
Posts: 11
Joined: Sat Feb 03, 2007 10:43 am
Location: Colchester

Post by ceejaytee »

Hi
Thanks for your reply.
I have tried PicoScope on my desktop and the laptop computer I mainly use with the following results..

1, Desktop 1.3GHz/512Mb running XP Home. Picoscope runs fine with both USBPP adapter and the Parallel port.
Running your example Delphi program with the modified code the fast sampling is fine until a period longer than 3 seconds is used whilst using the USBPP adapter. Using the parallel port only, all is ok.

2, Acer 1.5GHz/1Gb laptop running XP Home. Using the USBPP adapter the Picoscope is very 'jerky' (1 to 2 second delays between samples) and anything over 100ms/divs provides an incomplete trace length. With the X scale set to 1s/div the trace starts and then is cut short after anything from 1/4 second to 1.5 seconds before clearing.
Running your example Delphi program with the modified code the fast sampling, as descibed before, is fine at any period shorter than 2 seconds.

Are you aware of any conflicts with Firewalls or Anti-virus software?.
Are USB ports on laptops any different from desktops?. Silly question I know but I had to ask.

Thanks Chris..........

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

Hi I would try and make sure that the anti virus software is not causing this problem, I have had a a customer with a problem with his anti virus software causing conflict. USB ports on laptops are the same as the ones on PCs.

Let me know how you are getting on.

Kind regards
Ziko

Technical Specialist

ceejaytee
Active User
Active User
Posts: 11
Joined: Sat Feb 03, 2007 10:43 am
Location: Colchester

Post by ceejaytee »

Hi
Thanks for your reply.
I have switched off my Anti-virus and Firewall software plus anything else that does not need to be running but it has had no effect on PicoScope, the strange results whilst using the ADC100 device with a USBPP adapter are still occurring.

In addition to using the ADC100 with USBPP adapter I have also run a PS3224 device which functions perfectly within Picoscope and with my own Dephi software on both computers.

One thing I have discovered is that the desktop computer will except running the modified Delphi example if I allow it to take alot of data i.e. 10000 samples in 20secs. If this sample rate is reduced then the sampling time also has to be reduced !. Any clues to why this happens?.
(This does not work whilst running on the laptop the maximum time sampling is allowed is 2 seconds.)
An observation made is that my desktop computer is using an earlier USB 1.1 port whereas the laptop is a USB 2.0.
I have a 16 secs *.avi file of PicoScope running showing the strange results it produces, if it would help I can send you a copy?.

Thanks again Chris........

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

Hi thank you for the further information, I will forward this to the software engineers to see if they can come up with an answer.

If you wish to send the file, please send it to support@picotech.com, the file limit is 5MB.

Kind regards
Ziko

Technical Specialist

ceejaytee
Active User
Active User
Posts: 11
Joined: Sat Feb 03, 2007 10:43 am
Location: Colchester

Post by ceejaytee »

Hi there

Any news on a possible solution to my problem?.

Regards
Chris

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

The ADC100 was designed to run on DOS, due to the way Windows XP buffers the data, on some computers running Windows XP the ADC100 does not work properly, unfortunately there is nothing we can do about this. You have a number of options, you can revert back to an older operating system, which we do not support anymore or you can consider purchasing a new scope, I would recommend the 3224 as it is superior to the ADC100 in all aspects.

http://www.picotech.com/pc-scope.html

Kind regards
Ziko

Technical Specialist

Guest

ADC10 with VB6

Post by Guest »

I am having problems with the ADC10 (and ADC42) connected to the USB2 port with the USB-par port adapter.

It detects the ADC and works (slowly) in 'Slow' mode.
In Fast mode it seems to run, but the values are nonsense and it only took 2s to sample for what should have been 10s.

Could you tell me the code i need to put in the .bas file (similar to the .inc file of Delphi) and the extra code i need to put in the VB programme file.

I appreciate that it still may not work 100% correctly as it was designed for DOS.
thanks

Guest

ADC10 with VB6

Post by Guest »

ps I am using
port =101
product = 10 (or 42 for the adc42)

thanks.

User avatar
markspencer
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Post by markspencer »

Hi

The extra function calls for the ADC-10, 12, 40 and 42 when using the USB to Parallel port converter arte as follows:

add to the .bas file

Declare Sub adc10_run Lib "adc1032.dll" (ByVal no_of_values As Integer, ByVal method As Integer)

Declare Function adc10_ready Lib "adc1032.dll" () As Integer

Declare Function adc10_stop Lib "adc1032.dll" ()

Add to the .inc file

procedure adc10_run
(no_of_values : longint;
method : shortint);
{$IFDEF WIN32} stdcall; external 'ADC1032.dll'; {$ELSE} far; external 'ADC1016'; {$ENDIF}

function adc10_ready
: word;
{$IFDEF WIN32} stdcall; external 'ADC1032.dll'; {$ELSE} far; external 'ADC1016'; {$ENDIF}

procedure adc10_stop;
{$IFDEF WIN32} stdcall; external 'ADC1032.dll'; {$ELSE} far; external 'ADC1016'; {$ENDIF}

Best regards,
Mark S.

Post Reply