The following figure shows the CODESYS device tree overview of the example. In this case, the application should read the holdig registers of the Modbus slaves 0-9 and copy them to the holding registers 10-19. In addition to the RevPi Connect, we need one slave each for Modbus and Modbus RTU for this example. Great, that you already pasted helpful examples, Kevin.In this example, we want to run a Modbus TCP master and a Modbus RTU master on the RevPi Connect+ CODESYS with CODESYS Control for Raspberry Pi MC SL. I'm thinking about migrating to it when the classic setup works. I'm very confident that the new converter will work now in the scenario of post #1.Īnyway I'm now very interested in the possibilities of PSM. The same command with my other RS485 converter always ends with connection timeout (only with less than ~10-12 registers it works with mbpoll). Under certain conditions type 'mbpoll -w' for details.Ĭommunication.: /dev/ttyUSB0, 2400-8N1ĭata type.: 16-bit register, input register table
This is free software, and you are welcome to redistribute it This program comes with ABSOLUTELY NO WARRANTY.
Mbpoll 1.0-0 - FieldTalk(tm) Modbus(R) Master Simulator For example 24 registers read from the SDM120M: Tested it with a commandline tool on a laptop. With another converter of another manufacturer I can read multiple registers without problems. The limiting factor is my USB-to-RS485 converter of this type: Having no Python skills, it will be probably not a solution for me, but for programmers it could be a mega progress. I have to read more now, what is the idea behind PSM.
But to select it, I have to deselect the Raspberry Pi Hardware support. I see this new option in the Hardware menue. On the other hand, it is not possible to read the parameter-registers selectively with OpenPLC, but a solution could be your new OpenPLC Python SubModule (PSM). I guess this fits to your idea, that the SDM120M could have a problem with the "modbus read multiple registers command". To exclude further influence I stopped the node-red server, that normally polls my OpenPLC variables. On this tabula rasa I configured just one single modbus-RTU device, the SDM120M. Hopefully I can recover everything if needed. Lost all my settings, but I'm having a backup of the old folder.
Today I removed my OpenPLC_v3 folder and did a fresh install (git clone. Is this limiting at 2400 baud and can cause connection timeouts? How often are the input registers of the energy counter read then? Each 50 ms or 250 ms? The task cycle is T#250ms for the temperatures and T#50ms for the GPIOs. The program running on the OpenPLC at the same time is fetching temperatures from two ESP8266 slaves per Modbus-TCP and some GPIOs on the RPi4. The cable-length is 2 m, 2 wires, shielded (but not connected to a common ground).
The SDM120M has 2400 baud (8N1) per default. I don't understand at the moment, what limits the size of usable registers to just around 12. To reach all parameters of the SDM120M I would need a size of more than 300 input registers in OpenPLC! For example, these are the addresses of the (16-bit) input registers: That is a problem, because the higher registers are unreachable then. Modbus Read Input Registers failed on MB device SDM120M: Connection timed out Great!īut to my surprise I start to get connection timeouts to my modbus slave once I configure more than a size of around 12 Input registers in the Edit slave device window. I can read two Input Registers with node-red at the moment (voltage and current), so OpenPLC works generally.
A Raspberry Pi4 with OpenPLC is connected with an SDM120M energy counter over an USB-to-RS485 adapter. I'm doing my first steps with Modbus-RTU.