Skip to content

MODBUS COMMUNICATION

edited July 2023 in PLCnext Engineer

Hello!

I'm trying to create a communication between 2 PLCNext and a HMI by using the MODBUS library, but I have some questions:

1- If I want to share 1 input variable from PLC 1 to the HMI and PLC 2, I think I may use the FB MB_TCP_Server in PLC 1, in strBindIP create a variable with the IP of the HMI [IP_PANTALLA as a initiallited string] (and another FB with the IP of the other PLC 2), but I don't know what else I have to do. I've read the manual but I have no clue how to continue.

arrCoils, arrInputs, arrInputRegisters and arrHoldingRegisters are only variables I've created


2- In my HMI, I have to make a reference of the variables I want to read from the PLC, but I don't know how to map the address of the variables. As an example, I have an output called Q1 that I want to be able to activate from the HMI, but the button from the HMI needs an addres (something like %MW1.0), but I don't know how to know those addresses from the PLCNext.


If anyone could help me I would be so thankful.


Kind regards,


Pablo Casas

This discussion has been closed.