How can I increase heap memory on TwinCAT hardware to deploy my model using Simulink Compiler?

11 visualizzazioni (ultimi 30 giorni)
I am trying to deploy my Simulink model to TwinCAT external hardware with Simulink Compiler. I can build the model successfully, however I get the following warning when increasing the duration from 120000s to 240000s:
Not enough memory on the target to process the packet.
How can I workaround this issue?

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 3 Ago 2023
The root cause of this issue is that increasing the “Duration” allows the capture of large real-time buffers. These buffers use heap section to allocate memory. A high value of “Duration” may result in "Not enough memory on the target to process the packet" warning, and consequently cause no data to be uploaded from the target to the host computer. The current workaround would be to increase the heap memory to satisfy this request from the code generated, using the following steps:
  1. Increase the heap size by modifying "TcRegistry.xml". The directory of the mentioned file is TwinCat/3.1/Runtimes/UmRT_Default/3.1;
  2. Modify the TcRegistery as follows
    <Key Name="System">
        <Value Name="RunAsDevice" Type="DW">1</Value>
    <Value Name="HeapMemSizeMB" Type="DW">65536</Value>
    <Value Name="AmsNetId" Type="BIN">C0A804010101</Value>
    </Key>
    and run the "Start" file in the directory TwinCAT/3.1/Runtimes/UmRT_Default
     
  3. Finally, within the TwinCat app, "SYSTEM/Real-Time" you should increase the Router memory from the default value (32 MB) to 512 MB.
  4. Please refer to this documentation for further details on increasing the heap memory on your target hardware: https://infosys.beckhoff.com/english.php?content=../content/1033/twincat_bsd/12456112011.html&id=

Più risposte (0)

Categorie

Scopri di più su Application Deployment in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by