Error message
When downloading the trace, the Runtime may generate the error message:
Communication error : NoMemory (#0x000011)
Questions
- How and where is the memory requirement calculated?
- Can the maximum available memory size be configured?
Answers:
The memory size required for the trace in the runtime is calculated when configuring the trace in the CODESYS IDE and then sent to the controller with a service when downloading the trace.
The runtime then allocates the necessary memory dynamically on the heap.
This is done in the TraceMgrRecordAdd function with the following code:
pRecord->ulBufferSize = pPacket->ulBufferEntries * pRecord->ulEntrySize; pRecord->pBuffer = (TraceRecordEntry*)CAL_SysMemAllocData(COMPONENT_NAME, pRecord->ulBufferSize, &Result);
The value for ulBufferentries is communicated to the runtime by the CODESYS IDE in the TAG_TRACE_PACKET_BUFFERENTRIES tag of the online service SRV_TRACE_PACKET_CREATE.
A direct configuration of the size of the memory available for the trace is therefore not possible.
Only the size of the heap can be changed.