[Glue!] Execution state of software modules


As the Glue Logic uses status information on the application program processes, the information should be stored in the Glue Logic as the value of status indicator object names. The status indicator object names in the Glue Logic should have one to one correspondence to the processes of the application program module, not to the module itself. So the symbolic names of such status indicators representing each of the processes should be strings which contains ordinal number of process invocation or process identifier assigned by the operating system.

For each application program process, there are some states it may take in turn. Its status indicator represents its execution states by having predefined flag values for each states. The states are as follows:

Initializing State
In order to start up the operation of an application program, there should be some preparation work such as initialization of the Glue Logic object names. This kind of work is done in the initializing state.

The application should first create a status indicator object name in the Glue Logic, which reflects the status of the application process itself. Secondly, the status indicator just created is assigned a flag value to indicate the initialization state. Then, the initialization tasks are carried out, and lastly the application process enters the idling state.

Idling State
In this state, the application is idling, waiting for the notification message from the Glue Logic, which tells the meeting of the starting condition of the application process itself. In this state, by assigning a flag value for the idling state to the status indicator, the application process tells to others that the process itself is ready to be started.

Initiating State
After receiving the start up message, the application process enters the initiating state, in order to start securing shared resources. If the application process succeeds to secure all the resources it requires, the process enters the running state to execute main tasks, showing the running state flag value with its status indicator.

If the application process fails to secure all the required resources, the process can not enter the running state. In this case, the application process should release all resources already secured at this instant, and retry after certain time period.

Running State
In this state, the application process controls machine tools in the work-cell, processes many kinds of data, and sends out the work-piece to the other work-cell. The running state is the one to carry out the task.

After all the tasks the application should execute are completed, the process assigns the flag value of the completing state or the completion status code to the status indicator. Using this transition of the status indicator, the Glue Logic can starts other applications.

If the completion status code is used instead of the flag value of the completing state, the following application process can be selected according to the code. In this point of view, at least two flag values of completion states are required, which indicate successful and abnormal completion.

Completing
After the task completed successfully, the resources secured by the application process should be released. The completing state is used for such operation, and after this state the application process enters the idling state, waiting for the next notification message to start again.

In the case of abnormal completion, its fixing procedures varies according to its internal and external status. So the application should export its precise status to the Glue Logic or some other fix up processes, and then exit for the next execution. In some cases, it is required to kill the application process itself, and creating new process for the next execution.

Terminating
This state is optional one. If the application process receives directions to halt, it enters the terminating state. In this state, the application process assigns a flag value of the terminating state into the status indicator, and exits. Any other application then knows that the application process has already stopped.
As described above, using status indicator object names in the Glue Logic, the application program modules can be chained or executed concurrently.

 [M.T. HomePage]  [written & copyrighted by Masayuki Takata]