Closed quocthanh18tn closed 5 years ago
could it be that you are writing to "read only" register? Have you checked your PLC manual? I know from experience from Wago PLCs that only certain address ranges are writable.
you could paste code here and maybe tell which firm/model PLC you are dealing with?
My code's file fc16.php. PLC i have used CPU 1214c AC/DC/RLY. This is my server config. PLC's IP :192.168.0.2
And data is just array [0..100] word
Connect
And this is my code to write multi holding register
When i connect to PLC and run fc16.php this is my error
But when i modify fc16.php like image below and other not modify
and this is my error :
I am final student, i dont know if my question idiot, if you have free times, can give me solution to fix it. I try to find any solution in any forum about PLC, but i cant fix it.
Sincerely thanks a lots !!
It could be that for Function 16 it is that address '0' is not allowed.
some ideas for investigation:
so most valuable information would be to test modbus with some other client with same ports, addresses and data that is sent. At first just try reading values from modbus and then if this work try writing data. Also try to capture data packet that is sent with Wireshark and compare it with modbus packet that php lib sents
was that siemens plc addressing document helpful to you?
I'm sorry for reply to you too late. I'm have a problem with some test in my college. Your code is very good, my mistake's configuration address holding register wrong number. So now, it run very well. Thank you so much. So if you have any problem that i can help you, please feel free to send me your question. :3
Hi, I admire your post. I have some problem, i try find in other forum but i can't find answer. My problem is: when i simulate with Mod_RsSim, it's ok, but when i connect and write multi holding register, it's appear error ""An exception occurred Illegal data value "". Can you give me some solution, i try a lots but i can't fix it. If you have any solution, please give me through email : 1513009@hcmut.edu.vn. Thank you so much.