Hello Guest it is April 09, 2020, 06:44:16 AM

Author Topic: Mach 4 MODBUS TCP to Panasonic PLC communications  (Read 85 times)

0 Members and 1 Guest are viewing this topic.

Mach 4 MODBUS TCP to Panasonic PLC communications
« on: March 25, 2020, 12:08:07 PM »
Hello,
   We are using Mach 4 and the ESS Smoothstepper control board to run a custom 6-axis machine. We are greatly expanding the number of inputs and outputs (solenoid valves, etc.) on a new version of the machine, and would like to use a Panasonic FP-X PLC to handle those.
   We have had no luck getting communication between Mach 4 and the PLC, using the Modbus plugin configuration. The PLC has an ethernet port, which we've successfully setup to communicate with the host Windows 10 PC (because we can run the PLC config software--FPWIN-Pro 7 to set up and monitor the PLC). Simply trying to write to a single coil (0x5 Modbus function), doesn't work, either to a Y output (Modbus register 1 to 2048) or R register (2049 to 9999).
    I'm ignorant about Modbus, there is no Mach 4 documentation that I can find to help, and the Panasonic documentation is lamentable. Any basic suggestions on how to get these two semi-understood entities to talk with each other would be greatly appreciated. Thank you!

Offline smurph

*
  • *
  •  1,240 1,240
  • "That there... that's an RV."
    • View Profile
Re: Mach 4 MODBUS TCP to Panasonic PLC communications
« Reply #1 on: March 25, 2020, 11:32:36 PM »
Here is a good dissertation on MODBUS from the people who's library we use in Mach4.  After reading it, you will most likely know more than you ever thought you would want to about MODBUS.  But...  it will help you solve your issue. 

https://www.modbusdriver.com/doc/libmbusmaster/modbus.html

Make sure that the PLC is listening on TCP/IP port 502 on the Ethernet.  Sometimes, you have to turn on MODBUS support! 

Steve
Re: Mach 4 MODBUS TCP to Panasonic PLC communications
« Reply #2 on: March 26, 2020, 12:40:21 PM »

Here are a couple screen shots from my system,  I am not using a panasonic plc but this should help with the Mach4 side of it, 


all the best
Bob
Bob
Re: Mach 4 MODBUS TCP to Panasonic PLC communications
« Reply #3 on: March 26, 2020, 09:47:19 PM »
Thank you so much for the replies. I've only started on the MODBUS summary that was linked. But I'm worried that my problems are on the Panasonic end. Although the PLC clearly supports MODBUS TCP and MODBUS RTU serial communications, the communications cassette with the ethernet adapter will NOT allow me to set port 502 as the TCP port (Only port numbers 1025 and up allowed). This has me baffled. As Bob's screenshot shows, Mach 4 MODBUS setup screen allows a server TCP port number to be entered: doesn't this allow me to use a different port?
    I've attached a screen shot of the Panasonic PLC's communication setup showing the port restrictions. Thanks for the help--I'm slogging through this.

Offline smurph

*
  • *
  •  1,240 1,240
  • "That there... that's an RV."
    • View Profile
Re: Mach 4 MODBUS TCP to Panasonic PLC communications
« Reply #4 on: March 27, 2020, 04:41:19 PM »
You can use any port you wish, as long as the PLC and Mach's MODBUS agree on the port number.  But I doubt that is your problem.  I don't think that is the MODBUS port setting.  I think that is the general communications port setting used for communicating with other PLCs and the for connecting to the PLC with the configuration software. 

For Ethernet, your communications cassette needs to be an AFPX-COM5.  Looking at the manual on page 7-16, it doens't look like MODBUS is supported on the Ethenet interface.  Only on the serial interface.  That is just how I'm reading it, but I could be wrong.  Also, look at page 7-78 and it shows a MODBUS config dialog.  This is what I was talking about where you may have to configure the PLC to turn MODBUS on.  Their example shows linking MODBUS to one of the serial com ports, but that would be where you could link it to the Ethernet interface and set the port number. 

This is the manual I was referring to: https://www.panasonic-electric-works.com/cps/rde/xbcr/pew_eu_en/mn_63489_0013_en_fpx.pdf

Steve