DSOLink and continous reading

Hi,

I’m trying to do a continuous reading via DSOLink.
My configuration :

  • Windows 7
  • PCSU1000
  • PcLab2000SE v4.05
  • Access to the dll with Java 1.7 via JNA

If i want to get data for a single run, it works. My problem is when I try to get data for several continuous run.

private void waitForData()
    {
       long t1 = System.currentTimeMillis();
       System.out.println("Process : "+(t1-t0));
       t0 = t1;
       
       while((thread != null)&&(!dsolink.DataReady())) {
          try {
            synchronized(thread) { thread.wait(1); }
          }
          catch(Exception ex) {}
        }
       
       t1 = System.currentTimeMillis();
       System.out.println("Wait : "+(t1-t0)+" ms");
       t0 = t1;
    }
    
    public void run()
    {
      Pointer buffer1 = new Memory(5000 * Native.getNativeSize(Integer.TYPE));
      Pointer buffer2 = new Memory(5000 * Native.getNativeSize(Integer.TYPE));
        
      System.out.println("Go");
      t0 = System.currentTimeMillis();
      
      waitForData();
      dsolink.ReadCh1(buffer1);
      dsolink.ReadCh2(buffer2);
      
      waitForData();
      dsolink.ReadCh1(buffer1);
      dsolink.ReadCh2(buffer2);
      
      waitForData();
      dsolink.ReadCh1(buffer1);
      dsolink.ReadCh2(buffer2);
      
      int[] b1 = buffer1.getIntArray(0, 5000);
      int[] b2 = buffer2.getIntArray(0, 5000);
                   
      waitForData();
      dsolink.ReadCh1(buffer1);
      dsolink.ReadCh2(buffer2);
      
      int[] b1b = buffer1.getIntArray(0, 5000);
      int[] b2b = buffer2.getIntArray(0, 5000);
      
      waitForData();
      dsolink.ReadCh1(buffer1);
      dsolink.ReadCh2(buffer2);
      
      waitForData();
      dsolink.ReadCh1(buffer1);
      dsolink.ReadCh2(buffer2);
      
      System.out.println("Hz1:"+b1[0]);
      System.out.println("Hz2:"+b2[0]);
        
      System.out.println("FullScale1:"+b1[1]);
      System.out.println("FullScale2:"+b2[1]);
        
      System.out.println("GroundLevel1:"+b1[2]);
      System.out.println("GroundLevel2:"+b2[3]);

      ...

For a configuration of 10ms/div, I got :

Go
Process : 0
Wait : 8 ms
Process : 1
Wait : 135 ms
Process : 0
Wait : 375 ms
Process : 0
Wait : 370 ms
Process : 0
Wait : 376 ms
Process : 0
Wait : 376 ms
Hz1:12500
Hz2:12500
FullScale1:8000
FullScale2:8000
GroundLevel1:128
GroundLevel2:120
Finish

For 4098 samples at 12500Hz, the delay should be 328ms, i got ~375ms (+47ms) and so I don’t have every data (gaspe between 2 calls of ReadCh1/ReadCh2).
Same thing with with 1ms/div, the delay should be 33ms and I got ~95 ms (+62ms).
It doesn’t seem to be because of java calls (processing = 0ms).

Is DataReady should work like this ?
Is there a way to be sure to have all data ?

[quote]Is there a way to be sure to have all data ?[/quote]I’m sorry it is not possible.
Due to the operation principle of the oscilloscope, the continuous capture is not possible. A chunk of the data is stored to the oscilloscope’s RAM and then transferred to the PC via USB. This is why the continuous data stream is not possible.
The internal data buffer is 4096 samples/channel. This is the maximum amount of continuous data to record. The buffer must be read to the PC before the next data can be acquired.
The USB communication used is too slow to transfer the data in “real time”.
This is why in the oscilloscope mode the acquired data is always intermittent

Thanks for the reply. I suspect something like than (that make sense for really quick sampling).

I’m sure it is not possible but I ask it : I want to take a value every 1ms or 10 ms (USB can easily handle it). Can I reduce the number of samples in a ReadCh1/ReadCh2 (to 1 sample) so I can handle the timing in Java ?

[quote]Can I reduce the number of samples in a ReadCh1/ReadCh2 (to 1 sample) so I can handle the timing in Java ?[/quote]I’m sorry, also this is not usable method to speed it up.
Oscilloscope is always ‘pushing’ all the data 2x4096 bytes to PC.
It seems there is about 60 ms ‘overhead’ in this process.

Thanks again.

To conclude, I take a look at the VM205 as a remplacement. But it seems to work the same way (with a buffer a few smaller).

So what I need is more a ADC card/usb device than an oscilloscope. Anything in Velleman products ?

PCS10 is sampling at 10ms (100Hz) rate continuously.
It records only positive voltage.
Available also as kit version: K8047