S
shuusaku
Dear all,
I'm not sure this is the right place to ask for help, but I cannot find
any solution anywhere else, I hope you could help me.
I'm using Borland C++ Builder 6 with TeeChart v4.04 standard. I'm
writing a simple application that should acquire a signal from an
acquisition board, and diplay it on the screen. The signal is sampled
at 1000 hz, and I'm calculating its rms every 33 msec. Every time I
have a vector with ulCount (=33) samples, and I should:
- add each point to the current graph
- calculate its rms (and maybe display it on a separate chart).
These are my problems:
1. is there any way to add all the vector to the chart, without using a
for loop for each point? This is more or less the code I'm using:
int nTmpCount
for (int i=0; i<ulCount; i++) {
Chart1->Series[0]->AddXY((float)nCounter++/1000,pdVoltBuffer,"",0);
nTmpCount =Chart1->Series[0]->Count();
if ( nTmpCount>2000) // I'm plotting 2000 points
Chart1->Series[0]->Delete(0);
}
2- by using the code above, I get a lot of "list index out of bounds"
errors, but I cannot understand why and where. They just happen.
3- instead, by plotting the rms (only one new point each time,
everything seems fine (at least, now everything is working).
Any idea on how to solve the above problems, or where to look for some
help?
Thanks,
Massimiliano
I'm not sure this is the right place to ask for help, but I cannot find
any solution anywhere else, I hope you could help me.
I'm using Borland C++ Builder 6 with TeeChart v4.04 standard. I'm
writing a simple application that should acquire a signal from an
acquisition board, and diplay it on the screen. The signal is sampled
at 1000 hz, and I'm calculating its rms every 33 msec. Every time I
have a vector with ulCount (=33) samples, and I should:
- add each point to the current graph
- calculate its rms (and maybe display it on a separate chart).
These are my problems:
1. is there any way to add all the vector to the chart, without using a
for loop for each point? This is more or less the code I'm using:
int nTmpCount
for (int i=0; i<ulCount; i++) {
Chart1->Series[0]->AddXY((float)nCounter++/1000,pdVoltBuffer,"",0);
nTmpCount =Chart1->Series[0]->Count();
if ( nTmpCount>2000) // I'm plotting 2000 points
Chart1->Series[0]->Delete(0);
}
2- by using the code above, I get a lot of "list index out of bounds"
errors, but I cannot understand why and where. They just happen.
3- instead, by plotting the rms (only one new point each time,
everything seems fine (at least, now everything is working).
Any idea on how to solve the above problems, or where to look for some
help?
Thanks,
Massimiliano