Drakon Book : Chapter 11 [English Translation]

Chapter 11

Page HistoryLast edited by PBworks 8 years, 7 months ago

VISUAL OPERATORS REAL TIME

A good image is sometimes not only allows you to make clear and understandable are difficult questions, but often able to suggest a fundamentally new philosophy, an idea, a hypothesis that without such a pattern, they say, do not come to mind.

Alexander Zenkin

List of operators LIVE

In the language of DRAGON has five icons real time (Fig. 1, the icons and 16 – I20):

  • break;
  • period;
  • Start timer;
  • synchronizer (timer);
  • parallel process.

Three of them (pause, start the timer and parallel process) – simple statements. The other two (the period and synchronizer) are the “building blocks” for the construction of composite operators and the latter is not used.

Icon “period” is an accessory cycles WAITING (Fig. 2, makroikona 7). Icon “synchronizer” serves to form the thirteen composite operators (Fig. 2, makroikony 8-20).

Assignment operators explain, as always, with examples.

OPERATORS O

In language there are two visual DRAGON operator O “output” (Fig. 1, an icon and 14) and the “enter” (Fig. 1, an icon I15).They are not real time and operators are described here because there are in the near example.

From Fig. 1 shows that the icon O are mnemonic form: an icon and 14 comprises a hollow arrow pointing out that symbolizes the “output”, and an icon I15 – arrow pointing inwards (input). Both operators “double-decker”, and is written on the top floor a keyword or keyword phrase, and at the bottom (in the box) – informative information to be input and output (Fig. 82, 83).

OPERATOR “PAUSE”

Suppose host computer must issue a series of electrical commands that are transmitted over the communication lines to the executive bodies and trigger the electromechanical relays. The result is the opening of the pipeline, including the pump and other operations necessary for the operation of the managed object. Such a situation can occur in many systems, real-time control: when refueling ballistic missiles, nuclear power plants, refineries and so. D.

Consider a specific example. Assume control computer must:

  • issue a command OTKRYT.TRUBOPROVOD;
  • wait a minute or two;
  • to issue two commands: VKLYUCHIT.NASOS and OTKRYT.ZASLONKU;
  • wait 45 seconds;
  • issue a command PODACHA.TOPLIVA;
  • wait three minutes;
  • PUSK.AGREGATA issue a command.

The program of the language DRAGON-2 is shown in Fig. 82. The delay issuing commands is implemented using the icon “pause”, within which indicates the time delay required, for example, for 2 minutes (2 minutes), 45 (45 seconds), and so on. D. More precisely, the top operator of a “pause” Fig. 82 works as follows: After the command OTKRYT.TRUBOPROVOD the host computer to run virtual timer for 2 minutes, after which the computer outputs a line of communication and command VKLYUCHIT.NASOS OTKRYT.ZASLONKU.

Operator “START TIMER” and “SYNCHRONIZER”

Returning once again to the problem described in the preceding paragraph, and slightly change it. We will assume that the developer wants to specify the managed object while not issuing commands on a “delayed after the previous team,” and the principle of the stopwatch when all the time counted from the moment of a single entry (which coincides with the launch of the stopwatch).

On this basis, we formulate the problem of the control computer. He must:

  • include “stopwatch”, t. e. to reset and run the virtual timer;
  • issue a command OTKRYT.TRUBOPROVOD;
  • When the timer counts down for two minutes, to give a couple of teams and VKLYUCHIT.NASOS OTKRYT.ZASLONKU;
  • When the timer counts 2 minutes 45 seconds, issue a command PODACHA.TOPLIVA;
  • when the timer count down 5 minutes 45 seconds, issue a command PUSK.AGREGATA.

Program implementing the algorithm is shown in Fig. 83. It uses the “start timer” and “synchronizing” work together to provide the desired effect.

The operator “start timer” creates, resets and starts the timer and virtual assigns the name A. Camera “synchronizer” delays execution placed on his right visual operator before the time described in the icon “synchronizer”. For example, A = 2min synchronizer 45c in Fig. 83 delays the issuance PODACHA.TOPLIVA team until the timer counts down A 2 minutes 45 seconds.

Comparing the program in Fig. 82 and 83, you will notice that they are almost equivalent. Why almost? If you take the ideal case, and assume that the time required for issuing a single command is zero, the two programs will provide instructions simultaneously. However, in reality, the specified time is greater than zero, however in reality programs operate differently.

The practice of developing control systems demonstrates that in some situations it is preferable the principle breaks, and in others – the principle of the timer, so both tools are equally necessary and useful.

Fig. 84 presented a more complex algorithm that uses the “pause”, “start timer” and “synchronizing”.

In the middle branch of the icon shows “pause” recording 2min48s. This means that after the completion of MAGIC REPAIR DISH measured pause of 2 minutes 48 seconds and only after this is done the TROUBLE DISH removal feature. Another pause chetyrehsekundnaya provided in the left branch.

The right branch is the icon “start timer” with a record of A = 0. This statement creates, resets and runs virtual timer A. In the same branch are three icons “synchro timer” with recordings of A = 3 min, 5 min, and A = A = 8min. This procedure call TURN teleportation will not happen immediately, but only after the timer A count down for 3 minutes. Accordingly, the inclusion in the work procedures DISCONNECT gravity and exit the astral body will be delayed as long as the timer will not accept values ​​And 5 and 8 minutes, respectively.

From Fig. 84 it is clear that the operator “start timer” can be used in two ways. Firstly, together with the icon “synchronizer” (this case we discussed), and secondly, in conjunction with the icon “issue.” The latter case is discussed in the next section.

CYCLE WAITING

Suppose you want for three minutes wait for at least one of the two signs of the left engine in normal and right engine to normal. Upon the occurrence of the event (the appearance of signs) must include a plasma reactor. If there are no signs named after three minutes should include the photon engine.

To solve the problem in Fig. 84 uses two operators: Start timer T counts down three minutes, and the cycle is wait. The structure of the last part of the icon “period” and the three icons “issue” in which there are inscriptions left engine NORMAL ?, right engine correct? and T> 3min (check the last statement: the timer T for more than three minutes?). If both signs are absent, and the timer value is not more than three minutes, the survey conditions periodically repeated, and the polling period indicated in the icon “period.” In this example it is equal to 4 seconds.

As can be seen from the figure, the work cycle WAITING end when detecting one of the expected signs, and if they did not appear – after three minutes.

In general WAITING cycle shown in Fig. 85. It allows you to organize standby features B, C, D, …, E. If there were signs in the first, the action F. If B is not the first to come and sign C, realized action G. And so on. Operators A and L are not commonly used.

The task waiting a few signs (when the system has to react differently to each attribute) is one of the most typical in the development of real-time control systems. WAITING cycle offers an extremely simple, easy, intuitive and effective means to address it, thus satisfying an important need for practice.

OPERATOR “PERIOD”

Comparing makroikony 4 and 7 in Fig. 2 (normal cycle and the cycle of wait), we see that they are very similar. Therefore, to avoid confusion, you need to have some distinctive feature. This function is performed by the icon “period.” If it is in the loop cycle – a cycle in front of us waiting. If not – the usual cycle.

The man who stands at the bus stop and waits for the tram or bus, takes the expectation as something continuous.However, the program organizes the real time expectations as a discrete process, and starts the cycle WAITING periodically. It follows that the period – an important characteristic cycle wait.

And now ask the most interesting question: How does the operator “period”? The trick is that this question would have to give two very different answers.

From the perspective of the person reading the program in Fig. 84, everything is very simple: the cycle WAIT “cool” by their loop at intervals of 4 seconds is not satisfied one of the three conditions, and then exits the loop. Thus, the operator “period” sets the repetition cycle period of waiting.

From the perspective of the functioning of the real-time program, the situation is different. The bottom line is that the duration period starts is not the application in Fig. 84, and the dragon-Manager, a part of the real time operating system.Operator “period” means the exit from the application: control passes to the dragon-manager (with simultaneous transfer option 4c). Every four seconds a dragon dispatcher transfers control to the beginning of the cycle WAIT (point A in Fig. 84), and if all three conditions give the answer “no”, the operator “period” whenever returns control to the dragon manager.Thus, the operation cycle WAIT is provided jointly by the application program and the dragon-Manager.

Often there is a situation where a real-time software developer uses a loop to wait, but considers that its program specific period value is irrelevant. In this case, the icon of “period” should be left blank; the system will assign a default period of maximum value from the range, which has a dragon-manager.

OPERATOR “parallel processes”

Suppose that two algorithms A and B, where A – the basic algorithm,

and B – a subsidiary. Algorithms A and B may be operated in series (Fig. 86) or in parallel (Fig. 87). To organize a coherent work necessary dragon scheme A basic algorithm to draw the icon insert labeled B. For example, in Fig. 84 mainly checking algorithm flying saucer has an icon insert the check engine. These algorithms operate sequentially. The basic algorithm gives control algorithm and check the engine stops. Resuming checking algorithm flying saucer will only happen when the algorithm insert check the engine over. In general situation is shown in Fig. 86.

Unlike the parallel mode is that after the auxiliary main algorithm Algorithm A stops working and acts in conjunction with the algorithm (Fig. 87).

To organize the parallel work is necessary in dragon pattern A basic algorithm to draw the icon “parallel process” (Fig. 1, an icon I20). Icon “duplex”: on the top floor write a key word for the command change the status of the parallel process, for example, “Start”, “Stop”, and so on. D. On the ground floor is placed the ID (name) of the parallel process.

Referring to the example in Fig. 84. The right branch has two parallel processes of the operator control. After the procedure WITHDRAWAL astral body is made stop parallel process Sabbat evil spirits and start the process Sabbat good spirits.

It is assumed that before checking algorithm Frisbees a third algorithm gave the command “Start” and launched a parallel process Sabbat evil spirits. Last works in conjunction with the algorithm TEST flying saucers until the date of issue the command “Stop” (see. The last branch in Fig. 84). This command removes a parallel process Sabbat evil spirits at this point simultaneous operation ends. However, the following command “Start” starts another parallel process – Sabbat good spirits, which starts at the same time checking algorithm flying saucers.

FEATURES OPERATORS REAL TIME

We have already said that the cycle WAITING running applications involving dragon Manager. This conclusion applies to all operators real time. However, it should be emphasized that this statement does not refer to the language, and to implement the system and for different implementations may differ.

Operators of the real-time – is the formal language statements visual programming Dragon 2. However, they can be used in a pseudo-DRAGON-1 at the informal image algorithms – to build visual “images” makes it easy to explain this or that idea, related to real-time systems. Examples of such images are shown in Fig. 88 and 89. In this case, the icon of cycle WAIT “period” is usually omitted to avoid cluttering the figure (see. The last branch in Fig. 88). However, if the length of the period needed to understand the icon “period” can be saved (Fig. 89).

Unlike conventional computing and information program to program real-time icon of the “end” may be missing. This is the case when you need to organize an infinite loop that stops particular external cause, such as turning off the power of the system or the destruction of the object (Fig. 88, 89).

Dragon program may have more than one input. To arrange an additional input, you need to place the icon “title” on the icon “branch name” as shown in Fig. 84 on the right. Thus, any branch can be declared an auxiliary input. However, there is an exception: if several branches twig form a cycle, the entrance is permitted only at the beginning of the cycle. The rest of the construction branch “twig cycle” can not be included in the program.

CONCLUSIONS

  1. Availability of real-time operators dramatically expands the visual possibilities of the language of dragons and it can be used in the design and development of not only information but also control systems. This substantially increases the scope of the language.
  2. An additional advantage is the brevity of means of expression, their universality. In the language of only five icons real-time, but their algorithmic power – in combination with other features of the language – it allows you to cover a wide range of tasks associated with the creation of software for control systems.
  3. It plays an important role ergonomic operator real time. Like other operators DRAGON language, they have a visual character that allows you to make real-time operations more visible and easier to understand than the traditional text entry.
  4. Four icons (pause period, a timer and start synchronizer) – “close relatives” in the sense that within each specified time value. This kinship is its ergonomic reflected in the fact that these operators have a visual “family resemblance” – they built (with variations) based on the same geometric shape – an inverted isosceles trapezoid.
  5. Operators of the real-time computer generate complex actions associated with frequent transfers of control between the application and the operating system (dragon-manager). Ergonomic highlight is that these programs deliberately hidden from the reader program, so as not to clutter up the text (drawing) minor details. With this reader’s attention is not distracted by trivia and he has the ability to concentrate on the essentials, as the dragon diagram gives him a clear, accurate and complete picture of an algorithmic process, purified from the “debris”.

Attachments

  • R89 (82.24 KB
    27.07.2015
    )
  • R88 (81.88 KB
    27.07.2015
    )
  • R86-87 (93.35 KB
    27.07.2015
    )
  • R85 (9.86 KB
    27.07.2015
    )
  • R84 (89.6 KB
    27.07.2015
    )
  • R82-83 (25.31 KB
    27.07.2015
    )

Leave a comment

Your email address will not be published. Required fields are marked *


eight − = 3

Leave a Reply