Hello,
I have a problem with Portenta machine control when using with arduino PLC IDE.
I will present the basic configuration in which the problem already manifests itself:
Basically, you just need to create a new project in the Arduino PLC IDE.
In "Resources/Ethernet" the preset is already permanently selected
"Modbus TCP Slave alwais enabled. Unit identifier 255 ", cannot be changed and is the required option in my case.
Then in "Resources/Local IO Mapping/Temperature probes" "RTD Tree Wires" is set
It can also be seen in the "Descrtiption" for individual thermometers to which Modbus TCP registers the thermometers are mapped.
So, for example, it is an Input Register with a starting address of 7, so the query for the TP00 thermometer must be compiled so that it reads register 7 and 8.
Querying the RTD temperature via Modbus TCP works correctly via the "Modbus Pool" software, essentially for an unlimited time without errors, but the problem occurs in the real Portenta Machine Controll application, which is installed in the switchboard and queries to the PMC via Modbus TCP are performed by the RUT906 from Teltonika in which the MQTT Modbus gateway is running.
So far, everything is tested and functional, the MQTT gateway in the RUT906 correctly reads the temperatures from the RTD on the Machine Control, but only until a certain moment, before the response from the Portenta Machine Control starts to return only "Connection Refused" and that's it.
Restarting Portenta Machine Control (PMC) will help, often the PMC freezes so much that it is not even possible to connect to it from the PLC IDE, or the entire PLC IDE crashes when trying to connect.
Actually, I expected for the considerable funds spent on the purchase of 2 pieces of PMC and the corresponding licenses for the PLC IDE, at least a basically debugged FW and IDE, but let's leave that aside, because I need to solve this problem somehow constructively.
The project in which PMC is used is already at a stage where there is no time to switch to, for example, the Arduino IDE, where these problems do not occur as I had the opportunity to test.
Back to the problem:
By investigating the communication in more detail, I found that the main difference between reliable polling via "Modbus Pool" and polling from RUT906, which leads to PMC freezes, is that "Modbus Pool" starts communication and keeps it open (the TCP client is connected during the entire polling )
On the other hand, the RUT906 opens communication with each query and closes it after receiving a response or the Timeout expires, i.e. the TCP client connects/disconnects with each Modbus query, I am forwarding that this setting cannot be influenced on the RUT906 and it is fine for me, but the problem is in the PMC, which after some time apparently cannot handle the frequent opening/closing of the Modbus TCP connection and then crashes.
It looks like some bug in the internal library that PMC uses for Modbus TCP Salve, but I don't know where this library is located or if it is accessible for editing.
I noticed that it doesn't matter how long the RUT906 polls the PMC, but rather the number of polls, the faster it polls, the sooner the Crash comes.
That there would be a memory overflow or something like that?
Any help is appreciated, or direct me where to go with this problem.
If necessary, I can provide additional information, or attach screens with configuration and error status.