Join us today!
Reading Router Memory Information in TwinCAT
If you need to check how much router memory is being used for ADS communication in your application, you can use FB_GetRouterStatusInfo function block. You would need to add Tc2_Utilities library to be able to use this FB. The TwinCAT memory is divided into two categories; the router memory and the PLC memory. More information on Memory Usage in TwinCAT can be found here : Memory Usage
//========================================================= VAR fbGetPLCStatus : FB_GetRouterStatusInfo; bGetPLCStatus: BOOL; END_VAR //========================================================= fbGetPLCStatus( sNetId:= '' , //Network address of the IPC, leave it empty ('') for local network bExecute:= bGetPLCStatus, tTimeout:= T#5S, bBusy=> , bError=> , nErrID=> , info=> ); //TwinCAT router status information //=========================================================
fbGetPLCStatus.info - ST_TcRouterStatusInfo
You can also use Beckhoff Device Manager to view the memory usage information.
If you would like to increase the router memory size which is set to 32 MB as default, you can change that in the real time settings. The limit depends on the RAM size of your IPC.
If you are using the DOM memory in TwinCAT very often (for example; using FB_XmlDomParser.LoadDocumentFromFile() ), you might want to implement 'monitor the memory usage' logic in your application using the method mentioned above.
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
- 17 Forums
- 267 Topics
- 942 Posts
- 1 Online
- 722 Members