PC Oscilloscopes and LINUX?

Before starting the “low level” communication specifications I’d like to ask if you have checked the DLL made for the PCSGU250 ?
There are lot of ready built functions to begin.

Is it possible to use this DLL in Linux?
Do you need the source code for the DLL to rewrite it for Linux?

The DLL is a “link” between the full running PcLab2000LT.EXE and the user application. It just transfers the commands and data between these applications.

Using this DLL also the function generator control is very easy.

You may easily get the oscilloscope hardware operating and you can read the raw data from there.
Using the raw data you can do the further calculations e.g. FFT (Fast Fourier Transform) needed for the spectrum analyzer.

Also you may calculate and display the RMS value of the AC component and calculate and display the other waveform parameters.

On “low level” you have first to parse and send a binary .BIT file to the FPGA of the oscilloscope to get it running.

Also to get the function generator working, a wave table have to be calculated according to the selected output voltage level and the step attenuator settings. For the function generator wave generation in the DDS (Direct Digital Synthesis) core the RAM address increment and the increment of this increment for frequency sweep have to be calculated and sent to the generator.
I put here below a fraction of code how this all is done in the existing software. (Easier methods may be anyhow…)
At the end of this code you’ll see how the data buffer [color=#008000]tmpo [/color]is sent to the oscilloscope.

This is just a fraction of the “jobs” to do.

You may download the DLL package from the downloads page.
pcsgu250_dll_rev1.zip
Software development kit for PCSGU250, DLL with examples.

[code]var s:string;
i,j:integer;
incr, sw, swp,t1,t2,t3,t4,f,di:double;
n,m,o,p:cardinal;
a1,a2,a3,a4,a5,a6:byte;
a:array [0…20] of byte;
b:array [0…20] of byte;
begin
if filtteri>5 then di:=6.25e6
else di:=12.5e6;
if not demomode_on and USB_open then
begin
if aalto=6 then
begin
swp:=16256256*(stop_s-start_s)(Exp((44)ln(2))/di)/(step_s1e4);
if Form1.log.checked and (stop_s>start_s) then
swp:=128
256*(stop_s-start_s)(Exp((44)ln(2))/di)/(step_s1e4);
if Form1.log.checked and (stop_s<start_s) then
swp:=128
128256(stop_s-start_s)(Exp((44)ln(2))/di)/(step_s1e4);
if filtteri>5 then swp:=swp
2;
if swp<0 then swp:=-swp;
if swp<1 then swp:=1;
// label32.caption:=floattostr(swp); //*****
for i:=0 to 11 do b[i]:=0;
for j:=0 to 11 do
begin
sw:=swp/(Exp((88-j8)ln(2)));
swp:=frac(sw)
(Exp((88-j
8)*ln(2)));
for i:=0 to 7 do
begin
t1:=sw/(Exp((7-i)*ln(2)));
if t1>=1 then
begin
b[11-j]:=b[11-j]+round(Exp((7-i)ln(2)));
t1:=t1-1;
sw:=t1
(Exp((7-i)ln(2)));
end
else
begin
sw:=t1
(Exp((7-i)*ln(2)));
end;
end;
end;
a[0]:=b[0];
a[1]:=b[1];
a[2]:=b[2];
a[3]:=b[3];
a[4]:=b[4];
a[5]:=b[5];
a[6]:=b[6];
a[7]:=b[7];
end
else
begin
for i:=0 to 7 do a[i]:=0; // load sweep increment = 0 in NO sweep mode and sync mode setting
end;

 // Form1.label37.caption:='';              //******
 //for i:=11 downto 0 do Form1.label37.caption:=Form1.label37.caption+' '+inttostr(b[i]);  //*****

case f_alue of
  1: f:=taajuus/1000;
  2: f:=taajuus;
  3: f:=taajuus;
  4: f:=taajuus;
  5: f:=taajuus;
  6: f:=taajuus;
  7: f:=taajuus*1000;
  8: f:=taajuus*1000;
end;
incr:=f*(Exp((44)*ln(2))/di);
if aalto=6 then incr:=start_s*(Exp((44)*ln(2))/di);
//label10.caption:=floattostr(incr);         //*****
for i:=0 to 7 do  b[i]:=0;

for j:=0 to 5 do
begin
  sw:=incr/(Exp((40-j*8)*ln(2)));
  incr:=frac(sw)*(Exp((40-j*8)*ln(2)));
  for i:=0 to 7 do
  begin
    t1:=sw/(Exp((7-i)*ln(2)));
    if t1>=1 then
    begin
      b[5-j]:=b[5-j]+round(Exp((7-i)*ln(2)));
      t1:=t1-1;
      sw:=t1*(Exp((7-i)*ln(2)));
    end
    else
    begin
      sw:=t1*(Exp((7-i)*ln(2)));
    end;
  end;
end;
a[8]:=b[0];
a[9]:=b[1];
a[10]:=b[2];
a[11]:=b[3];
a[12]:=b[4];
a[13]:=b[5];
//label26.caption:='';
//for i:=7 downto 0 do label26.caption:=label26.caption+inttohex(b[i],2)+' ';
// for i:=7 downto 0 do label26.caption:=label26.caption+inttostr(b[i])+' ';

// number of cycles of 100us
if aalto=5 then num:=0 else num:=100000;        //num:=0  -> noise on
if aalto=6 then
begin
  if filtteri>5 then num:=round(1e4*step_s/2)
  else num:=round(1e4*step_s);
  if Form1.log.checked then num:=num div 8;
end;

//label30.caption:=inttostr(num)+'  '+floattostr(step_s);      //*****

asm
  mov  eax,num
  mov  a1,al
  shr  eax,8
  mov  a2,al
  shr  eax,8
  mov  a3,al
  shr  eax,8
  mov  a4,al
  shr  eax,8
end;
a[14]:=a1;
a[15]:=a2;
a[16]:=a3;
a[17]:=a4;
a[18]:=0;
if Form1.log.checked then a[18]:=2;
if stop_s<start_s then a[18]:=a[18] or $04;    // neg sweep
if aalto=5 then a[18]:=1;
a1:=3;
tmpo[0]:=14;  //load general setting
tmpo[1]:=2; //load increment on-the-fly
tmpo[2]:=19;   //number of bytes
for i:=0 to 18 do tmpo[i+3]:=a[i];
//Form1.MPUSBWrite(OutPipe,@a1,1,@SentDataLength,10);
//Form1.MPUSBWrite(OutPipe,@a,19,@SentDataLength,10);
Form1.MPUSBWrite(OutPipe,@tmpo,22,@SentDataLength,10);

end;
end;[/code]