Question: how does hmi communicate with plc?
Answer: When you develop the HMI program, in each screen you create graphic interfaces that reflect and send commands to the PLC program through the configured protocol. You do that because every input/output field, alarm display, status icon you generate is linked to a tag, linked to an address of a register in the PLC.