Thread Subject: CPU overloaded , XPc Target

Subject: CPU overloaded , XPc Target

From: smar

Date: 22 Feb, 2009 10:13:02

Message: 1 of 7

Hello,
I am using Matlab XPc target to acquire real time data from sensors.
I am using NI 6602 board.
After staring application; within first few seconds, I am getting the error.
"CPU overloaded at time 1-2 seconds"
What could be the possible reason?
Thanks
smar

Subject: CPU overloaded , XPc Target

From: Gordon Weast

Date: 23 Feb, 2009 14:24:44

Message: 2 of 7

There are lots of ways you could be getting into trouble here.

Since you haven't told me the version of MATLAB, or compiler,
or machine type or speed, or sample time, I have nothing to
go on.

It could be that your sample time is just too short.

It could be that the BIOS in your machine has set up system
management interrupts (SMI) that strongly interfere with real
time performance.

Try running 'xpcbench this' from the MATLAB command prompt and
see how your target machine performs. If it is much worse than
the typical machine of it's type, then the BIOS/SMI problem may
be at fault.

The MathWorks tech support is set up to help you with this kind
of problem.

Gordon Weast
xPC Target Development
The MathWorks

smar wrote:
> Hello,
> I am using Matlab XPc target to acquire real time data from sensors.
> I am using NI 6602 board.
> After staring application; within first few seconds, I am getting the error.
> "CPU overloaded at time 1-2 seconds"
> What could be the possible reason?
> Thanks
> smar

Subject: CPU overloaded , XPc Target

From: smar

Date: 23 Feb, 2009 20:24:01

Message: 3 of 7

thanks for the reply,
matlab version is 2008b
i now founf that the problem comes only when i do data logging or data tracing.
in free run more on target pc, there is no problem,

i am doing data logging by this way


y = []; flag = 0;

  start(tg); % Start model execution
  pause(2*tg.StopTime);
  outp = tg.OutputLog; % Upload output and
  y = [y, outp(:, 1)]; % store in a matrix
  t = tg.time; % Upload time vector

plot(t, outp(:, 1)); % Plot data for current run
  drawnow;


I will be thank ful for further help
smar

Subject: CPU overloaded , XPc Target

From: Gordon Weast

Date: 24 Feb, 2009 16:15:57

Message: 4 of 7

It could depend on the size of the outputlog. Although, since you're
waiting until well after the target should have stopped, the step of
downloading the data shouldn't be the problem.

You really need to contact tech support about this. Open a help request
and I'm sure one of us can help you solve the problem.

Gordon Weast
xPC Target Development
The MathWorks

smar wrote:
> thanks for the reply,
> matlab version is 2008b
> i now founf that the problem comes only when i do data logging or data tracing.
> in free run more on target pc, there is no problem,
>
> i am doing data logging by this way
>
>
> y = []; flag = 0;
>
> start(tg); % Start model execution
> pause(2*tg.StopTime);
> outp = tg.OutputLog; % Upload output and
> y = [y, outp(:, 1)]; % store in a matrix
> t = tg.time; % Upload time vector
>
> plot(t, outp(:, 1)); % Plot data for current run
> drawnow;
>
>
> I will be thank ful for further help
> smar

Subject: CPU overloaded , XPc Target

From: smar

Date: 25 Feb, 2009 20:12:02

Message: 5 of 7

Thanks for the reply,

I was using model sampple time of 0.001 sec and outputlog sample time of 0.001.
CPU was overloading.
I increase the outputlog sample time to 0.05. now it worked fine.
Could you please explain me the the case.
Actually my application need at least sampling time of 0.001 or even 0.0001 is desireable.

A further question.
In this way of data logging. Where actually data save first before it get downloaded to host.
It is direct saving to host PC? , some intermediate saving in target PC involve.

Is there an other better alternative way of real time data saving.(direct or indirect throught intermediate Target PC saving) ?
Thsnk you very much

Subject: CPU overloaded , XPc Target

From: Gordon Weast

Date: 25 Feb, 2009 22:00:00

Message: 6 of 7

I guess one issue is exactly how much data are you trying to log?

How many elements at each sample time?
What is the stop time?
How big is your logging buffer, as selected in the model parameters dialog?

For moderate amounts of data, the TET shouldn't change much when you
turn logging on. I have to guess that you're using a large fraction
of a large memory on your target.

After you get an overload, you can look at the TET log and see if
the time is gradually increasing, or if you just got a large single
hit on the time.

 > plot(tg.tetlog)

Gordon Weast
xPC Target Development
The MathWorks

smar wrote:
> Thanks for the reply,
>
> I was using model sampple time of 0.001 sec and outputlog sample time of 0.001.
> CPU was overloading.
> I increase the outputlog sample time to 0.05. now it worked fine.
> Could you please explain me the the case.
> Actually my application need at least sampling time of 0.001 or even 0.0001 is desireable.
>
> A further question.
> In this way of data logging. Where actually data save first before it get downloaded to host.
> It is direct saving to host PC? , some intermediate saving in target PC involve.
>
> Is there an other better alternative way of real time data saving.(direct or indirect throught intermediate Target PC saving) ?
> Thsnk you very much

Subject: CPU overloaded , XPc Target

From: smar

Date: 31 Mar, 2009 17:01:02

Message: 7 of 7

Thanks Mr. Weast for useful reply,

I would like to peruse my CPU overload problem while data logging (xPC Target) once again.


I am getting data from 5 sensors with time stamping
Like this [time 2.56789 2.56789 2.56789 2.56789 2.56789 ]

if is use only one sensor, it is again cpu overshoot
Like this [time 2.56789 ]


The frequency of this incoming data is about 1000 KHz (on DAQ board in Target PC)

Stop time = 5 seconds

Logging buffer size of model parameters = 100000


Computer is overloading for:
Model sample time of 0.001 sec and
outputlog sample time of 0.001.

Working fine for:
Model sample time of 0.05 sec and
outputlog sample time of 0.05.

I want sample time of 0.001 or in even 0.0001.

thanks for any gurther assisstance
smar

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com