09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Multitasking <strong>Basic</strong> <strong>Characteristics</strong> <strong>RAPID</strong><br />

stringtosend:=”this is a test”;<br />

startsync:= TRUE<br />

ENDPROC<br />

ENDMODULE<br />

TASK 1<br />

MODULE module2<br />

PERS BOOL startsync:=FALSE;<br />

PERS STRING stringtosend:=””;<br />

PROC main()<br />

WaitUntil startsync;<br />

!read string<br />

IF stringtosend = “this is a test” THEN<br />

ENDPROC<br />

ENDMODULE<br />

11.3 Type of task<br />

11.4 Priorities<br />

Each extra task (not 0) is started in the system start sequence. If the task is of type<br />

STATIC, it will be restarted at the current position (where PP was when the system was<br />

powered off), but if the type is set to SEMISTATIC, it will be restarted from the beginning<br />

each time the power is turned on.<br />

It is also possible to set the task to type NORMAL, then it will behave in the same was<br />

as task 0 (the main task, controlling the robot movement). The teach pendent can only<br />

be used to start task 0, so the only way to start other NORMAL tasks is to use CommunicationWare.<br />

The way to run the tasks as default is to run all tasks at the same level in a round robbin<br />

way (one basic step on each instance). But it is possible to change the priority of<br />

one task by putting the task in the background of another. Then the background will<br />

only execute when the foreground is waiting for some events, or has stopped the execution<br />

(idle). A robot program with move instructions will be in an idle state most of<br />

the time.<br />

The example below describes some situations where the system has 10 tasks (see Figure<br />

5)<br />

Round robbin chain 1: tasks 0, 1, and 8 are busy<br />

5-42 <strong>RAPID</strong> Reference Manual

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!