To control the plasma shape during a tokamak discharge, it is necessary to calculate the plasmashape in real-time. The rate requirements for the shape calculations are especially high for tokamaks with asmall radius, such as Globus-M2 (St. Petersburg, Russia). A real-time magnetic plasma control system forthe Globus-M2 tokamak with flux and current distribution identification (FCDI) algorithm for the plasmaequilibrium reconstruction in feedback is presented. The control system contains discrete one-dimensionaland matrix proportional-integral-derivative controllers synthesized by the matrix inequality method usingthe plasma LPV model calculated on experimental data, and carries out the coordinated control of the plasmaposition and shape as well as the compensation for the scattered field of the central solenoid. The FCDI algorithmis improved for the operation in the real-time mode, and makes it possible to reconstruct the plasmashape in 20 μs. The digital control system with a feedback algorithm was simulated on a real-time test bench,consisting of two Speedgoat Performance Real-Time Target Machines (RTTM), and demonstrated the averageTask Execution Time (TET) value in 67 μs.