Reading data from pcsu1000

Good day.
I’m trying to read data from an oscilloscope. There were several questions.

I need to read the data caught by the oscilloscope trigger.
Locked data -> readed
locked in -> readed
locked in -> readed
… etc.

My questions

  1. When does the DataReady function return TRUE?
  2. How often can a picture be updated on the PC screen? (How often i can read new trigged oscillogram. I need faster.) If for example I catch a signal every millisecond with a trigger, it is unlikely that the image on the screen will be updated every millisecond? Rather, it will be slower. How much slower?

Best regards, Anatoly.

This happens when 8192 bytes of data is acquired and the data is transferred to PC.

Based on the USB data rate, in theory about 10ms update rate may be possible.
For more details please see this thread.

Good day.
Thanks for the informative answer. Much helped to understand.
I need to save 10 oscillograms successively. The shorter the time between them, the better. Is the following code correct for this task?

p1,p2: Pointer;
data1, data2: array [0 … 5000] of longint;
// ------------------------------------
p1 = @data1[0];
p1 = @data2[0];
for i = 0 to 9 do
begin
while True do
begin
if DataReady then
begin
ReadCh1( p );
ReadCh2( p );
break;
end;
end;
end;

One more question: why is the size of data1 and data2 equal to 5000?
ReadCh1 and ReadCh2 return data

[0]: Sample rate in Hz
[1]: Full scale voltage in mV
[2]: Ground level in A / D converter counts. [3 … 4098]: The converter counts (0 … 255), from PCS500.
[3 … 4082]: The converter counts (0 … 255), from PCS100 and K8031.

Nowhere is the number 5000.
And additional for PCSU1000 [3 … ???]
Thanks in advance.

I tested with following code:

var
  Form1: TForm1;
  // Two-Dimensional Arrays:
  data1: array[0..5000, 0..9] of longint;
  data2: array[0..5000, 0..9] of longint;

  i:=0;
  repeat
    if DataReady then
    begin
      p:= @data1[0,i];
      ReadCh1(p);
      p:= @data2[0,i];
      ReadCh2(p);
      inc(i);
    end;
  until i>9;

This is just for “safety reasons” to avoid possible array overflow.
The minimum required is array of 4099 longints (32 bit integers).

Many thanks. I’ll try your code in the evening.

After further tests I had to fix the array definitions.
Here is the working code:

  data1: array[0..9,0..5000] of longint;
  data2: array[0..9,0..5000] of longint;

  i:=0;
  repeat
    if DataReady then
    begin
      p:= @data1[i,0];
      ReadCh1(p);
      p:= @data2[i,0];
      ReadCh2(p);
      inc(i);
    end;
  until i>9;

And here is the whole code I used:

unit DSOLink1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;

    procedure Button1Click(Sender: TObject);    
    procedure Button2Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  // Two-Dimensional Arrays:
  data1: array[0..9,0..5000] of longint;
  data2: array[0..9,0..5000] of longint;

implementation

{$R *.DFM}

{DLL procedures and functions}
procedure ReadCh1(Buffer: Pointer); stdcall; external 'DSOLink.dll';
procedure ReadCh2(Buffer: Pointer); stdcall; external 'DSOLink.dll';
function DataReady:Boolean; stdcall; external 'DSOLink.dll';

procedure TForm1.Button1Click(Sender: TObject);
var i: longint;
p:pointer;
begin
  i:=0;
  repeat
    if DataReady then
    begin
      p:= @data1[i,0];
      ReadCh1(p);
      p:= @data2[i,0];
      ReadCh2(p);
      inc(i);
    end;
  until i>9;
  
  memo1.clear;
  begin
    for i:=0 to 9 do
    memo1.lines.add(inttostr(i)+':'+chr(9)+'CH1: '+inttostr(data1[i,3])+chr(9)+chr(9)+'CH2: '+inttostr(data2[i,3])  );
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  if DataReady then  label1.caption:='Yes' else label1.caption:='No'
end;

end.

And here is the test output:
First data sample of each acquisition (0 … 9) of both channels are displayed.
dsolink1

Good day.
I probably do not understand something. GetSettings function is constantly returning false.
function GetSettings(SettingsArray: Pointer): Boolean; stdcall; external ‘PCSU1000D.dll’;
From hopelessness I tried to stupidly replace it with
function GetSettings(SettingsArray: Pointer): Boolean; safecall; external ‘PCSU1000D.dll’;
Returns the truth, but of course something further is buggy.
What can be wrong?

Software - v4.07
DLL’s from 12.08.2018

Thanks in advance.
PS: Other functions seem to work. But I have not researched it yet. But it seems to be true. But GetSettings - constantly returns false.

It works!
If I use debugging and step by step checking the program - it dosent work. Otherwhise - it works!
Why?

The function GetSettings returns true if the Start_PCSU1000 has been used to start the PCSU1000GU.exe during the same debug session.
If debug is terminated without using Stop_PCSU1000, the PCSU1000GU.exe stays running and can be closed manually before the next debug session.

Ok. I see.
Can the other library (DSOLink.dll) work without running PCSU1000GU.exe entirely?

The DSOLink.dll works if PCSU1000 software is normally running.

Hello
What input resistance do the PCSU1000 oscilloscope probes have? Or is it more correct to say the probe with the input circuit of the oscilloscope?
Thanks in advance.

In X10 position 10 MΩ
In X1 position 1 MΩ

The X10 probe uses a series resistor of 9 MΩ to provide a 10:1 attenuation when it is used with the 1 MΩ input resistance of the scope itself.

Many thanks.
Best regards.

Hello
Tell me please, what ADC chip is used in the PCSU1000 oscilloscope?
Best regards.

I already found out. Thanks
ADC08100 )))
The question is now different
The ADC is 8 bit and the oscilloscope provides 12 bits.
How is this problem solved?
Regards, Anatoly.

The resolution of the PCSU1000 is specified here 8 bits:

Thank you very much for the answer. Can you say something about the presence of oversampling in the PCSU1000? Because with 8 bits of the ADC, as a rule, the effective number of bits (ENoB) is 2-3 less, totaling only 5-6. Is there something similar in PCSU1000?

There is no oversampling used in the normal operation mode of the PCSU1000.
All the the 8 bit samples from the ADC are stored “as is”.
Instead there is an average mode (Options -> Average) available.
The Average mode can be used to remove random noise and to improve measurement accuracy.
The resulting waveform is a running average over a specified number of acquisitions.
The number of available averages are 2, 4, 8, 16, 32, 64 and 128.

BTW: The current ADC of the PCSU1000 is ADC08L060.
According to the data sheet the typical ENOB of this ADC is 7.6.

Many thanks.
Regards, Anatoly