Motion Coordinator Technical Reference Manual
Programming Examples 9-13
Example Programs
Example 6 - Motion Coordinator programs sharing data
Description
These two programs run multi-tasking on a Motion Coordinator. The Motion
Cycle program performs a movement. The Operator Interface program communi-
cates with a membrane keypad to control the Motion Cycle program. In this sim-
ple example of multi-tasking the two tasks communicate via two global variables.
Operator Interface Program
' Motion Coordinator Demonstration Program
start: GOSUB initial
loop:
PRINT #3,CHR(20);CHR(14);
PRINT #3,CURSOR(0);">LENGTH:";in_length[0];
IF VR(start)=ON THEN
PRINT #3,CURSOR(15);"STOP<";
ELSE
PRINT #3,CURSOR(15);" RUN<";
ENDIF
GET #3,kp
PRINT kp
IF kp=53 THEN GOSUB input_length
IF kp=54 THEN VR(start)=1-VR(start)
GOTO loop
input_length:
PRINT #3,CURSOR(60);"New Length:";
GOSUB getnum
IF num>=smallest_len THEN
in_length=num
ELSE
PRINT #3,CURSOR(60);"Min. Length=200mm";
WA(1000)
ENDIF
RETURN
getnum:
VR(start)
This holds the start/stop signal
VR(length)
This holds the movement length