chrisliu

My running environment is Ubuntu virtual machine.

The error is as shown in the screenshot. 

I'm not sure if there is a problem with the Mudbus address or variable configuration,  I don't know how to configure it.

f9b3e58cc4b782ca0c1199fed5edf6f.jpg

8e98de86c6e4d661fb3dfe2d767278d.png
Reply 0 0
chrisliu

I'm not running any other services on port 502, just Modbus server.
In ScadaBR point locator test, how do I set the Offset and Bit.  I guess there might be a mistake here.
I wonder if I have expressed my question clearly. I'd appreciate it if someone could help me.

Reply 0 0
chrisliu
f516a4249605befcac481be535fdd81.png
1a3db89690a54827dc97b25eb1b99b5.png

Upon rebooting, I found that the log show Modbus Server has closed the connection or did not show the Mudbus Server information. Does this indicate that the Mudbus Server is not working properly ?
Reply 0 0
chrisliu
Record
Runtime seems to have a problem, I tried changing the port or turning off the firewall, but it didn't work.
1536f63cd0fa07bf79fd688ae8a0c75.png
Reply 0 0
thiagoralves
The logs does not show any issue with the Modbus server. The connection was closed by the client, not the Modbus server, so it seems that something is going on with the ScadaBR part. It seems that ScadaBR is constantly creating new connections and killing them. This is normal if ScadaBR is not configured to do continuous reading (keep alive). It will create and destroy connections on every message. As for the 'Server: Error accepting client!' message, it happens when you change any configuration on the Modbus server while it is running. If you do that, the Modbus server is killed and restarted, hence why you see the error.
Reply 0 0
chrisliu
Thanks for your answer, thiagoraves.
I think you are right. There is no mistake in openplc runtime. ScadaBR is configured to tcp with keep-alive, but it still shows errors:
There was a problem testing the locator. There may be an enabled data source already using the selected port. (java.net.ConnectException: Connection refused)
7e4696146048a91b55e8b76c5e9bd1f.jpg

I have checked port 502, it did not run other programs. I tried to close the firewall or change the port number. The error message is still like this.
Reply 0 0
thiagoralves
You don't have to check port 502 on ScadaBR, as it is the client, not the server. That port number is the port number from OpenPLC where ScadaBR must connect to. This error probably means that either you have a bad ScadaBR installation (maybe some libs are missing) or you have another datapoint configured with the same address and port.
Reply 0 0
thiagoralves
Actually... reading the error again it is saying "Connection refused". This means that ScadaBR can't reach the device or that the port 502 on the OpenPLC device is not open. Make sure your networking is set up correctly and that you can ping your OpenPLC device from the ScadaBR machine.
Reply 0 0
chrisliu

I  set only one datapoint.  OpenPLC and ScadaBR both can ping from each other. 

I use docker in Ubuntu virtual machine to run OpenPLC and ScadaBR. The network is set in bridge mode. 

When I changed the ScadaBR port to 8080 (the OpenPLC port in docker),  error shows: No response from slave 1.   When I set the port to 502/503/504/505, The error message is still like "There was a problem testing the locator. There may be an enabled data source already using the selected port. (java.net.ConnectException: Connection refused)".
33aaa7fb8935f8ffaa075f5d82f8c5d.jpg

Reply 0 0
thiagoralves
Docker networking sometimes can be hard to work with. I’m 99% positive your issue is on networking, not on ScadaBR or OpenPLC. Keep in mind that ports below 1024 requires root, and this could be some of the issues you’re having.
Reply 0 0
chrisliu
Thank you so much thiagoraves. I found the reason. It's the port mapping problem. When running Docker container of OpenPLC,  set the mapping of port 502, then the ScadaBR can connect to OpenPLC .
Reply 0 0
Reply