Pierre-Philippe HARDY
Hello everyone,
I recently set up an Arduino Mega with OpenPLC Runtime, and overall, it works well. However, I’m experiencing significant latency when monitoring inputs:
  • Some inputs remain displayed as active in the monitoring interface for several seconds, even after the 5V signal has been physically removed from the port.
  • This delay makes real-time detection of state changes difficult, which could be problematic for time-sensitive applications.
Questions:
  1. Root Cause: Is this a known issue related to the monitoring refresh rate, firmware configuration, or hardware limitations of the Arduino Mega?
  2. Possible Optimization: Are there parameters to adjust (in OpenPLC Editor, firmware, or Arduino code) to reduce this latency?

Second Point: Communication Between Two Arduinos I’d like to make two Arduinos interact under OpenPLC Runtime:

  • The first would be configured solely for inputs (all GPIO pins as INPUT).
  • The second would be dedicated to outputs (GPIO pins as OUTPUT). The goal is to simulate a modular system where a "master" Arduino reads inputs and sends states to a "slave" Arduino to control outputs.
Questions:
  1. Feasibility: Is this technically possible with OpenPLC Runtime? If so, what’s the recommended procedure?
  2. Communication Protocol: Should I use a specific protocol (I2C, UART, Ethernet via shields)? Does OpenPLC provide dedicated function blocks for this type of exchange?
  3. Configuration Example: Do you have examples of similar projects or tutorials to share?

Technical Context:
  • Hardware: Arduino Mega 2560 + OpenPLC Runtime (version [please specify if possible]).
  • Environment: OpenPLC Editor on [your OS].
  • Final Goal: Create a reliable modular system for automation applications.

Thanks in advance for your feedback and suggestions! Pierre-Philippe Hardy

Reply 0 0
thiagoralves
Removing 5V from a pin does not make it go to false. What you’re experiencing is probably an issue with your wiring. You need to add pull down resistors to force the pin down when there is no voltage applied.
 
For your Arduino to Arduino communication, there is nothing on OpenPLC that you can use for that. The easiest approach would be to connect both Arduinos to a master (runtime running on a Linux device for example).
Reply 0 0
Pierre-Philippe HARDY
Removing 5V from a pin does not make it go to false. What you’re experiencing is probably an issue with your wiring. You need to add pull down resistors to force the pin down when there is no voltage applied.
 
For your Arduino to Arduino communication, there is nothing on OpenPLC that you can use for that. The easiest approach would be to connect both Arduinos to a master (runtime running on a Linux device for example).
Hello,
Thank you very much for your response—it was very helpful!

Regarding the input latency issue: Your suggestion about . After testing, everything works correctly when configuring all inputs as %IX100.0->IX105.7, except for %IX103.6 and %IX103.7 (pins 20/SDA and 21/SCL). These two inputs remain active unless explicitly forced low with pull-down resistors. I’ve now added the resistors, and the issue is resolved.

Regarding Arduino-to-Arduino communication: I’m already using a to manage my setup. I’m a bit confused by your suggestion to use a Linux device as a master. Could you clarify:

  • Do you mean using a connected to both Arduinos via USB, acting as the central OpenPLC Runtime host?
  • If so, is there a specific procedure or documentation for under OpenPLC Runtime on Linux? For example, how to in the same project?
Any additional guidance or links to relevant resources would be greatly appreciated!

Thanks again for your help.

Best regards,

Pierre-Philippe Hardy

Reply 0 0
thiagoralves
Either way, on Windows or Linux, it will work the same. The runtime on Linux just makes it more portable as you can run it in a Raspberry Pi as you mentioned.

There is no big secret in adding two devices. Just add them in the slave devices tab and that’s it. The addresses show in the table that lists all slave devices. Keep in mind that the programming in this case must go to the Linux/windows runtime, not the Arduinos.
Reply 0 0
Reply