DRAKON Visual Language: Tutorial. Part 2


Published on

Interaction with the outside world, parallel algorithms and real time

Published in: Education, Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

DRAKON Visual Language: Tutorial. Part 2

  1. 1. DRAKON VisualLanguageTutorial. Part 2:Interaction with the outside world,parallel algorithms and real time
  2. 2. The extended set of DRAKON iconsShelfInputOutputParallel processPause, SynchronizerTimer
  3. 3. What can a “Shelf” icon do?Put a value on the shelfSend a command to the doerTerminate the algorithm
  4. 4. Put a value on the shelf●Assign a new value to the property●Put a new value in the variable●Set or clear a flag
  5. 5. Put a value on the shelfPlace the product of width andheight in the “area” variableSet the “Power ON” flag
  6. 6. Shelf: send a commandto the doer
  7. 7. Shelf: terminate the algorithmExample:●“Make a new version” algorithm invokes“Development task” algorithm●“Development task” algorithm invokes“Analyze dependencies” algorithm●This “Shelf” icon is executed inside “Analyzedependencies” algorithmWhat happens next?●“Analyze dependencies” terminates●“Development task” terminates●The control is returned to “Make a newversion”
  8. 8. Interaction with the outside world“Input” icon“Output” icon“Parallel process” icon
  9. 9. Input Output Parallel process
  10. 10. A keyword or a key phraseThe upper floorInput Output Parallel process
  11. 11. The detailsThe lower floorInput Output Parallel process
  12. 12. What does “Input” icon do?●Receives information from external senders●Gets messages from a parallel process●Performs data input into the computer:– Receives data from the user via keyboard andmouse– Reads data from disk– Receives data from the network
  13. 13. What does “Output” icon do?●Sends information to external recipients●Sends messages to a parallel process●Performs data output from the computer :– Shows data on the screen– Writes data to disk– Sends data over the network
  14. 14. An example with “Input” and “Output”
  15. 15. What is the difference between “Shelf” and “Output”?Assigns a value to aninternal variableShelfGives an order to aninternal doerSends a message to anexternal processOutputSends information to anexternal recipient
  16. 16. The commands that control parallelprocessesStart Starts a parallel processStop Stops the parallel process foreverSuspend Suspends the parallel processResume Resumes the suspended process
  17. 17. Controlling a parallel process
  18. 18. Commands sent to a parallel processdo not suspend the main processMain processParallel processStart Stop
  19. 19. Internal parallel processesThis double horizontal linestarts a parallel skewer
  20. 20. Internal parallel processesThe parallel skewer executessimultaneously with the mainskewer
  21. 21. Internal parallel processesThis horizontal line stops theparallel skewer
  22. 22. Wrong! The main skewer must not be broken
  23. 23. The following actionscan be done in any orderafter the field ofoperations is prepared:● Extend electric powerline● Purchase wires● Install windows● Finish roof● Purchase water pipesThe assembling of theelectric panel cannot bestarted before theinstalling of windows andfinishing the roof arecomplete.A complex parallel algorithm
  24. 24. Adds a delay between two operatorsPause
  25. 25. Timer “T” startsTimer and synchronizer
  26. 26. This operator executes when thespecified time has passed sincethe start of timer “T”.(0.3 of period of revolution ofcrankshaft)Timer and synchronizer
  27. 27. What is the difference between“Pause” and “Synchronizer”?Runs the next operatorafter some time has passedsince the previous operatorPauseNo need for a timerRuns the operator aftersome time has passedsince the timer startSynchronizerThe timer must be started
  28. 28. “Wait” loopA “Wait” loop sleepsbetween iterations
  29. 29. Stepan Mitkinstipan.mitkin@gmail.comThe diagrams on the slides were made withDRAKON Editorhttp://drakon-editor.sourceforge.net/June 2013End