Running Multiple Instances of Software

Last modified by writer on 2023/02/20 14:51

It is permissible to run PUMOTIX software in the form of several independent instances of the Client and Server within the same operating system. For example, to control multiple CNC machines from one computer. To automatically start two or more instances of the Client and the PUMOTIX Server, you need to use a special script.

To run multiple instances of PUMOTIX, download and run the pumotix_multiple_run batch file. By default, the script is configured to simultaneously launch two independent instances of the Client and Server. To run more instances of the program, open the script with a text editor and specify the required number of instances in the instance_count variable. After that, save the edited file and execute it again. For each instance of the Client and Server there must be a unique set of configuration files.

After the first launch of the script, unique working directories for Servers and Clients will be created. They must be unique so that each instance of the program can store and use its own set of settings. For this, it is necessary to slightly modify the configuration files of the PUMOTIX server, indicating in each a unique port for connecting clients. Detailed instructions are given below.

PUMOTIX default working directory:
%userprofile%\local settings\application data\purelogic\pumotix

For each instance of the Server, a unique port must be specified for connecting Clients (see the <client_port> </client_port> element in the <srv> </srv> node in the config.xml server configuration file). An example of working with the config will be given below.

When creating additional directories, only the last path directory (Client_1, Client_2, Server_1, Server_2, etc.) automatically changes to provide unique paths for configuration files. If necessary, the path to the working directory in the script can be specified in the variable def_working_directory_path.

Let's move on to editing the configuration files of the PUMOTIX servers.

For the main PUMOTIX instance (let's call it null), you do not need to edit the configuration files.
We edit the config.xml file for the first additional instance of the Server (path to the configuration file: % userprofile%\local settings\application data\purelogic\pumotix\server_1\config.xml).

We find the srv node and the elements client_port and srv_name. The port can be choosen in the range 1025 - 65535. As part of this example, port 27400 was choosen. For ease of navigation across several servers, edit the server name in the <srv_name> </srv_name> element. You can also rename the server through the PUMOTIX graphical interface in the program settings.

<srv>
 ...
    <client_port>27400</client_port>
 ...
    <srv_name>PUMOTIX server 1</srv_name>
 ...
</srv>

If more than two PUMOTIX instances are used, then carry out similar manipulations with the configuration files 3 and subsequent instances, indicating to each a unique port, for example, 1 higher than the previous one (27400, 27401, 27402, etc.)

If everything is done correctly, then when you run the pumotix_multiple_run script, the required number of Clients and Servers will be launched. Each client and server, thanks to its unique working directories, will have independent settings.

If, at the start of the script, the Server starts and shuts down after 2-3 seconds, this means that somewhere the port was used to connect clients.

Once again check that all ports in the configuration have different ports in the section

<client_port></client_port>

Download script file