AlexNVZ
I use OpenPLC on Debian. Trying to send data from PSM. Addresses before 49 are sent, after 49 no. Where is the mistake?
 
psm.set_var("IW48", 15)
psm.set_var("IW49", 15)
psm.set_var("IW50", 15)
psm.set_var("IW51", 15)
 
изображение_2024-01-11_215514130.png
Reply 0 0
AlexNVZ
How to remove restrictions on the use of address space?
Reply 0 0
thiagoralves
 
If you check the code files above you will see that the analog buffer size is limited to 50. You will have to edit both files to increase that limit.
Reply 0 0
AlexNVZ
Thanks for the reply, do I need to reinstall OpenPLC after the changes?
 
PSM1.jpg
 
PSM2.jpg
Reply 0 0
thiagoralves
No, you just need to reapply the PSM hardware layer to force a recompilation of the driver
Reply 0 0
AlexNVZ
Changed the buffer values, reloaded the program, but it doesn't work...PSM3.jpg
Reply 0 0
AlexNVZ
Уточните, пожалуйста, что нужно изменить.
 
 
PSM4.jpg
Reply 0 0
AlexNVZ
Maybe I'm doing something wrong, please clarify how to do "need to reapply the PSM hardware layer".
Reply 0 0
AlexNVZ
There's a big project planned. Controllers based on NanoPI with Debian are created for it. OpenPLC is installed. The controller will control three supply systems. The power of the controller is enough. This is where I start to get bogged down by the limit on the number of registers that can be transferred. For ModBus the limit is 120 pcs. Also in PSM I can neither transmit nor receive more than 49 registers, even after changes in psm.cpp and psm.py. Please help me to expand the number of exchange registers to 250 or more. Also I will be able to test OpenPLC work under heavy load. Unfortunately English is not my native language, there may be errors or inaccurate translation in the text.
 
DS-100_3.jpg
Reply 0 0
thiagoralves
I didn’t get a chance to check your code properly, but it looks to me that you didn’t understand how the code works. Increasing the buffer size does nothing if you don’t send the extra added locations to the other side. Modbus can only send 25 items at a time due to the frame size of the message. That’s why there are two send messages to send a total of 50 points. If you add more points in the buffer you must add more send/receive code to encompass the whole buffer.
Reply 0 0
AlexNVZ
Thanks for the reply. If you can tell me where and what to change it to with a precise indication in the code, so as not to break the logic of operation, I can check it out.
Reply 0 0
thiagoralves
If I were to point you exactly what to change and where to change then I would’ve done it myself. It would’ve been faster. Unfortunately I don’t have time to work on this right now. Get hold of someone that knows how to program in C to help you out. You only need to change those two files I mentioned. The change is fairly simple for someone that knows C. 
Reply 0 0
Reply