How to get a large data set into an xPC Target model

1 次查看(过去 30 天)
I want to add a large data set into my xPC Model so it can pull from it every step as the input but run for a long time. So I tried using a From Workspace block and the size of my data is 165000x40 and results in a Out Of Physical Memory error and Corrupted File on my xPC system when I try to load it. But the Simulation runs just fine in Simulink. The DLM file is 25MB so it's not a really large file, but I believe this block and variable is the problem. Is there any other way to get large data into xPC and use it like a From Workspace block where it is time-based?

回答(1 个)

Ankit Bhatnagar
Ankit Bhatnagar 2017-5-15
Hi,
There isn't a way to use a disc or file to save the data for the xPC target. xPC target goes out of memory as 165000*40*64 bites is more than the memory it has.
One thing you can try is to typecast this value as int32 as double requires 64 bits and use it in your target PC. Although certain blocks like scope do require variables to be in double format, you may need to check.
  1 个评论
Thomas Marullo
Thomas Marullo 2017-5-16
Thank you for your answer. I like the int32 idea and I will try it.
My xPC system has 8GB of RAM. The DLM file is 110 MB large. Assuming the lookup table data goes into RAM, 165000*40*64 = 422,400,000 bytes or 422MB. Where am I running of memory?

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by