carlospetry77
Hello. I'm trying to connect with arduino UNO. I followed the step on getting started page. But, in Dashboard i see Connection timeout. I tried a lot of configurations. Arduino attached via raspberry usb and UART port (Tx and Rx pins). 

The same problem with Modbus RTU generic. 

Modbus Read Discrete Input Registers failed on MB device arduino: Connection timed out
Modbus Write Coils failed on MB device arduino: Connection timed out
Modbus Read Input Registers failed on MB device arduino: Connection timed out
Modbus Write Holding Registers 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
Modbus Read Input Registers failed on MB device arduino: Connection timed out
Modbus Write Holding Registers 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
Can someone help me?
Thanks!
Quote 0 0
carlospetry77
I guess my problem it’s with wiringpi library. I’ve a raspberry pi 4. I can use onboard pins to inputs and outputs, but i have problems to use serial port. I need to disable anything? wiringpi library? Thanks!
Quote 0 0
thiagoralves
You can’t use the UART pins and OpenPLC Raspberry Pi driver at the same time, since OpenPLC will try to control the UART pins as regular I/O. You have to either disable the Raspberry Pi driver (use Blank for example) or connect the Arduino through the USB port
Quote 1 0
carlospetry77
You can’t use the UART pins and OpenPLC Raspberry Pi driver at the same time, since OpenPLC will try to control the UART pins as regular I/O. You have to either disable the Raspberry Pi driver (use Blank for example) or connect the Arduino through the USB port


Hello Thiago. I do it!!!  I've modified hardware layer (raspberrypi.cpp) to liberate UART PINs. 

Next, i disable bluetooth and asign ttyAMA0 to serial 0.

With this, i have 8 inputs and 8 outputs on Raspberry GPIOs. For the other hand, via modbus RTU, i made an slave (with an Arduino to probe),
and through modbus I have extended the outputs writing in Coils.

Also, one output is reserved to indicate PLC RUN. With this, when PLC stops, all slaves can deactivate your outputs.

To comunicate Raspberry to Arduino (slave Modbus RTU device) i used to MAX485.

I plan to create slave input and output devices, both digital and analog, to extend those of the CPU. With this you have the options of having a base PLC with 8 digital inputs and 8 digital outputs, and if you need more, you can add slave modules.

please tell me if this is interesting, to put together a tutorial on how to do it.

Bye!!
Quote 0 0
thiagoralves
This is definitely very interesting. You should write a tutorial
Quote 1 0
carlospetry77
This is definitely very interesting. You should write a tutorial

only i hace a question. When i change hardware layer, i need to load other harware layer, for example blank  save changes and next reload raspberrypi layer. It is normal?
Quote 0 0
thiagoralves
You can just reload the same hardware layer, no need to load blank in between. Just click on save changes and then your modifications to the hardware layer will be loaded
Quote 0 0