Asynchronous Process Control
for RAD tools

S. A. Kryukov
Institute for Nuclear Research, Moscow, Russia

Shell we Replace LabVIEW® with
Object-Oriented Instrument ?

S. A. Kryukov
Institute for Nuclear Research, Moscow, Russia

State diagram of the MOON Lab Shell
running User Process

Multiple MOON Lab applications, sharing the measurement apparatus

Multitasking sharing of the apparatus via the driver-reside semaphores

   Semaphore->P();        // Process waits here

                          // if any other process accesses
                          // critical section

     ADC1->EnableRead(0); // Critical section:
     Crate->WaitX();      //   using shared resource of apparatus

   Semaphore->V();        // Semaphore released

The MOON Lab - new software developed at the Moscow Meson Factory - is considered as an object-oriented replacement for LabVIEW. It can serve as a RAD tool of better performance and more wide range of control and data acquisition applications.

("MOON” stands for "Multitasking Object-Oriented Network”)

MOON Lab is also an environment for running measurement and monitoring applications on a local area network or a single computer. These MOON Lab-specific applications can be developed with a easy-to-use interface library supplied.

MOON Lab introduces several novelties of programming technology.

Asynchronous process control

Registered controlled variables (process parameters) can be modified via the user interface asynchronously relative to the process.

  { Example of registering the controlled variable

    (Volterra model for population dinamics in ecology)



    x0,                               { reference to variable  }
    'hares 0',                        { label in the pick list } 
    'initial population of hares',    { legend                 }
    0,                                { minimum valid value    }
    2000                              { maximum valid value    }

Registered variables appear in the user-accessible lists (for monitored and controlled variables)

Language-independent implementation of structured exception handling

   { exception handling block: }

   if Catch(ml^.PushException^)<>0 then begin
          case ml^.GetExceptionID of
             5: MessageBeep(0);
             4: ml^.Raise(5);
             else ml^.reraise;
          end {case};
          ml^.PopException; exit;
   end {exception};
   { protected fragment of code follows ... }

Layer structure of MOON Lab:

1 - OS layer

2 - MOON Lab layer:

ML API 1.0 - MOON Lab API v. 1.0

ML API 2.0 - MOON Lab API v. 2.0

ML 1.0 - instance of MOON Lab Shell (presentation server) v. 1.0

ML 2.0 - instance of MOON Lab Shell v. 2.0

ND - MOON Lab network dispatcher (presently under development)

Dr - instrumental hardware driver

3 - application layer:

a1 - WIN16 MOON Lab application (User Process for v. 1.0 of the API, .DLL)

a2 - WIN32 MOON Lab application (for v. 2.0, .EXE)

app - other Windows applications.

MOON Lab 1.0: Event-driven user interface and sequential code
of the User Process

MOON Lab 2.0: