PDA

View Full Version : RS TrendX as an active X control


JohnW
June 23rd, 2004, 07:02 AM
I am trying to use RS TrendX as an active X control in a Delphi SCADA project, I can't get the data into the control. can anyone help?

Here is the code I'm using;

procedure TTrendForm.Timer1Timer(Sender: TObject);

Var
VacRaw,VacScaled : integer;
DemRaw, DemScaled : integer;
Variable: variant;
DataVac: array [0..1] of variant;
Begin

Begin
//get data from PLC
VacRaw := N7[10]; //(N7 is a global variable array)

//scale data from PID to engineering units (mBar)
VacScaled := (VacRaw * 1000)div 16383;
DataVac[0]:= VacScaled;

//send value to RS TrendX control
RSTRendX1.NewData (now,Timer1.Interval,DataVac);


end;



end;