WAIT: Difference between revisions
Content added Content deleted
(Created page with "'''WAIT''' statements are simple conditional instructions. They evaluate a condition or series of conditions, and only continue on to the next line if true. File:inst-wait-...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''WAIT''' statements are simple conditional instructions. They evaluate a condition or series of conditions, and only continue on to the next line if true. |
'''WAIT''' statements are simple conditional instructions. They evaluate a condition or series of conditions, and only continue on to the next line if true. This allows you to add a delay to the progression of a robot's program. |
||
[[File:inst-wait-seconds_orig.gif|thumb|How to add a "wait seconds" instruction. ]] |
[[File:inst-wait-seconds_orig.gif|thumb|How to add a "wait seconds" instruction. ]] |
||
Line 5: | Line 5: | ||
{| class="wikitable" |
{| class="wikitable" |
||
! |
! WAIT |
||
! Variable |
! Variable |
||
! Math |
! Math |
||
! |
!Variable |
||
!Modifier Choice |
|||
! Action |
|||
!Modifier Variable |
|||
! Destination |
|||
|- |
|- |
||
| |
| WAIT |
||
| R[1] |
| R[1] |
||
| = |
| = |
||
| |
|6 |
||
| |
|||
| Call |
|||
| |
|||
| Program1 |
|||
|- |
|- |
||
| |
| WAIT |
||
| DI[3] |
| DI[3] |
||
| = |
| = |
||
| |
|ON |
||
| |
|||
| JMP |
|||
| |
|||
| LBL2 |
|||
|- |
|||
|WAIT |
|||
|1.2 (Sec) |
|||
| |
|||
| |
|||
| |
|||
| |
|||
|- |
|||
|WAIT |
|||
|2 (Sec) |
|||
| |
|||
| |
|||
|TIMEOUT |
|||
|[[JMP/LBL|LBL[1]]] |
|||
|} |
|} |
||
The condition can be any valid variable compared against any other variable, as well as just a time constant. |
|||
The '''WAIT''' instruction modifier '''TIMEOUT''' lets the instruction break out to a given '''[[JMP/LBL|LBL]]''' after a certain amount of time has occurred. This can be useful for error checking or multitasking, where the robot sitting idle is an undesired event. |
Latest revision as of 17:17, 24 September 2020
WAIT statements are simple conditional instructions. They evaluate a condition or series of conditions, and only continue on to the next line if true. This allows you to add a delay to the progression of a robot's program.
If it is not true, the instruction will continue checking if it is true until it becomes true.
WAIT | Variable | Math | Variable | Modifier Choice | Modifier Variable |
---|---|---|---|---|---|
WAIT | R[1] | = | 6 | ||
WAIT | DI[3] | = | ON | ||
WAIT | 1.2 (Sec) | ||||
WAIT | 2 (Sec) | TIMEOUT | LBL[1] |
The condition can be any valid variable compared against any other variable, as well as just a time constant.
The WAIT instruction modifier TIMEOUT lets the instruction break out to a given LBL after a certain amount of time has occurred. This can be useful for error checking or multitasking, where the robot sitting idle is an undesired event.