Example of communication over Sockets

Example is placed in the folder: /Pm/Examples/Commun/Socket. This is an example of data communication between two PROMOTIC applications over Ethernet sockets. This communication type (via sockets) is now considered obsolete (but functional) in the PROMOTIC system and now is more useful to use XML communication. For the general description of the Socket communication see Data transfer in network over Sockets.
This example consists from 2 applications in the folders "Client" and "Server". Both application share two data objects "Data1" and "Data2" of the PmData type. There are 9 variables of the Integer type in "Data1" and 8 variables of the Double type in "Data2".
The "Server" application has created one Socket server group "MyData", which both objects "Data1" and "Data2" are connected to, on the "Sockets" page in the PmRoot object. The "Time" object increases the variable values in these objects every second.
The "Client" application has created one Client group "MyData", which both objects "Data1" and "Data2" are connected to, on the "Sockets" page in the PmRoot object. The Client group "MyData" has the network address of the server set to the TCPIP address "", which is the shortcut for the local computer (the universal address of the computer where the application is running). If you want to test Client and Server on different computers connected to the network, then the correct address of the server needs to be set here! In the client application it is possible to use the buttons for calling the ReadFromSocket and WriteToSocket methods.
Both applications can be viewed in the INFO system.

The Client application writes into the Debug information in the onEndOfTransfer event of the Data1 and Data2 objects. This event is called if the client transferred the data to/from the server - i.e. if Client calls ReadFromSocket or WriteToSocket.

The real values of the "Data1" and "Data2" objects can be also viewed in the INFO system.

PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice