Weintek Codesys to Codesys Communication

Weintek Codesys to Codesys Communication
none 0.0 0

I have two weintek HMIs and would like their Codesys run-times to communicate over the network. Communicating through the HMI doesn’t work because I need to reference tags between HMIs inside Codesys programs. What are the supported methods of doing this?

Hi @itsmomito,

Could you please provide some additional details about your project?

  • How many tags will you need to access between HMIs?
  • Will each tag need to read and write to each other?

May need to access upwards of 100 tags with read and write access.

For context, I’d like to see if it is feasible to use one weintek hmi as a controller for a subsystem and have it act as a child to a parent system (also controlled via a weintek hmi).

Hi @itsmomito,

Thank you for addressing Cody’s questions. In general, it is not possible for our built-in Codesys to access tags within another Codesys PLC. There are some methods to achieve something similar but we will need to know more information about your project before we can suggest other solutions:

  • Will the child ever read or write to the parent?
  • Is each tag an individual variable or have you used arrays types for efficency?

Thank you for following up on this.

The child will at least need to read from the parent, but preferably also write.

Currently using a combination of structs, individual variables, and arrays.

Happy to use whichever method helps most to facilitate codesys ↔ codesys communication

Thanks for the insight, is there any other method which might be faster or more efficient for communicating many IO points?

Hi @itsmomito,

My colleague reminded me of another method that may be more efficient. This method involves setting up one Codesys PLC as a Modbus server, while the other acts as a Modbus client. When you have time, please download and review the “CODESYS Modbus Server Demo” within the demo projects section of our forum: Link

After setting up the parent PLC as a Modbus server, you can use the “Modbus_TCP_Slave” device within your child PLC’s application to read the remote PLC:

The process of adding the “Modbus_TCP_Slave” device is explained within this post: Link