Hi. I am new to Delphi, and I have some questions regarding Active X control:
I need to use an Active X component called "TRPcoX" in order to send command to another equipment (ie. TDT) for presenting FM signal. And I used the following code to determine the length of the signal, so that it will stop at a certain time. But it ends up an infinite loop. I noticed that the GetTagVal returns a very small single number and so, my "while" statement never able to reach the end and get out the loop. But I don't understand why GetTagVal returns an integer to single, whereas I thought it supposes to increment from 0. Here is my code:
const
NR= 24414.0625; // Nyquist Rate
SIGlength= 0.6;
RAMP= 0.02;
MODfreq =5;
matRampLen = 488; // 20 msec
matSigLen = 14648; // 600 msec
var
Form1: TForm1;
atten: real;
softTrgON, softTrgOFF,ch: integer;
RP: TRPcoX;
PA5x1: TPA5x;
curindex: single;
index, FMTone: string;
procedure TForm1.bPreSignClick(Sender: TObject);
begin
z:= RPCox1.WriteTag(FMTone,FM[1],0,15623);
z:= RPCox1.SoftTrg(softTrgON);
curindex := RPcox1.GetTagVal(index);
while (curindex < ((matSigLen + (2*matRampLen))-1)) do
begin
curindex := RPcox1.GetTagVal(index);
end;
z:= RPcox1.SoftTrg(softTrgOFF);
end;
Any suggestions or comments will be helpful. Thanks a lot!
I need to use an Active X component called "TRPcoX" in order to send command to another equipment (ie. TDT) for presenting FM signal. And I used the following code to determine the length of the signal, so that it will stop at a certain time. But it ends up an infinite loop. I noticed that the GetTagVal returns a very small single number and so, my "while" statement never able to reach the end and get out the loop. But I don't understand why GetTagVal returns an integer to single, whereas I thought it supposes to increment from 0. Here is my code:
const
NR= 24414.0625; // Nyquist Rate
SIGlength= 0.6;
RAMP= 0.02;
MODfreq =5;
matRampLen = 488; // 20 msec
matSigLen = 14648; // 600 msec
var
Form1: TForm1;
atten: real;
softTrgON, softTrgOFF,ch: integer;
RP: TRPcoX;
PA5x1: TPA5x;
curindex: single;
index, FMTone: string;
procedure TForm1.bPreSignClick(Sender: TObject);
begin
z:= RPCox1.WriteTag(FMTone,FM[1],0,15623);
z:= RPCox1.SoftTrg(softTrgON);
curindex := RPcox1.GetTagVal(index);
while (curindex < ((matSigLen + (2*matRampLen))-1)) do
begin
curindex := RPcox1.GetTagVal(index);
end;
z:= RPcox1.SoftTrg(softTrgOFF);
end;
Any suggestions or comments will be helpful. Thanks a lot!