Real time graph in delphi

hi
I’m working with the PCS10 / K8047 usb datalogger under delphi7

I need a real time graph (time volts), reading the logger

Can I use a chart, or is it just working for static values?
-> Do I need to read the series values from a Memo?(like in Velleman k8047_dll_fast.zip example)

I don’t find the way how to add the “ReadData” in my chart

Should be smthg like that:


procedure TForm1.Button…
begin
Series1.Add(…?????..)


or:


With Series1 do
begin
Add (1st value, ‘’, clRed);
Add (2nd value, ‘’, clRed);
Add (3rd value, ‘’, clRed);

end;


Thank you for any tip. (or if you have the solution under VB)

You may read the values from the K8047 to a two dimensional array and use the values to draw a line graph.
Here is an example how to read the data from the K8047 to a two dimensional array and output it from there to a memo for checking.

var Form1: TForm1; DataRead: ARRAY[0..7,0..100] OF LongInt;

procedure TForm1.Button1Click(Sender: TObject); var p:pointer; i,j:integer; s:string; begin for i:=0 to 99 do begin p:=@DataRead[0,i]; ReadData(p); end; //DataRead[2,98]:=125; //Test w/o hardware memo1.clear; for j:=0 to 99 do begin s:=''; for i:=0 to 5 do s:=s +inttostr(DataRead[i,j])+chr(9); memo1.lines.add(s); end; end;

thank you for your answer.

“You may read the values from the K8047 to a two dimensional array and use the values to draw a line graph.”

actually, that’s my problem…
I know how to read the logger and put it into a memo (with the help of the demo.lol), but I don’t know how the chart can read the values from the memo

…damned…looks so easy with delphi…^^…and there is just that little line missing…

or is it easier to do it with the old fashion way?
(->bmp in backgrnd + point after point + old points transparent when bmp limit reached)

thanks for the comments

I think the old fashion way is OK. Just add image component there and add this section to the code to draw CH1 data on the image:

{ first call FillRect to paint the surface of the form. this removes any previously drawn lines (and anything else!) } Image1.Canvas.FillRect(ClientRect); x:=0; y:=DataRead[2,x]; Image1.Canvas.MoveTo(x, 255-y); for x:=1 to 99 do begin y:=DataRead[2,x]; Image1.Canvas.LineTo(x, 255-y); end;