Tools->EJS+TwinCAT->Server

The intermediate server application, that can run either in the deployment PC or in a PC with Windows that has undergone the double registration step, is responsible of 1) managing and individualized access to the PLCs from the applets and 2) redirect the orders sent from the applets to the PLCs and the information from the PLCs to the applets. To be able to associate the EJS applets of different experiments with its corresponding PLCs, and change easily the possible connection accordingly with the existing applets and PLCS, its behaviour is defined by means of an XML initialization file.

The intermediate server application

As a managing accessing tool, the current version supports the connection of the applet developed for one type of experiment to its PLC when the PLC is available (i.e. it is not being currently used by other applet). Additionally, it limits the connection time between the applet and the PLC with the timeout information provided by the professors for that type of experiments. Moreover, in those cases where there are several PLCs associated to the same experiment, it connects the applet with any of the available PLCs for this experiment.

When the connection has been suceesfully stablished, the server application is in charge of interpreting the text messages sent from the applets, resend its corresponding orders to the PLCs, pack the information obtained from the PLC in a text message, and send this messages to the applet. In order to reduce the number of messages send between the EJS applet and the server, this intermediate is able of receiving multiple reading/writing instructions in a single text message and return to the applet the information of all the instructions in a unique text too.

The XML configuration file

The relation between the practices and the PLC programs, as well as the PCs where they are running, the timeouts defined by the professors, and the IP camera pointed towards the experiment are defined in this file. Therefore, the professors can increment/decrement the number of existing experiments and PLCs in their laboratories without having to change the server application code. Nevertheless, as this file is only read when the intermediate server application is setup, the application should be closed down and setup again when the file is changed.