lacie_13
Hi! 

Thank you for this program! I am having a bit of trouble trying to get a test code that lights up an LED after 2 seconds by using an Arduino Uno as my slave device and I am not sure what this error means:

OpenPLC Runtime starting...
Device Arduino Uno1 is disconnected. Attempting to reconnect...
Interactive Server: Listening on port 43628
Connected to MB device Arduino Uno1
Modbus Read Discrete Input Registers failed on MB device Arduino Uno1: Connection timed out
Issued start_modbus() command to start on port: 502
Modbus Server: Listening on port 502
Modbus Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
Modbus Write Coils failed on MB device Arduino Uno1: Connection timed out

Thank you!
Quote 0 0
thiagoralves
Have you uploaded the OpenPLC firmware to your Arduino board?
Quote 0 0
NQuilty
I'm also having this problem. My Runtime Log shows:

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Device Arduino is disconnected. Attempting to reconnect...
Warning: Persistent Storage file not found
Connected to MB device Arduino
Modbus Read Discrete Input Registers failed on MB device Arduino: Connection timed out
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
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 Arduino: Connection timed out
Modbus Read Discrete Input Registers failed on MB device Arduino: Connection timed out
Modbus Write Coils failed on MB device Arduino: Connection timed out

I believe that the firmware has been correctly uploaded to my Arduino Uno. The log from the Arduino IDE shows:


avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM7
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\noah-\AppData\Local\Temp\arduino_build_429304/OpenPLC_Uno.ino.hex"
avrdude: writing flash (6638 bytes):

Writing | ################################################## | 100% 1.14s

avrdude: 6638 bytes of flash written
avrdude: verifying flash memory against C:\Users\noah-\AppData\Local\Temp\arduino_build_429304/OpenPLC_Uno.ino.hex:
avrdude: load data flash data from input file C:\Users\noah-\AppData\Local\Temp\arduino_build_429304/OpenPLC_Uno.ino.hex:
avrdude: input file C:\Users\noah-\AppData\Local\Temp\arduino_build_429304/OpenPLC_Uno.ino.hex contains 6638 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.86s

avrdude: verifying ...
avrdude: 6638 bytes of flash verified

avrdude done. Thank you.

Any help is appreciated
Quote 0 0
thiagoralves
Sporadic one or two error messages during startup are normal. These errors are related to the boot time of the Arduino board. The messages time out when the arduino is booting. After it is booted then the communication continues. If you’re getting constant error messages like this then it is a problem
Quote 0 0
NQuilty
Thanks for info! Should I see anything else from the Runtime Logs after the error message? I still can't get an LED to turn on using the Hello World program.
Quote 0 0
thiagoralves
If the Tx/Rx LEDs are constantly blinking on your Arduino board, then the communication with OpnPLC host is working. If the LED is not turning on as per your program, then probably there is an error on your circuit or on your program
Quote 0 0