IP Address and Communication Port Simulation
Original instructions
Overview
The following communication function blocks require a PLC client and a PLC server:
The multiple instances capability of PLC simulator on the same localHost PC allows to simulate the PLC client and PLC server.
Principle
In PLC application (client), the targeted PLC (server) is addressed using its IP address as input parameter IN of ADDM function block. In these function blocks, the communication port is not defined as in the PLC, only the port 502 is always used.
After loading PLC application (client) in a first PLC simulator instance of the localHost PC, to simulate the targeted PLC (server) in a second PLC simulator instance, it could only be addressed threw another TCPIP communication port.
Instead of rewriting the IP address of the targeted PLC (server) in the PLC application (client) the PLC simulator instance can substitute IP address of the targeted PLC (server) with a TCPIP communication port provided in a port simulation file. This file contains a correspondence between IP address and localHost TCPIP communication port.
As illustrated below, when the PLC application (client) calls a targeted PLC (server) using the {IPB} IP address, the PLC simulator instance A substitute the {IPB} address with {localHostIP:PortB} address corresponding to the PLC simulator instance B connection.
Port Simulation File
The correspondences between IP address and communication port to simulate is provided in a port simulation file (*.xml) with the following syntax:
<EquiList>
<PLCAdressSim Address="172.168.12.0" Port="503"></PLCAdressSim>
<PLCAdressSim Address="192.168.0.2" Port="504"></PLCAdressSim>
</EquiList>
Where Address is the IP address in ADDM block and Port is the simulator port to use for simulation.
NOTE: The port simulation file must be unique for one PC.
You can change the location and the name of the file in the Options Dialog Box.
In the input parameter syntax of the ADDM function block, the IP address is prefixed by the communication port topological location, that is 0.0.3{168.127.0.1} for M580 CPU port. This typical syntax is ignored and not checked by the simulator.
If an IP address in ADDM function block is not founded in the port simulation file, there is no substitution and the IP address is used by the PLC simulator. It allows to test real PLC server.
Limitation
Usage of Libset V15.0 or later is mandatory to support READ_VAR, WRITE_VAR and DATA_EXCH on PLC simulator.