juddmorse
Hello.

I'm pretty new to both OpenPLC and Factory I/O. I'm attempting to control a simple process on Factory I/O through OpenPLC. I believe I have everything configured correctly, however when I start the PLC from the Dashboard, I can't seem to keep a connection up. Here's a quick snip of my logs:

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Device FactoryIO is disconnected. Attempting to reconnect...
Warning: Persistent Storage file not found
Connection failed on MB device FactoryIO: Operation now in progress
Modbus Read Discrete Input Registers failed on MB device FactoryIO: Bad file descriptor
Modbus Write Coils failed on MB device FactoryIO: Bad file descriptor
Device FactoryIO is disconnected. Attempting to reconnect...
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Connection failed on MB device FactoryIO: Operation now in progress
Device FactoryIO is disconnected. Attempting to reconnect...
Connection failed on MB device FactoryIO: Operation now in progress
Device FactoryIO is disconnected. Attempting to reconnect...
Connection failed on MB device FactoryIO: Operation now in progress
Device FactoryIO is disconnected. Attempting to reconnect...
Connection failed on MB device FactoryIO: Operation now in progress
Device FactoryIO is disconnected. Attempting to reconnect...

The disconnect/reconnect keeps up for as long as I keep the program running.

Per the directions elsewhere in the forums, I've configured everything as so:

Slave Device:
Slave_Device_Config.png  Factory I/O configs:
FIO_Slave_Config.png 
Factory I/O PLC config:
FIO_PLC_Config.png 
Here's a picture of my logic from the Editor, as well. It's very simple, based on the 'Hello, World' logic walkthrough on the site. A start and stop button controls the motor on conveyor 1, and a start and stop sensor controls the motor on conveyor 2. It seems to work within Editor, and I've had success making the same logic work on an Arduino Uno.

OpenPLC_LD.png 
And in the interest of being thorough, here's a pic of my Factory I/O build as of now. A box with two buttons, two sensors, and two conveyors w/ motors.

FIO_Layout.png 
I'm very stumped why I'm having trouble connecting. I've triple-checked the IP address, the slave ID, and the port. I feel like the connection issue is network-related, but if so I can't figure out where to adjust.

Any help that could be provided would be greatly appreciated.

Thanks!
Reply 0 0
thiagoralves
If both OpenPLC runtime and Factory IO are running on the same machine, try changing the network adapter on Factory IO settings to loopback, and the slave IP on OpenPLC to 127.0.0.1. This will make the connection internal only and avoid issues with Windows Firewall that can get in the middle.
Reply 1 0
juddmorse
Unfortunately they're on different physical machines (OpenPLC is on my Pi, and Factory IO is on my Win 10 host). I know the Pi firewall is down by default, and I just confirmed that it's still down. I think you're on the right track though, with firewall. I'll experiment with my host's fw settings and see if I can make a connection. I'll update with results. Worst case, I can always load OpenPLC runtime onto the host and attempt the method you describe above.

Thank you for your help!
Reply 0 0
juddmorse
Success! The local firewall on my host machine was the issue. I've got it temporarily disabled, connection is working perfectly. My logic's not behaving how I expected though, but that's fine. Now that it's at least pushing through I can troubleshoot it.

Thanks again. As someone who's using your platform to train for a position within the ICS field, the ease of access of your software and your willingness to help users is invaluable. I really appreciate it.
Reply 1 0
Buyandelger
If both OpenPLC runtime and Factory IO are running on the same machine, try changing the network adapter on Factory IO settings to loopback, and the slave IP on OpenPLC to 127.0.0.1. This will make the connection internal only and avoid issues with Windows Firewall that can get in the middle.
Good day! The main disadvantage of using 127.0.0.1 is the monitoring function of OpenPLC runtime not working at all. Check it if it is correct or not. Let me know if so!
Screenshot 2024-10-14 141147.png
Reply 0 0
thiagoralves
This shouldn't affect the Monitoring feature in any way. They are different things. Factory IO is a slave and OpenPLC acts as a master. For monitoring, the webserver is the master and OpenPLC acts as the slave providing the data.
Reply 0 0
fg71
I have used Siemens LOGO with FactoryIO and the setup I used was s7 Communication. I do remember that PLC hardware was server and FacoryIO was the client. It looks to me you have set FactoryIO as server and I do not think that will work. The client send events to the server (do the logic) and respond.
Reply 0 0
thiagoralves
Having Factory IO as the server (Modbus slave) is the easiest way to do it on OpenPLC. Then you can add Factory IO to OpenPLC as a regular slave device and control all the I/O pins directly from memory mapped locations as if they were local I/O.
Reply 0 0
fg71
memory mapped locations as if they were local I/O.
That is exactly how s7 communication works. The inputs use Network block in LOGO. It means before anything could happen in FactoryIO a person need to press a start button on the operate panel (FactoryIO) to start. Thats why LOGO hardware is the server. On other hand in LOGOSoft Comfort you could mapping the registers to local<->remote. If you use Modbus instead of s7 communication.
 
Reply 0 0
Reply