PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
procedure InitOscillo;
var
i : Integer;
lth : Integer;
str : String;
str2 : array [1..80] of Char;
begin
if Opened then
DebugMsg('Début d''initialisation de l''oscillo');
Opened:=adc200_open_unit(Port);
if Opened then
begin
DebugMsg('ADC216 ouvert correctement');
for i := 0 to 4 do
begin
lth := adc200_get_unit_info (str2, sizeof (str2), i, port);
SetString (str, pchar (@str2), lth);
DebugMsg(str);
end;
end
else
begin
DebugMsg('Impossible d''ouvrir l''ADC216');
lth := adc200_get_unit_info (str2, sizeof (str2), 1, port);
SetString (str, pchar (@str2), lth);
DebugMsg(str);
Timebase:=6000*(2 shl TimebaseDivider);
MaxSamples:=16366;
Exit;
end;
DebugMsg('Configuration en AC / DC...');
adc200_set_dc(0,IsDC[0]);
adc200_set_dc(1,IsDC[1]);
DebugMsg('Réglage du gain...');
adc200_set_range(0,Gain[0]);
adc200_set_range(1,Gain[1]);
DebugMsg('Mode 2 voies...');
adc200_set_channels(2);
DebugMsg('Sur-échantillonage...');
adc200_set_oversample(Oversample);
DebugMsg('Base de temps...');
DebugMsg('Timebase validée : '+IntToStr(Byte(adc200_set_timebase(Timebase,IsSlow,TimebaseDivider))));
DebugMsg('Valeur Timebase ns : '+IntToStr(Timebase));
MaxSamples:=adc200_max_samples;
DebugMsg('MaxSamples: '+IntToStr(MaxSamples));
adc200_set_trigger(False,Source,Direction,0,0);
adc200_set_rapid(False);
DebugMsg('Configuration terminée');
end;
Code: Select all
adc200_run(MaxSamples);
repeat
// Application.ProcessMessages;
until adc200_Ready;
//adc200_stop;
for i:=0 to 10 do
begin
xOk:=adc200_get_values(BufferA,BufferB,MaxSamples);
if xOk then
Break;
end;