CR
I am trying to get an runtime operating on a Controllino Mega that has been successfully debugged on the simulator.  Initially it exceeded available dynamic memory by up to 30% and I slimmed it down by ditching timers, rewriting the PID block and multiplying all the real numbers by a hundred and performing most of the logic on INT or UINTs instead of REALs. I slimmed it down to 95% of dynamic memory use. The compiled sketch never used more than 25% of program memory.   When the runtime is uploaded to the Controllino, several things happen . Firstly, the wrong light comes on on the diagnostic panel (%QX1.0 instead of %QX1.3 which is set to 1 at download). Then in short order the Modbus TCP connection becomes unstable and it ceases working within a minute of download. I can initiate a "Debug Remote PLC" session if I do it within 15 seconds of downloading the code but it doesn't work beyond a minute of download time.   In order to test the configuration, I took the tutorial "Blink", copied the communication parameters and the custom I/O map and made %QX1.3 blink. It downloads and works perfectly. The "Debug Remote PLC" session starts normally and runs without incident on the specified IP / port on a 20 millisecond clock. My larger program is set to 1 second scan time because it is controlling a very slow process. I'm out of ideas.  I'm running the latest Aug 2025 version of the OpenPLC 3 editor.  
Reply 0 0
CR
oh and I forgot to mention, I attempted "Transfer to PLC" with the "Upgrade Core" option and got the following error:
 
[2025-08-22T08:23:47.430] Error with CONTROLLINO_Boards:avr: 'NoneType' object is not iterable
[2025-08-22T08:23:47.430] Build phase <function build.<locals>.handle_board_installation at 0x0000022E414DCDC0> failed
 
The default "Transfer to PLC" option works.
Reply 0 0
thiagoralves
Controllino Mega is based on the ATMega 2560 chip which has 8KB of RAM. That's 8 Kilobytes, not Megabytes! It cannot run a large project like yours with that little RAM. You need a bigger controller. My recommendation is the P1AM line from Automation Direct.
Reply 0 0
CR
Noted and I will follow your recommendation I can't sort this out by the end of the day.  Thanks again for the quick response.
 
I am aware of what 8k represents and I've studied the variable table from several of my builds and done the math on the number of bits, 16 bit and 32 bit variables.   Obviously, I have no idea how those variables are saved to the volatile memory but I have noted that at no time did the all the variables listed in the build's VARIABLE.CSV file exceed 2 kilobytes, including the temporary ones created for all the instances of the the function blocks. This being said, I also noted that the OpenPLC Blink tutorial program uses 20% of the Controllino's volatile memory for one bit, 2 timers and all the other stuff that has to be stored in volatile memory.  
 
My project uses all 16 of the analog inputs, 12 of the 20 digital outputs, 2 of the five digital inputs and none of the relays.  The ladder logic for the whole project (across 6 programs and 2 function blocks) is less than 100 rungs.  Modbus TCP is used to write 36 bits, 33 memory registers (some written to %QWx and some to %MWx) and and one double register (%MD0).   This is the build record memory allocation:
  [2025-08-22T08:24:39.964] Sketch uses 59504 bytes (23%) of program storage space. Maximum is 253952 bytes.
  [2025-08-22T08:24:39.995] Global variables use 7831 bytes (95%) of dynamic memory, leaving 361 bytes for local variables. Maximum is 8192 bytes.
Reply 0 0
thiagoralves
Variables are not the only thing going into the controller's memory. You need to take into account that there is a full IEC 61131-3 going on there, with support for Modbus TCP, Modbus RTU, Live debugging, 5 different programming languages, function block instances, and some more. It is in fact a great engineering feat to make it all fit into 8KB of RAM along with a user project! 🙂
Reply 0 0
CR
I just checked out the P1AM modules in the OPEN PLC editor and it appears the P1-O8AD is not supported.  That would be my key module.
 
I have a raspberry pi 5 running FUXA in my control box.  The easiest and cheapest (though not the most reliable) fix would be to put the OPENPLC runtime in a container on the Pi and use the controllino as an Modbus TCP I/O module.    Not elegant but functional. Is there any reason that wouldn't work?
Reply 0 0
thiagoralves
Let me check with them the effort to implement this block. It might be half baked already
Reply 0 0
thiagoralves
They've added support for P1-08ADx modules, so you should be good to go 🙂
 
Reply 0 0
Reply