Modbus TCP and/or ethernet TCP/IP connection to ProFace HMI
Hi PLCnext forum team:
I'm attempting to connect the flashlight project that comes with the PLCnext AXCF 2152 Demo to a ProFace HMI unit and I'd like to first use ethernet tcp ip and then Modbus tcp to show the different lights lighting up with lamp/LED visual objects on the HMI. This requires pulling discrete tags through in both cases. How do I go about doing this? Eventually I'd also like to be able to do this through a C++ program but later. THanks!
Comments
Hi Brendan,
I'm guessing that the ProFace HMI - like HMIs from other manufacturers - allows you to send and receive data from a PLC using different communication protocols like Ethernet/IP and Modbus/TCP.
In these cases the HMI usually acts as a "slave" (or a "device", or a "client") in these networks, and it is expecting the PLC to act as the "master" (or "controller" or "server").
In the case of Ethernet/IP, at the moment the AXC F 2152 can only act as an Ethernet/IP device, and so there will be no Ethernet/IP controller. So communication directly between these two Ethernet/IP devices will not be possible.
For Modbus/TCP, it is possible to use the Modbus/TCP library in the PLCnext Store to set up the AXC F 2152 as a Modbus/TCP Server. This requires some knowledge of the way that Modbus/TCP works (e.g. the use of "registers", "coils", "function codes" etc), but there are quite a few resources on the Internet that can help with that, including demo Modbus/TCP clients and server.
Once the AXC F 2152 is set up as a Modbus/TCP server, you should be able to set up the HMI as a Modbus/TCP Client.
If the HMI also support Profinet, you could also try using this protocol, since (unlike for Ethernet/IP) the AXC F 2152 can act as a Profinet Controller.
Also, modern HMIs usually include OPC UA Cient functionality, so you could also use this to transfer data, since the AXC F 2152 includes a built-in OPC UA Server. This is the most "modern", and usually the best supported, solution.
~ Martin.
I have experience with Proface HMI's connected to PLCnext. Everything Martin said about Modbus and Ethernet/IP is correct, but Proface is not capable of Profinet or being an OPC UA client.
If you're familiar with Ethernet/IP, I think it is the easiest to setup because it's on by default in PLCnext. It's just a matter of using the correct settings on the Proface side. Modbus is also a good solution, especially if you use the Proface as the Modbus slave because it can handle connections from multiple devices.
That's great info, thanks Rob.
Looks like I was wrong about Ethernet/IP not being possible in this case. Can you give a little more detail of how this works? I thought it would need an Ethernet/IP controller somewhere in the network - something like a ControlLogix PLC - but if not then that is very good to know.
~ Martin.
... and there's the answer:
https://faq.hmisource.com/knowledgebase/s/article/can-the-pro-face-display-be-a-ether-net-ip-implicit-master
... so there is no ControlLogix PLC required for a Proface HMI (with the correct driver) to exchange data with an AXC F 2152 via Ethernet/IP.
Very interesting.
~ Martin.
Excellent answers! Thanks Martin and Rob, this was very productive and helpful discussion.