I wonder if the two megaboard signals can be synchronized

I am trying to configure it as shown in the picture below.
First, until OPCDA communication on the slave side is established.
It is in a finished state.

However, I wonder if there is a way to connect it to the Arduino Mega board that controls the machine.

I'm wondering if there are any resources I can refer to if possible.

see picture below

Welcome to the forum.

Can you give us a broader view on your project ? What do you want to achieve ?
Have you heard about the a XY-problem: https://xyproblem.info/
I don't know if this is a XY-problem (I'm pretty sure it is), but hopefully someone knows a simple solution to achieve what you want.

The Arduino Mega has 3 spare hardware Serial (UART) ports. You can use a Serial port to communicate between the boards. So you can read the input pins on one board and copy the state of those pins to output pins of the other board.

Why do you need two Arduino boards ? Can you do it with just one Arduino board ?
What is that machine ? How is it controlled ? Via USB ?
Do you have something working ? Do you already have two Arduino Mega boards ? or is it just an idea ?

The Arduino Mega does not have 53 pins. It has also 16 analog pins which can be used as digital pins. Pin 0 and 1 are used to upload a sketch and for the Serial Monitor. You better not use pin 0 and 1.

Post a rough schematic as to how you propose to connect all of this together. How is synchronized used, to match them exactly, with in some time frame, what is the required timing. Hint you will not get then exactly synchronized as there is delays in communications, code processing, etc.

hello. thanks for the help

Master machine control
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
proceeded in a way.
Use total Mega2560 digital signal 22 to 50

slave
OPC DA communication
Arduino OPC server communication is possible.

hello. Thanks for your answer.

I connected the TX1RX1 part to two Arduino mega boards, and the master packaged the signals of all axes at once and sent them.
Again, there was a problem in distributing the package signal from the slave and distributing it according to each pin number, so I inquired on the forum.

Is there any other good way?

Without an annotated schematic (language of electronics) showing exactly how it is wired I cannot be of much help. Remember you see them in front of you, I cannot. Also posting your code following forum guidelines will help. Also show your interface for the OPCDA interface. I assume you are refering to "the OPC DA specification defines the exchange of data including values, time and quality information. The OPC A&E specification defines the exchange of alarm and event type message information, as well as variable states and state management." per google.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.