cody.moser
Hello i have a few questions about getting ScabaBR to interface with OpenPLC. I have a Raspberry Pi with an Arduino Uno slave device for remote I/O. I have ScadaBR downloaded and i am trying to add some new data points. Keeps saying there was a problem testing the locator.

Am i going to have to switch from modbus port 502 on Arduino? If so what do i switch it to.
What do i put for host, the IP address to get onto ScadaBR? (172.16.1.91)
By typing sudo ifconfig on the Raspberry Pi i found the IP address to be 172.16.1.88. So is the slave device just 88?
Thanks for the help.
Quote 0 0
Baxter666666
Hi,

I am experiencing the same type of problem. After I have my ScadaBR linked to my Rpi through virtual box using the IP address 192.168.56.101:8080/ScadaBR. I added the data source of "Modbus IP", selected "TCP with keep alive and selected my host as the above IP address on Port 502. When I click on the "Read Data" button the following message is returned "There was a problem testing the locator. There may be an enabled data source already using the selected port. (java.net.ConnectException: Connection refused)".

I am assuming that the configuration isn't correct and that's why it isn't receiving any data.

"07:13:08: 'Vitual Box': com.serotonin.modbus4j.exception.ModbusInitException: java.net.ConnectException: Connection refused" This message was also supplied when I tried to enable the source.
 
Thanks. 
Quote 0 0
thiagoralves
You guys are mixing things up. Modbus is one thing, IP address and TCP/IP network is something else. Think about IP as your house address. For me to get to your house, I need to know your full address. ScadaBR communicates with OpenPLC to query its data, therefore ScadaBR needs to know OpenPLC's IP address, otherwise it won't ever get there. When you're creating a new Modbus IP data source, you need to provide the Raspberry Pi's IP address (if OpenPLC is running on your Pi), not ScadaBR IP address.

The communication between Arduino and Raspberry Pi is a completely different thing and has nothing to do with ScadaBR. Leave that configuration alone. Since the Arduino is a slave device to OpenPLC running on the Pi, ScadaBR should query the Raspberry Pi about Arduino's data. ScadaBR should not talk directly to the Arduino.
Quote 0 0
cody.moser
Thanks for clearing things up. ScadaBR is now working good and pulling registers from OpenPLC. 
Quote 0 0
Baxter666666
Thanks for the reply Thiago,

Using the Rpi command line I found my Pi's IP Address as 169.254.39.135. I used this address as my Host value on ScadaBR however it is returning "Network is unreachable". This is the same IP address I use for the OpenPLC runtime so i know that the Raspberry Pi is connected correctly. Any help will be grateful. 

Thanks.
Quote 0 0
thiagoralves
Any IP that starts with 169 is an invalid IP. Your Pi is not correctly connected to the network. Look for tutorials on the Raspberry Pi website for how to do it properly.
Quote 0 0
cody.moser
Type sudo ifconfig into the terminal on the RPi. In the third section is your RPi IP Address. Use that as your host and use the last digits on the IP as the slave device when setting data points. Make sure your computer with virtual box and ScadaBR and your RPi are both connected to the same network.
Quote 0 0
Baxter666666
Hi, 

I have researched this and it means that my Rpi cannot reach the router/DHCP server from a ethernet connection to my laptop which is connected to a school wifi source. I can correctly connect all components of OpenPLC from my home wifi, but I want to be able to continue my work from my school network.

Thanks.
Quote 0 0
thiagoralves
You will have to talk to the network administrator of your work/school. It is very common to have policies blocking unknown devices to connect to the wired network for security reasons. If you can't get around that, one alternative would be to just get a usb->ethernet adapter for your laptop, then share the wired internet connection through the usb->ethernet adapter (you can google for tutorials on how to do that, which is pretty easy on Windows 10), and then connect your Pi directly to your laptop through the usb->ethernet adapter.
Quote 0 0
Baxter666666
I got around the problem by purchasing a small router, which will make life much more easier. I have successfully been able to linked my ScadaBR to my host network and I'm not receiving any error messages. I'm looking for an example to follow as I do not understand adding the "Points Details".

I understand that my LED is connected to %QW0.0 which is an Analogue Output which is a Holding Register on ScadaBR, I assume the modbus address will be 0 but where do I assign a point to know when the LED is being called from my PLC?

Thanks.
Quote 0 0
thiagoralves
If you connected the LED to the analog output, your Modbus data type should be “unsigned integer”, not “binary”. Binary is just for items that are either true or false (coils and contacts). With the analog output you can control the brightness of the LED, therefore the quantity is a number, not just true or false.

I imagine that your PLC program is controlling the LED brightness with some logic. After adding the point to ScadaBR you can monitor the LED brightness creating graphical views. Just click on the graphical views on the top menu, create a new view, and add an analog element to the screen. After that, select an image set for your element and then associate the element with the LED point you just created
Quote 0 0
Baxter666666
Thanks Thiago,

Got my R-Pi points operating correctly now. I have sensor connected to an Arduino Board as a Slave Device. I am just wondering will I be able to obtain this input value on ScadaBR as well. The location of it in my PLC is %IW100. From the Monitoring Section on the Runtime page it gives me a Value of -6464, which meets the threshold for the LED to operate. The -6464 represents a temperature value.

Thanks
Quote 0 0
thiagoralves
I assume that my Modbus Bus Data Type will be Binary as the contacts will either be True or False.

If you’re using contacts then you can’t use an analog output such as %QW0. As I explained earlier, analog outputs have quantity by definition, and aren’t just true or false. For contacts and coils (binary on/off controls) you must use a digital output like %QX0.0. On ScadaBR, %QX0.0 is mapped as Modbus coil address (offset) 0. For the input, since it is also binary, you must use something like %IX0.2 which is mapped on ScadaBR as Modbus Input Status address (offset) 2.

For more information on Modbus mapping, check http://www.openplcproject.com/scada
Quote 0 0
Baxter666666
Thanks Thiago,

I sorted my outputs as i had mixed up the Digital and Analogue Outputs, then I updated my post (must of been when you where typing up your response 🙂 ). 

"Got my R-Pi points operating correctly now. I have sensor connected to an Arduino Board as a Slave Device. I am just wondering will I be able to obtain this input value on ScadaBR as well. The location of it in my PLC is %IW100. From the Monitoring Section on the Runtime page it gives me a Value of -6464, which meets the threshold for the LED to operate. The -6464 represents a temperature value."

Help on the following would be great.

Thanks.
Quote 0 0
thiagoralves
%IW100 = Modbus Input Register address (offset) 100
Quote 0 0