Testing the peer-to-peer applications

The test requires two PCs. Alternatively, the test may be carried out with two runtime systems on a single PC. The constants with the port numbers and the IP addresses of the communication partners must be modified accordingly.

Example test configuration with 2 PCs:

Device A is located on the local PC and has the IP address '172.16.2.209'

Device B is located on the remote PC and has the IP address '172.16.6.195'

Testing the PLC devices

1. Open the peer-to-peer PLC project for device A on the local PC. The constant REMOTE_HOST_IP in MAIN has to be adapted to the real IP address of your remote system (in our example: '172.16.6.195'). Load the project into the PLC runtime system. Start the PLC.

2. Local PC: In online mode, write the value TRUE to the boolean variable bSendOnceToItself in MAIN. Shortly afterwards, a message box with the test string should appear. The UDP data were sent to the local port and IP address.

Testing the peer-to-peer applications 1:

3. Remote PC: Open the peer-to-peer PLC project for device B on the remote PC. The constant REMOTE_HOST_IP in MAIN has to be adapted to the IP address of your local PC (in our example: '172.16.2.209'). Load the project into the PLC runtime system. Start the PLC.

4. Remote PC: In online mode, write the value TRUE to the boolean variable bSendOnceToRemote in MAIN. Shortly afterwards, a message box with the test string should appear on the local PC.

Testing the peer-to-peer applications 2:

Test with the Visual Basic application

Here you can unpack the Visual Basic sources: VB communication partner for the PLC.

5. Local PC: Start the Visual Basic application (PeerToPeer.exe).

6. Local PC: In the VB dialog, the IP address of the remote host has to be adapted to the real IP address of the remote PC (in our example '172.16.6.195' ).

Testing the peer-to-peer applications 3:

7. Local PC: Click the send button. A test string is sent to the remote device with port number 1001. In our case it is the PLC application.

8. Remote PC: Shortly afterwards, a message box with the test string should appear.

Testing the peer-to-peer applications 4: