nowatkom
I am having challenges getting an Arduino Uno to connect as a slave PLC device. I have done this many times before in previous versions of OpenPLC. Did something change in the past year with how the Arduino connects? I installed the blankproject file onto the Arduino with Slave ID 0, and even used the Mr. Proper transfer method.
 
I'm running the editor on a Windows 11 device, OpenPLC Release: 2024-12-11. I'm running the OpenPLC runtime on a Debian VM. I'm using a browser on my host machine to communicate with the runtime. (I'm re-creating the environment from your online course.) Everything worked fine the last time I used this setup. What am I missing?
 
Thanks!
Michael Nowatkowski
Reply 0 0
thiagoralves
Hi Michael,
 
Can you share your slave device setup and your dashboard logs? Also, make sure the program is being uploaded to the Arduino with Modbus enabled on the Serial port.
Reply 0 0
nowatkom
Device NameDevice TypeDIDOAIAO
unoUno%IX100.0 to %IX100.4%QX100.0 to %QX100.3%IW100 to %IW105%QW100 to %QW102
 
Screenshot 2025-01-22 121626.png
 
 
 
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Device uno is disconnected. Attempting to reconnect...
Persistent Storage is empty
Connected to MB device uno
Modbus Read Discrete Input Registers failed on MB device uno: Connection timed out
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued stop_dnp3() command
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command
Modbus Write Coils failed on MB device uno: Connection timed out
Modbus Read Input Registers failed on MB device uno: Connection timed out
Modbus Write Holding Registers failed on MB device uno: Connection timed out
Modbus Read Discrete Input Registers failed on MB device uno: Connection timed out
Modbus Write Coils failed on MB device uno: Connection timed out
Modbus Read Input Registers failed on MB device uno: Connection timed out
Modbus Write Holding Registers failed on MB device uno: Connection timed out
Modbus Read Discrete Input Registers failed on MB device uno: Connection timed out
Reply 0 0
nowatkom
[203128%2F9164600%2Fmceclip0]
Reply 0 0
nowatkom
[203128%2F9164603%2Fmceclip0]
Reply 0 0
nowatkom
this is the after I try to run the program:
[203128%2F9164607%2Fmceclip0]
Reply 0 0
nowatkom
I even swapped out the USB cable and Uno to see if there were hardware problems.
Reply 0 0
thiagoralves
It seems that the Uno was not programmed with the blank program for some reason. Did you check the console output if there were any compilation or upload errors? Maybe you can try using another Modbus tool like Radzio Modbus to check if the Uno is indeed responding to Modbus requests.
Reply 0 0
nowatkom
[203128%2F9164892%2Fmceclip0]
Reply 0 0
thiagoralves
Just did the steps with the latest version of the runtime and editor (both for Windows), using the blank project from the Autonomy documentation. Everything worked just fine. I got one or two timeout messages, but those are normal for the Uno, as it resets itself every time a new USB connection is made. After one second the timeout messages stopped and the Rx/Tx LED lights started blinking showing communication with the runtime
Untitled.png
 
I tested with Radzio as well and was able to read Modbus packets normally as well:
Screenshot 2025-01-22 at 4.17.36 PM.png
Reply 0 0
nowatkom
ok, thanks for checking! I'll maybe try it on a different computer, or re-install all the packages.
Reply 0 0
nowatkom
I re-installed VirtualBox and the extensions and it is working. Sorry for the trouble!
Reply 1 0
Reply