I was just testing out the upcoming release for Groov EPIC and the Modbus TCP functionality that will be built into the controller and wanted to share some information.
Modbus TCP in Groov EPIC will work just as it did in SNAP PAC for talking to your Memory Map locations. It does not use base-one addressing and you can still find the Unit ID and Register Address for any scratch pad location with the Modbus Calculator in PAC Manager. The PAC Manager User’s Guide for Configuring Modbus Options may be useful if you have questions.
The Modbus Protocol of PAC controller can be disable by PAC Manager.
How to disable the Modbus Protocol of EPIC-PR1? We don’t find any document to mention it.
We had PAC Control Code of Modbus/TCP master. It can be work properly in PAC-R2 after use the PAC Manager to disable R2’s Modbus Protocol.
But this code can not work in EPIC even we turn off EPIC Mobus port from the firewall. .
The Communication Handles = tcp:502.
PAC control always get the Error Code:-440 when do the command:ListenForIncomingCommunication.
The PAC Control will be crashed when we iinspect this Communication Handles.
How to disable the port 502 in EPIC???
Error -440 is ‘Could not bind to socket’.
Because you shut the firewall, port 502 is now no longer listing, so pac control gives the error that there is nothing to connect to.
Port 502 is shut/disabled and your code confirms that.
The same code for PAC R2 and EPIC:
chMB_TCP_Slave_Port =“tcp:502”
iMB_TCP_Port_Status = ListenForIncomingCommunication(chMB_TCP_Slave_Port);
In PAC R2:
Disable R2’s Modbus Protocol by set R2’s Modbus Port = 0.
Run R2’s code. The iMB_TCP_Port_Status = 0.
In EPIC : Modbus TCP Port: 8502 Daney: Eth0, Eth1, wLan0 or Allow all
Run EPIC Code: The iMB_TCP_Port_Status = -440.