FC6 WriteSingleRegisterRequest Error #104
Replies: 7 comments 15 replies
-
Are you sure that your server (where PHP is running) is allowed to connect to that modbus server and port? |
Beta Was this translation helpful? Give feedback.
-
Yes, I have tested receiving data via examples/index.php I can give you the ip and port of my device - please write where to send it. |
Beta Was this translation helpful? Give feedback.
-
Or are receiving and sending information different? I use regular virtual hosting. There were no errors while receiving the information. |
Beta Was this translation helpful? Give feedback.
-
Okey I see. From your modpoll picture I see your are using slaveID/unitID = 1 but in you code you are not setting any - thus it will be 0 try $unitID = 1;
$packet = new WriteSingleRegisterRequest($startAddress, $value, $unitID); |
Beta Was this translation helpful? Give feedback.
-
You probably need to capture network traffic for both Modpoll and PHP packets sent/received. https://github.com/aldas/modbus-tcp-client/wiki/Debugging-guide and see what are the differences. |
Beta Was this translation helpful? Give feedback.
-
I don't know what happened, but it worked |
Beta Was this translation helpful? Give feedback.
-
I disabled the connection via Modbuss Poll and everything worked. I thought the devices support multiple connections at the same time. I will delete messages with my settings. |
Beta Was this translation helpful? Give feedback.
-
Testing the WriteSingleRegisterRequest function. It gives an error when connecting:
Packet to be sent (in hex): 64d200000006000600010037 An exception occurred fread error during receiveFrom #0
Here is my code(I have hidden the IP in setHost. He is static):
When testing via the Modbus Poll program, the value changes without errors.
https://drive.google.com/file/d/1VlH0qBCwPwIqTe2Mni437SOelCWqbX3K/view?usp=drivesdk
Please tell me what could be wrong. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions