Software details

The next figure shows the complete software components flowchart. The Servlet and the Servlet Server are combined with the Web Server. Besides, since the Web Server, the Servlet and the Grab Server are all Linux programs and can work on the same machine, the figure shows a simplyfied situation in which there are only two computers and just a physical system available for experiments.

All the processes communications are based on the TCP/IP protocol, with the exception of the link between Matlab and the Telelab Server, that is based on the Microsoft DDE mechanism (Dynamic Data Exchange).

WinCon is a client-server software used to manage the acquisition board and execute the real time code. In our project the client and the server have been installed on the same computer. WinCon is a Windows program, designed for real time application, that executes the code generated by Real Time Workshop starting form a control algorithm realized in Simulink. With WinCon we make at one's disposal already compiled algorithms ready to be executed. The users can also modify several control parameters without the needs to re-compile.

The execution of real time code move automatically a great problem: the time sharing between the active processes. To improve the system performance it is advisable to use hardware clocks instead of generating them via software. After this it is important to ensure that every process will be processed exactly in the sample istant. This may be obtained only with a real time operating system. Alternately we have installed the RTX software on Windows NT, that improves significantly the system performance.

Next figure shows all the processes and threads that interact when a user enters the telelab and makes an experiment.

The figure shows a sequence diagram in the UML standard. All the colored boxes represent a process or a thread. Every process has a different color. The threads with the same color are of the same process. The interactions sequence refers to a situation in which no errors occurs. Every error on the sockets, yielded by the net or by wrong transmissions, cause the telelab stopping. In some cases it is needed to restart manually the system.

The sequence diagram starts when a user sends the request to make a remote experiment. If the selected system is free, the permission to access the system is granted. The Servlet Server creates a new Servlet instance, that starts the webcam images recording, launching a message to a suitable thread of the Grab Server. The frames are preserved to create afterwards a digital video. Further the same frames are used to refresh on the Applet (one per second) the image by which the user can monitor in real time the proceeding of the experiment. A greater sampling rate is not possible, due to the Internet bandwidth limitation.
After this, the Servlet formats and sends to the Telelab Server all the control data the user has inserted. These values are saved on a text file for Matlab (m-file). Subsequently the Telelab Server passes to Matlab a set of WinCon commands that will start the experiment.
To stop the execution of the real time code, the Telelab Server uses a timer and a look-up file, in which every available remote exeriment is registered. From the look-up it is known the time the experiment needs. After having stopped the exepriment, the Telelab Server halts the images grabbing. All the collected frames are then used to encode an MPEG digital video that will be available for the following download.
In the time the MPEG encoder takes to produce the video, the Telelab Server sends to the Applet the data needed to plot some state variable of interest, and creates with these data several files (in the formats .mat, .txt, .zip) for future downloads.

Follows all the closing operations, needed to make the system ready for the next usage.


| Architecture | Vision system | Software details | People |